diff options
| author | Marc Alexander <admin@m-a-styles.de> | 2016-12-01 11:41:21 +0100 |
|---|---|---|
| committer | Marc Alexander <admin@m-a-styles.de> | 2016-12-01 11:41:21 +0100 |
| commit | 1c567daf392118f3898b914d5b4535ee440c7681 (patch) | |
| tree | 6fe27ce811970d11615f24d639764c1f66c2cfec | |
| parent | d8944728668bb5087192df7b94c7cfc99cdb55a2 (diff) | |
| parent | 365489a3171b4d16e645215c4fe4e39ae7c95f4c (diff) | |
| download | forums-1c567daf392118f3898b914d5b4535ee440c7681.tar forums-1c567daf392118f3898b914d5b4535ee440c7681.tar.gz forums-1c567daf392118f3898b914d5b4535ee440c7681.tar.bz2 forums-1c567daf392118f3898b914d5b4535ee440c7681.tar.xz forums-1c567daf392118f3898b914d5b4535ee440c7681.zip | |
Merge branch '3.1.x' into 3.2.x
| -rw-r--r-- | phpBB/includes/functions_privmsgs.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 69c3dad9e6..7eb4f29109 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -892,6 +892,12 @@ function update_unread_status($unread, $msg_id, $user_id, $folder_id) AND folder_id = $folder_id"; $db->sql_query($sql); + // If the message is already marked as read, we just skip the rest to avoid negative PM count + if (!$db->sql_affectedrows()) + { + return; + } + $sql = 'UPDATE ' . USERS_TABLE . " SET user_unread_privmsg = user_unread_privmsg - 1 WHERE user_id = $user_id"; |
