- if message.to_user_id == @user.id then
- message.update_attribute(:message_read, true)
+ if message.recipient == current_user
+ message.update(:message_read => true)
+
+ @message = Message.new(
+ :recipient => message.sender,
+ :title => "Re: #{message.title.sub(/^Re:\s*/, '')}",
+ :body => "On #{message.sent_on} #{message.sender.display_name} wrote:\n\n#{message.body.gsub(/^/, '> ')}"
+ )