diff --git a/app/helpers/notifier_helper.rb b/app/helpers/notifier_helper.rb index accdf8ddf..582e80115 100644 --- a/app/helpers/notifier_helper.rb +++ b/app/helpers/notifier_helper.rb @@ -1,7 +1,8 @@ module NotifierHelper def post_message(post, opts={}) + opts[:length] ||= 200 if post.respond_to? :formatted_message - message = truncate(post.formatted_message(:plain_text => true), :length => 200) + message = truncate(post.formatted_message(:plain_text => true), :length => opts[:length]) message = process_newlines(message) if opts[:process_newlines] message else diff --git a/app/views/notifier/also_commented.html.haml b/app/views/notifier/also_commented.html.haml index 680f0f5f8..ee9cf451c 100644 --- a/app/views/notifier/also_commented.html.haml +++ b/app/views/notifier/also_commented.html.haml @@ -1,4 +1,4 @@ %p - = process_newlines(truncate(@comment.text, :length => 600)) + = post_message(@comment, :process_newlines => true, :length => 600) %p = link_to t('notifier.comment_on_post.reply', :name => @comment.post.author.first_name), post_url(@comment.post) diff --git a/app/views/notifier/comment_on_post.html.haml b/app/views/notifier/comment_on_post.html.haml index 080957f75..c5209611a 100644 --- a/app/views/notifier/comment_on_post.html.haml +++ b/app/views/notifier/comment_on_post.html.haml @@ -1,4 +1,4 @@ %p - = process_newlines(truncate(@comment.text, :length => 600)) + = post_message(@comment, :process_newlines => true, :length => 600) %p = link_to t('notifier.comment_on_post.reply', :name => @comment.post.author.name), post_url(@comment.post) diff --git a/app/views/notifier/mentioned.html.haml b/app/views/notifier/mentioned.html.haml index 8844eb002..81c3aedf2 100644 --- a/app/views/notifier/mentioned.html.haml +++ b/app/views/notifier/mentioned.html.haml @@ -1,4 +1,4 @@ %p - = process_newlines(truncate(@post.formatted_message(:plain_text => true), :length => 600)) + = post_message(@post, :process_newlines => true, :length => 600) %p = link_to t('notifier.comment_on_post.reply', :name => @post.author.name), post_url(@post) diff --git a/app/views/notifier/mentioned.text.haml b/app/views/notifier/mentioned.text.haml index 1b2323c4a..7b95ef0b3 100644 --- a/app/views/notifier/mentioned.text.haml +++ b/app/views/notifier/mentioned.text.haml @@ -1 +1 @@ -!= @post.formatted_message(:plain_text => true) +!= post_message(@post, :process_newlines => true, :length => 600) diff --git a/app/views/notifier/private_message.html.haml b/app/views/notifier/private_message.html.haml index 9e808b449..6683576ee 100644 --- a/app/views/notifier/private_message.html.haml +++ b/app/views/notifier/private_message.html.haml @@ -1,4 +1,4 @@ %p - = markdownify(@message.text) + = post_message(@message, :process_newlines => true, :length => 2000) %p = link_to t('.reply_to_or_view'), conversations_url(:conversation_id => @conversation)