From 1c8a36f9ca1f1cfd4cab47b47c855b530467593d Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 11 Oct 2013 23:12:10 -0700 Subject: mail recall --- mod/message.php | 21 +++++++++++++++++++++ view/theme/redbasic/css/style.css | 10 ++++++++++ view/tpl/mail_conv.tpl | 4 ++++ view/tpl/mail_list.tpl | 2 +- 4 files changed, 36 insertions(+), 1 deletion(-) diff --git a/mod/message.php b/mod/message.php index 652481579..058641a5e 100644 --- a/mod/message.php +++ b/mod/message.php @@ -233,6 +233,24 @@ function message_content(&$a) { } } + if((argc() == 3) && (argv(1) === 'recall')) { + if(! intval(argv(2))) + return; + $cmd = argv(1); + $r = q("update mail set mail_flags = mail_flags | %d where id = %d and channel_id = %d limit 1", + intval(MAIL_RECALLED), + intval(argv(2)), + intval(local_user()) + ); + proc_run('php','include/notifier.php','mail',intval(argv(2))); + + if($r) { + info( t('Message recalled.') . EOL ); + } + goaway($a->get_baseurl(true) . '/message' ); + + } + if((argc() > 1) && ($a->argv[1] === 'new')) { @@ -422,6 +440,9 @@ function message_content(&$a) { 'subject' => $message['title'], 'body' => smilies(bbcode($message['body']) . $s), 'delete' => t('Delete message'), + 'recall' => t('Recall message'), + 'can_recall' => (($channel['channel_hash'] == $message['from_xchan']) ? true : false), + 'is_recalled' => (($message['mail_flags'] & MAIL_RECALLED) ? t('Message has been recalled.') : ''), 'date' => datetime_convert('UTC',date_default_timezone_get(),$message['created'],'D, d M Y - g:i A'), ); diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 38174a004..e91e4dc5a 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -1827,6 +1827,12 @@ a.mail-list-link { margin-right: 30px; margin-top: 15px; } +.mail-conv-recall-wrapper { + float: right; + margin-right: 10px; + margin-top: 15px; +} + .mail-conv-break { clear: both; } @@ -3321,6 +3327,10 @@ float: left; width: 20%; } +.mail-list-remove { +width: 5% !important; +} + span.mail-delete { float: left; width: 30px; diff --git a/view/tpl/mail_conv.tpl b/view/tpl/mail_conv.tpl index d25919b39..84bdb451a 100755 --- a/view/tpl/mail_conv.tpl +++ b/view/tpl/mail_conv.tpl @@ -4,10 +4,14 @@
{{$mail.from_name}}
+ {{if $mail.is_recalled}}{{$mail.is_recalled}}{{/if}}
{{$mail.date}}
{{$mail.subject}}
{{$mail.body}}
+ {{if $mail.can_recall}} +
+ {{/if}}
diff --git a/view/tpl/mail_list.tpl b/view/tpl/mail_list.tpl index 4d18a080c..e6ddf3651 100755 --- a/view/tpl/mail_list.tpl +++ b/view/tpl/mail_list.tpl @@ -1,5 +1,5 @@
- + {{$from_name}} {{$from_name}} {{$subject}} -- cgit v1.2.3