diff options
author | Mario Vavti <mario@mariovavti.com> | 2017-11-13 22:01:37 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2017-11-13 22:01:37 +0100 |
commit | c8dbcf8a2af7ac3b1a9e26c4c293574f919bd554 (patch) | |
tree | ac159d37489f24dd6571246731d2803c2b1bba42 /include | |
parent | 5dad44402649db9844d735800300d86a8479b3fa (diff) | |
download | volse-hubzilla-c8dbcf8a2af7ac3b1a9e26c4c293574f919bd554.tar.gz volse-hubzilla-c8dbcf8a2af7ac3b1a9e26c4c293574f919bd554.tar.bz2 volse-hubzilla-c8dbcf8a2af7ac3b1a9e26c4c293574f919bd554.zip |
sort combined private mail conversations by latest updated conversation instead of created parent
Diffstat (limited to 'include')
-rw-r--r-- | include/message.php | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/include/message.php b/include/message.php index 477c7172c..b57d2e068 100644 --- a/include/message.php +++ b/include/message.php @@ -335,12 +335,9 @@ function private_messages_list($uid, $mailbox = '', $start = 0, $numitems = 0) { case 'combined': default: - - $parents = q("SELECT parent_mid FROM mail WHERE mid = parent_mid AND channel_id = %d ORDER BY created DESC", + $parents = q("SELECT mail.parent_mid FROM mail LEFT JOIN conv ON mail.conv_guid = conv.guid WHERE mail.mid = mail.parent_mid AND mail.channel_id = %d ORDER BY conv.updated DESC $limit", dbesc($local_channel) ); - //FIXME: We need the latest mail of a thread here. This query throws errors in postgres. We now look for the latest in php until somebody can fix this... - //$sql = "SELECT * FROM ( SELECT * FROM mail WHERE channel_id = $local_channel ORDER BY created DESC $limit ) AS temp_table GROUP BY parent_mid ORDER BY created DESC"; break; } |