Merge branch 'develop' into chore/chat-list-design

This commit is contained in:
Sivin Varghese 2021-12-06 08:52:29 +05:30 committed by GitHub
commit 0f2f8a188b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -34,7 +34,7 @@ class ActionCableListener < BaseListener
def conversation_status_changed(event) def conversation_status_changed(event)
conversation, account = extract_conversation_and_account(event) conversation, account = extract_conversation_and_account(event)
tokens = user_tokens(account, conversation.inbox.members) + [conversation.contact&.pubsub_token] tokens = user_tokens(account, conversation.inbox.members) + contact_inbox_tokens(conversation.contact_inbox)
broadcast(account, tokens, CONVERSATION_STATUS_CHANGED, conversation.push_event_data) broadcast(account, tokens, CONVERSATION_STATUS_CHANGED, conversation.push_event_data)
end end
@ -137,6 +137,10 @@ class ActionCableListener < BaseListener
return [] if message.activity? return [] if message.activity?
return [] if contact_inbox.nil? return [] if contact_inbox.nil?
contact_inbox_tokens(contact_inbox)
end
def contact_inbox_tokens(contact_inbox)
contact = contact_inbox.contact contact = contact_inbox.contact
contact_inbox.hmac_verified? ? contact.contact_inboxes.where(hmac_verified: true).filter_map(&:pubsub_token) : [contact_inbox.pubsub_token] contact_inbox.hmac_verified? ? contact.contact_inboxes.where(hmac_verified: true).filter_map(&:pubsub_token) : [contact_inbox.pubsub_token]