From d6293730fc1a841e60bb145e5ac6470205effe9f Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 25 Sep 2015 23:26:28 +0200 Subject: private mail: some work on conversations view --- mod/mail.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mod/mail.php') diff --git a/mod/mail.php b/mod/mail.php index 2e7e3699a..75e8f4dd5 100644 --- a/mod/mail.php +++ b/mod/mail.php @@ -313,10 +313,10 @@ function mail_content(&$a) { 'id' => $message['id'], 'from_name' => $message['from']['xchan_name'], 'from_url' => chanlink_hash($message['from_xchan']), - 'from_photo' => $message['from']['xchan_photo_m'], + 'from_photo' => $message['from']['xchan_photo_s'], 'to_name' => $message['to']['xchan_name'], 'to_url' => chanlink_hash($message['to_xchan']), - 'to_photo' => $message['to']['xchan_photo_m'], + 'to_photo' => $message['to']['xchan_photo_s'], 'subject' => $message['title'], 'body' => smilies(bbcode($message['body']) . $s), 'delete' => t('Delete message'), @@ -353,7 +353,7 @@ function mail_content(&$a) { '$showinputs' => '', '$subject' => t('Subject:'), '$subjtxt' => $message['title'], - '$readonly' => ' readonly="readonly" style="background: #BBBBBB;" ', + '$readonly' => 'readonly="readonly"', '$yourmessage' => t('Your message:'), '$text' => '', '$select' => $select, -- cgit v1.2.3 From b97102da01b2e81018e86c29092059704ee20da8 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 28 Sep 2015 17:40:38 +0200 Subject: private mail: bring additional inbox/outbox views and ajaxify single message drop --- mod/mail.php | 44 +++++++++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 15 deletions(-) (limited to 'mod/mail.php') diff --git a/mod/mail.php b/mod/mail.php index 75e8f4dd5..e4a5ebafd 100644 --- a/mod/mail.php +++ b/mod/mail.php @@ -128,33 +128,45 @@ function mail_content(&$a) { '$header' => t('Messages'), )); - if((argc() == 3) && (argv(1) === 'drop')) { - if(! intval(argv(2))) + if((argc() == 4) && (argv(2) === 'drop')) { + if(! intval(argv(3))) return; - $cmd = argv(1); - - $r = private_messages_drop(local_channel(), argv(2)); + $cmd = argv(2); + $mailbox = argv(1); + $r = private_messages_drop(local_channel(), argv(3)); if($r) { - info( t('Message deleted.') . EOL ); + //info( t('Message deleted.') . EOL ); } - goaway($a->get_baseurl(true) . '/mail/combined' ); + goaway($a->get_baseurl(true) . '/mail/' . $mailbox); } - if((argc() == 3) && (argv(1) === 'recall')) { - if(! intval(argv(2))) + if((argc() == 4) && (argv(2) === 'recall')) { + if(! intval(argv(3))) return; - $cmd = argv(1); + $cmd = argv(2); + $mailbox = argv(1); $r = q("update mail set mail_recalled = 1 where id = %d and channel_id = %d", - intval(argv(2)), + intval(argv(3)), intval(local_channel()) ); - proc_run('php','include/notifier.php','mail',intval(argv(2))); + proc_run('php','include/notifier.php','mail',intval(argv(3))); if($r) { info( t('Message recalled.') . EOL ); } - goaway($a->get_baseurl(true) . '/mail/combined' ); + goaway($a->get_baseurl(true) . '/mail/' . $mailbox . '/' . argv(3)); + + } + if((argc() == 4) && (argv(2) === 'dropconv')) { + if(! intval(argv(3))) + return; + $cmd = argv(2); + $mailbox = argv(1); + $r = private_messages_drop(local_channel(), argv(3), true); + if($r) + info( t('Conversation removed.') . EOL ); + goaway($a->get_baseurl(true) . '/mail/' . $mailbox); } if((argc() > 1) && (argv(1) === 'new')) { @@ -266,7 +278,7 @@ function mail_content(&$a) { $last_message = private_messages_list(local_channel(), $mailbox, 0, 1); - $mid = ((argc() > 1) && (intval(argv(1)))) ? argv(1) : $last_message[0]['id']; + $mid = ((argc() > 2) && (intval(argv(2)))) ? argv(2) : $last_message[0]['id']; $plaintext = true; @@ -310,6 +322,7 @@ function mail_content(&$a) { $s = theme_attachments($message); $mails[] = array( + 'mailbox' => $mailbox, 'id' => $message['id'], 'from_name' => $message['from']['xchan_name'], 'from_url' => chanlink_hash($message['from_xchan']), @@ -338,7 +351,8 @@ function mail_content(&$a) { $parent = ''; $tpl = get_markup_template('mail_display.tpl'); $o = replace_macros($tpl, array( - '$prvmsg_header' => t('Subject:') . ' ' . $message['title'], + '$mailbox' => $mailbox, + '$prvmsg_header' => $message['title'], '$thread_id' => $mid, '$thread_subject' => $message['title'], '$thread_seen' => $seen, -- cgit v1.2.3