From 867deda24771848575bb7d9cb7e4bfc82e642e33 Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 11 Jan 2022 09:29:18 +0000 Subject: remove legacy mail which has been deprecated since a year --- Zotlabs/Widget/Conversations.php | 163 --------------------------------------- Zotlabs/Widget/Mailmenu.php | 38 --------- 2 files changed, 201 deletions(-) delete mode 100644 Zotlabs/Widget/Conversations.php delete mode 100644 Zotlabs/Widget/Mailmenu.php (limited to 'Zotlabs/Widget') diff --git a/Zotlabs/Widget/Conversations.php b/Zotlabs/Widget/Conversations.php deleted file mode 100644 index 3dc260b50..000000000 --- a/Zotlabs/Widget/Conversations.php +++ /dev/null @@ -1,163 +0,0 @@ - $mailbox, - 'id' => $rr['id'], - 'from_name' => $rr['from']['xchan_name'], - 'from_url' => chanlink_hash($rr['from_xchan']), - 'from_photo' => $rr['from']['xchan_photo_s'], - 'to_name' => $rr['to']['xchan_name'], - 'to_url' => chanlink_hash($rr['to_xchan']), - 'to_photo' => $rr['to']['xchan_photo_s'], - 'subject' => (($rr['seen']) ? $rr['title'] : '' . $rr['title'] . ''), - 'delete' => t('Delete conversation'), - 'body' => $rr['body'], - 'date' => datetime_convert('UTC',date_default_timezone_get(),$rr['created'], 'c'), - 'seen' => $rr['seen'], - 'selected' => ((argv(1) != 'new') ? $selected : '') - ]; - } - - $tpl = get_markup_template('mail_head.tpl'); - $o .= replace_macros($tpl, [ - '$header' => $header, - '$messages' => $messages - ]); - - return $o; - } - - function private_messages_list($uid, $mailbox = '', $start = 0, $numitems = 0) { - - $where = ''; - $limit = ''; - - $t0 = dba_timer(); - - if($numitems) - $limit = " LIMIT " . intval($numitems) . " OFFSET " . intval($start); - - if($mailbox !== '') { - $x = q("select channel_hash from channel where channel_id = %d limit 1", - intval($uid) - ); - - if(! $x) - return array(); - - $channel_hash = dbesc($x[0]['channel_hash']); - $local_channel = intval(local_channel()); - - switch($mailbox) { - - case 'inbox': - $sql = "SELECT * FROM mail WHERE channel_id = $local_channel AND from_xchan != '$channel_hash' ORDER BY created DESC $limit"; - break; - - case 'outbox': - $sql = "SELECT * FROM mail WHERE channel_id = $local_channel AND from_xchan = '$channel_hash' ORDER BY created DESC $limit"; - break; - - case 'combined': - default: - $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", - intval($local_channel) - ); - break; - } - - } - - $r = null; - - if($parents) { - foreach($parents as $parent) { - $all = q("SELECT * FROM mail WHERE parent_mid = '%s' AND channel_id = %d ORDER BY created DESC limit 1", - dbesc($parent['parent_mid']), - intval($local_channel) - ); - - if($all) { - foreach($all as $single) { - $r[] = $single; - } - } - } - } - elseif($sql) { - $r = q($sql); - } - - if(! $r) { - return array(); - } - - $chans = array(); - foreach($r as $rr) { - $s = "'" . dbesc(trim($rr['from_xchan'])) . "'"; - if(! in_array($s,$chans)) - $chans[] = $s; - $s = "'" . dbesc(trim($rr['to_xchan'])) . "'"; - if(! in_array($s,$chans)) - $chans[] = $s; - } - - $c = q("select * from xchan where xchan_hash in (" . protect_sprintf(implode(',',$chans)) . ")"); - - foreach($r as $k => $rr) { - $r[$k]['from'] = find_xchan_in_array($rr['from_xchan'],$c); - $r[$k]['to'] = find_xchan_in_array($rr['to_xchan'],$c); - $r[$k]['seen'] = intval($rr['mail_seen']); - if(intval($r[$k]['mail_obscured'])) { - if($r[$k]['title']) - $r[$k]['title'] = base64url_decode(str_rot47($r[$k]['title'])); - if($r[$k]['body']) - $r[$k]['body'] = base64url_decode(str_rot47($r[$k]['body'])); - } - } - - return $r; - } - -} - diff --git a/Zotlabs/Widget/Mailmenu.php b/Zotlabs/Widget/Mailmenu.php deleted file mode 100644 index ca022c807..000000000 --- a/Zotlabs/Widget/Mailmenu.php +++ /dev/null @@ -1,38 +0,0 @@ - t('Private Mail Menu'), - '$combined' => array( - 'label' => t('Combined View'), - 'url' => z_root() . '/mail/combined', - 'sel' => (argv(1) == 'combined' || argc() == 1), - ), - '$inbox' => array( - 'label' => t('Inbox'), - 'url' => z_root() . '/mail/inbox', - 'sel' => (argv(1) == 'inbox'), - ), - '$outbox' => array( - 'label' => t('Outbox'), - 'url' => z_root() . '/mail/outbox', - 'sel' => (argv(1) == 'outbox'), - ), -/* - '$new' => array( - 'label' => t('New Message'), - 'url' => z_root() . '/mail/new', - 'sel'=> (argv(1) == 'new'), - ) -*/ - )); - } -} -- cgit v1.2.3