修复留言嵌套回复问题
This commit is contained in:
parent
840caf18f3
commit
893c1c753f
|
@ -208,18 +208,28 @@ class JournalsForMessage < ActiveRecord::Base
|
|||
receivers << self.jour
|
||||
end
|
||||
else # 留言回复
|
||||
# 添加留言回复人
|
||||
reply_to = User.find(self.reply_id)
|
||||
if self.user_id != self.parent.user_id && self.user_id != self.parent.jour_id # 如果回帖人不是用户自己
|
||||
receivers << self.parent.user
|
||||
if self.user_id != self.parent.user_id
|
||||
receivers << reply_to
|
||||
if self.reply_id != self.parent.user_id
|
||||
receivers << self.parent.user
|
||||
end
|
||||
else
|
||||
receivers << reply_to
|
||||
end
|
||||
else # 用户自己回复别人的,别人收到消息通知
|
||||
if self.user_id != self.reply_id # 过滤掉自己回复自己的
|
||||
receivers << reply_to
|
||||
end
|
||||
end
|
||||
|
||||
# 添加留言回复人
|
||||
#reply_to = User.find(self.reply_id)
|
||||
#if self.user_id != self.parent.user_id && self.user_id != self.parent.jour_id # 如果回帖人不是用户自己
|
||||
# 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
|
||||
if self.jour_type == 'Principal'
|
||||
|
||||
|
|
Loading…
Reference in New Issue