Oh, thanks alot! I've made the changes in the code and put a new version here.
Download the file and replace message_list.php OR change it manually:
In message_list.php find:
// Set user
$result = $db->query('SELECT status FROM '.$db->prefix.'messages WHERE id='.$id) or error('Unable to get message status', __FILE__, __LINE__, $db->error());
list($status) = $db->fetch_row($result);
$status == 0 ? $where = 'u.id=m.sender_id' : $where = 'u.id=m.owner';
$result = $db->query('SELECT m.id AS mid,m.subject,m.sender_ip,m.message,m.smileys,m.posted,m.showed,u.id,username,registered,email,title,url,icq,msn,aim,yahoo,location,use_avatar,email_setting,num_posts FROM '.$db->prefix.'messages AS m,'.$db->prefix.'users AS u WHERE '.$where.' AND m.id='.$id) or error('Unable to fetch message and user info', __FILE__, __LINE__, $db->error());
$cur_post = $db->fetch_assoc($result);
if ($cur_post['showed'] == 0){
$db->query('UPDATE '.$db->prefix.'messages SET showed=1 WHERE id='.$id) or error('Unable to update message info', __FILE__, __LINE__, $db->error());
}
Change to:
// Set user
$result = $db->query('SELECT status,owner FROM '.$db->prefix.'messages WHERE id='.$id) or error('Unable to get message status', __FILE__, __LINE__, $db->error());
list($status, $owner) = $db->fetch_row($result);
$status == 0 ? $where = 'u.id=m.sender_id' : $where = 'u.id=m.owner';
$result = $db->query('SELECT m.id AS mid,m.subject,m.sender_ip,m.message,m.smileys,m.posted,m.showed,u.id,username,registered,email,title,url,icq,msn,aim,yahoo,location,use_avatar,email_setting,num_posts FROM '.$db->prefix.'messages AS m,'.$db->prefix.'users AS u WHERE '.$where.' AND m.id='.$id) or error('Unable to fetch message and user info', __FILE__, __LINE__, $db->error());
$cur_post = $db->fetch_assoc($result);
if ($owner != $cur_user['id'])
message($lang_common['No permission']);
if ($cur_post['showed'] == 0){
$db->query('UPDATE '.$db->prefix.'messages SET showed=1 WHERE id='.$id) or error('Unable to update message info', __FILE__, __LINE__, $db->error());
}