aboutsummaryrefslogtreecommitdiffstats
path: root/include/message.php
diff options
context:
space:
mode:
authorRedMatrix <info@friendica.com>2014-11-14 08:52:38 +1100
committerRedMatrix <info@friendica.com>2014-11-14 08:52:38 +1100
commit9132a1c1954bcdeb3a7356212e2c8982e5878bbd (patch)
treeaa7002d73dbcd4136033589f1cb135184f4126c1 /include/message.php
parent109cb936632c693d3f24afb9e2ce533797ad1a7f (diff)
parentac27db22c18ee7a82a52cbadb3efe2760b910499 (diff)
downloadvolse-hubzilla-9132a1c1954bcdeb3a7356212e2c8982e5878bbd.tar.gz
volse-hubzilla-9132a1c1954bcdeb3a7356212e2c8982e5878bbd.tar.bz2
volse-hubzilla-9132a1c1954bcdeb3a7356212e2c8982e5878bbd.zip
Merge pull request #690 from habeascodice/master
Initial postgres support
Diffstat (limited to 'include/message.php')
-rw-r--r--include/message.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/message.php b/include/message.php
index b063530d6..49278f273 100644
--- a/include/message.php
+++ b/include/message.php
@@ -243,7 +243,7 @@ function private_messages_list($uid, $mailbox = '', $start = 0, $numitems = 0) {
$limit = '';
if($numitems)
- $limit = " LIMIT " . intval($start) . ", " . intval($numitems);
+ $limit = " LIMIT " . intval($numitems) . " OFFSET " . intval($start);
if($mailbox !== '') {
$x = q("select channel_hash from channel where channel_id = %d limit 1",
@@ -332,7 +332,7 @@ function private_messages_fetch_message($channel_id, $messageitem_id, $updatesee
}
if($updateseen) {
- $r = q("UPDATE `mail` SET mail_flags = (mail_flags ^ %d) where not (mail_flags & %d) and id = %d AND channel_id = %d",
+ $r = q("UPDATE `mail` SET mail_flags = (mail_flags | %d) where not (mail_flags & %d)>0 and id = %d AND channel_id = %d",
intval(MAIL_SEEN),
intval(MAIL_SEEN),
dbesc($messageitem_id),
@@ -363,7 +363,7 @@ function private_messages_drop($channel_id, $messageitem_id, $drop_conversation
}
}
else {
- $r = q("DELETE FROM mail WHERE id = %d AND channel_id = %d LIMIT 1",
+ $r = q("DELETE FROM mail WHERE id = %d AND channel_id = %d",
intval($messageitem_id),
intval($channel_id)
);
@@ -421,7 +421,7 @@ function private_messages_fetch_conversation($channel_id, $messageitem_id, $upda
if($updateseen) {
- $r = q("UPDATE `mail` SET mail_flags = (mail_flags ^ %d) where not (mail_flags & %d) and parent_mid = '%s' AND channel_id = %d",
+ $r = q("UPDATE `mail` SET mail_flags = (mail_flags | %d) where not (mail_flags & %d)>0 and parent_mid = '%s' AND channel_id = %d",
intval(MAIL_SEEN),
intval(MAIL_SEEN),
dbesc($r[0]['parent_mid']),