aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_privmsgs.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2007-07-19 20:38:38 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2007-07-19 20:38:38 +0000
commit75a51629454e971fd85118647d05a2a7f39931ad (patch)
tree2a22645ce7b2ccfdbe62b85515f252af3cd9e131 /phpBB/includes/functions_privmsgs.php
parent870991c0608caf7467018245a0a4e1f1d55efd12 (diff)
downloadforums-75a51629454e971fd85118647d05a2a7f39931ad.tar
forums-75a51629454e971fd85118647d05a2a7f39931ad.tar.gz
forums-75a51629454e971fd85118647d05a2a7f39931ad.tar.bz2
forums-75a51629454e971fd85118647d05a2a7f39931ad.tar.xz
forums-75a51629454e971fd85118647d05a2a7f39931ad.zip
again, a lot of bug fixes
git-svn-id: file:///svn/phpbb/trunk@7909 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_privmsgs.php')
-rw-r--r--phpBB/includes/functions_privmsgs.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index 862df6e4e1..90ffe4a412 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -864,6 +864,17 @@ function update_unread_status($unread, $msg_id, $user_id, $folder_id)
if ($user->data['user_id'] == $user_id)
{
$user->data['user_unread_privmsg']--;
+
+ // Try to cope with previous wrong conversions...
+ if ($user->data['user_unread_privmsg'] < 0)
+ {
+ $sql = 'UPDATE ' . USERS_TABLE . "
+ SET user_unread_privmsg = 0
+ WHERE user_id = $user_id";
+ $db->sql_query($sql);
+
+ $user->data['user_unread_privmsg'] = 0;
+ }
}
}