修复留言嵌套回复问题

This commit is contained in:
huang 2015-08-20 18:54:01 +08:00
parent 840caf18f3
commit 893c1c753f
1 changed files with 18 additions and 8 deletions

View File

@ -208,18 +208,28 @@ class JournalsForMessage < ActiveRecord::Base
receivers << self.jour receivers << self.jour
end end
else # 留言回复 else # 留言回复
# 添加留言回复人
reply_to = User.find(self.reply_id) reply_to = User.find(self.reply_id)
if self.user_id != self.parent.user_id && self.user_id != self.parent.jour_id # 如果回帖人不是用户自己 if self.user_id != self.parent.user_id
receivers << self.parent.user receivers << reply_to
if self.reply_id != self.parent.user_id if self.reply_id != self.parent.user_id
receivers << self.parent.user
end
else
receivers << reply_to receivers << reply_to
end end
else # 用户自己回复别人的,别人收到消息通知
if self.user_id != self.reply_id # 过滤掉自己回复自己的 # 添加留言回复人
receivers << reply_to #reply_to = User.find(self.reply_id)
end #if self.user_id != self.parent.user_id && self.user_id != self.parent.jour_id # 如果回帖人不是用户自己
end # receivers << self.parent.user
# if self.reply_id != self.parent.user_id
# receivers << reply_to
# end
#else # 用户自己回复别人的,别人收到消息通知
# if self.user_id != self.reply_id # 过滤掉自己回复自己的
# receivers << reply_to
# end
#end
end end
if self.jour_type == 'Principal' if self.jour_type == 'Principal'