aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-01-25 13:55:42 -0800
committerfriendica <info@friendica.com>2013-01-25 13:55:42 -0800
commita8575199af9c1697af49ff8a4f15eb904a1773d5 (patch)
tree198173d8a95be516f2f440a3f16586d3fb3b669b /include
parentc657cabc9a2bc3b97ef3e10875fcb159026c314b (diff)
downloadvolse-hubzilla-a8575199af9c1697af49ff8a4f15eb904a1773d5.tar.gz
volse-hubzilla-a8575199af9c1697af49ff8a4f15eb904a1773d5.tar.bz2
volse-hubzilla-a8575199af9c1697af49ff8a4f15eb904a1773d5.zip
upstream fixes, template regeneration
Diffstat (limited to 'include')
-rw-r--r--include/message.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/message.php b/include/message.php
index f3bc61465..756baf15e 100644
--- a/include/message.php
+++ b/include/message.php
@@ -123,7 +123,7 @@ function send_message($uid = 0, $recipient='', $body='', $subject='', $replyto='
}
-function private_messages_list($uid, $mailbox = '', $order = 'created desc', $start = 0, $numitems = 0) {
+function private_messages_list($uid, $mailbox = '', $start = 0, $numitems = 0) {
$where = '';
$limit = '';
@@ -143,8 +143,10 @@ function private_messages_list($uid, $mailbox = '', $order = 'created desc', $st
$where = " and sender_xchan = '" . dbesc($x[0]['channel_hash']) . "' ";
}
+ // For different orderings, consider applying usort on the results. We thought of doing that
+ // inside this function or having some preset sorts, but don't wish to limit app developers.
- $r = q("SELECT * from mail WHERE channel_id = %d $where order by $order $limit",
+ $r = q("SELECT * from mail WHERE channel_id = %d $where order by created desc $limit",
intval(local_user())
);
if(! $r) {
@@ -168,6 +170,7 @@ function private_messages_list($uid, $mailbox = '', $order = 'created desc', $st
$r[$k]['to'] = find_xchan_in_array($rr['to_xchan'],$c);
$r[$k]['seen'] = (($rr['mail_flags'] & MAIL_SEEN) ? 1 : 0);
}
+
return $r;
}