diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/attach.php | 2 | ||||
-rw-r--r-- | include/message.php | 5 |
2 files changed, 2 insertions, 5 deletions
diff --git a/include/attach.php b/include/attach.php index 179a57a90..2bb57722b 100644 --- a/include/attach.php +++ b/include/attach.php @@ -1366,7 +1366,7 @@ function attach_delete($channel_id, $resource, $is_photo = 0) { return; } - $url = get_cloudpath($channel_id, $channel_address, $resource); + $url = get_cloud_url($channel_id, $channel_address, $resource); $object = get_file_activity_object($channel_id, $resource, $url); // If resource is a directory delete everything in the directory recursive 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; } |