mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 12:02:05 +08:00
DEV: Move discourse-chat
to the core repo. (#18776)
As part of this move, we are also renaming `discourse-chat` to `chat`.
This commit is contained in:
15
plugins/chat/lib/extensions/user_email_extension.rb
Normal file
15
plugins/chat/lib/extensions/user_email_extension.rb
Normal file
@ -0,0 +1,15 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Chat::UserEmailExtension
|
||||
def execute(args)
|
||||
super(args)
|
||||
|
||||
if args[:type] == "chat_summary" && args[:memberships_to_update_data].present?
|
||||
args[:memberships_to_update_data].to_a.each do |membership_id, max_unread_mention_id|
|
||||
UserChatChannelMembership.find_by(user: args[:user_id], id: membership_id.to_i)&.update(
|
||||
last_unread_mention_when_emailed_id: max_unread_mention_id.to_i,
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user