diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/channel.php | 4 | ||||
-rw-r--r-- | include/message.php | 10 |
2 files changed, 8 insertions, 6 deletions
diff --git a/include/channel.php b/include/channel.php index 77a4ba60f..b06c1994f 100644 --- a/include/channel.php +++ b/include/channel.php @@ -737,14 +737,14 @@ function identity_basic_export($channel_id, $sections = null) { $ret['conv'] = $r; } - $r = q("select * from mail where mail.uid = %d", + $r = q("select * from mail where channel_id = %d", intval($channel_id) ); if($r) { $m = array(); foreach($r as $rr) { xchan_mail_query($rr); - $m[] = mail_encode($rr,true); + $m[] = encode_mail($rr,true); } $ret['mail'] = $m; } diff --git a/include/message.php b/include/message.php index a394a411d..5458eeb0e 100644 --- a/include/message.php +++ b/include/message.php @@ -452,10 +452,12 @@ function private_messages_drop($channel_id, $messageitem_id, $drop_conversation intval($channel_id) ); if($z) { - q("delete from conv where guid = '%s' and uid = %d", - dbesc($x[0]['conv_guid']), - intval($channel_id) - ); + if($x[0]['conv_guid']) { + q("delete from conv where guid = '%s' and uid = %d", + dbesc($x[0]['conv_guid']), + intval($channel_id) + ); + } $m['mail'] = array(); foreach($z as $zz) { xchan_mail_query($zz); |