From 593423434c0c0e8d1ebb43d97b2dda7e6b4d67bd Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 2 Dec 2015 09:44:25 +0100 Subject: fix attachment rendering for mail --- include/message.php | 2 +- mod/mail.php | 3 ++- view/css/mod_mail.css | 4 ++++ view/tpl/mail_conv.tpl | 6 ++++++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/include/message.php b/include/message.php index 820d814b6..169f394d9 100644 --- a/include/message.php +++ b/include/message.php @@ -173,7 +173,7 @@ function send_message($uid = 0, $recipient='', $body='', $subject='', $replyto=' 'revision' => $r['data']['revision'] ); } - $body = str_replace($match[1],'',$body); + $body = trim(str_replace($match[1],'',$body)); } } diff --git a/mod/mail.php b/mod/mail.php index 536149a28..44c4b479d 100644 --- a/mod/mail.php +++ b/mod/mail.php @@ -329,7 +329,8 @@ function mail_content(&$a) { 'to_url' => chanlink_hash($message['to_xchan']), 'to_photo' => $message['to']['xchan_photo_s'], 'subject' => $message['title'], - 'body' => smilies(bbcode($message['body']) . $s), + 'body' => smilies(bbcode($message['body'])), + 'attachments' => $s, 'delete' => t('Delete message'), 'dreport' => t('Delivery report'), 'recall' => t('Recall message'), diff --git a/view/css/mod_mail.css b/view/css/mod_mail.css index 5fd646765..1346eecd5 100644 --- a/view/css/mod_mail.css +++ b/view/css/mod_mail.css @@ -24,3 +24,7 @@ #prvmail-rotator { margin: 15px; } + +.mail-conv-outside-wrapper { + margin-bottom: 20px; +} diff --git a/view/tpl/mail_conv.tpl b/view/tpl/mail_conv.tpl index 4f54f1a6a..5e5d9808d 100755 --- a/view/tpl/mail_conv.tpl +++ b/view/tpl/mail_conv.tpl @@ -13,6 +13,12 @@ {{$mail.body}}
+ {{if $mail.attachments}} + + {{/if}}