aboutsummaryrefslogtreecommitdiffstats
path: root/include/message.php
diff options
context:
space:
mode:
authorhabeascodice <habeascodice@federated.social>2014-11-17 08:30:26 -0800
committerhabeascodice <habeascodice@federated.social>2014-11-17 08:30:26 -0800
commit540b7af2c12666047710dd8f5e0c54d23ae8872c (patch)
treeea90f72d9d308f6cb061a528c1f8494106e70087 /include/message.php
parent80eb84e843cdca51bbf4ebda180f4de41351b9c4 (diff)
parentee38bebbd6a641eb953eacf493c085053442d972 (diff)
downloadvolse-hubzilla-540b7af2c12666047710dd8f5e0c54d23ae8872c.tar.gz
volse-hubzilla-540b7af2c12666047710dd8f5e0c54d23ae8872c.tar.bz2
volse-hubzilla-540b7af2c12666047710dd8f5e0c54d23ae8872c.zip
Merge branch 'master' of https://github.com/habeascodice/red
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']),