From 387eed5c169911741197f21982eb01675e1fcfee Mon Sep 17 00:00:00 2001 From: Andrea Maria Piana Date: Mon, 15 Mar 2021 15:40:17 +0100 Subject: [PATCH] Add group chat messages to notifications --- protocol/chat.go | 4 ++++ protocol/messenger.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/protocol/chat.go b/protocol/chat.go index e535b1068..803ab38ae 100644 --- a/protocol/chat.go +++ b/protocol/chat.go @@ -108,6 +108,10 @@ func (c *Chat) OneToOne() bool { return c.ChatType == ChatTypeOneToOne } +func (c *Chat) PrivateGroupChat() bool { + return c.ChatType == ChatTypePrivateGroupChat +} + func (c *Chat) CommunityChatID() string { if c.ChatType != ChatTypeCommunityChat { return c.ID diff --git a/protocol/messenger.go b/protocol/messenger.go index d5bf4eb67..976897f6c 100644 --- a/protocol/messenger.go +++ b/protocol/messenger.go @@ -3023,7 +3023,7 @@ func (m *Messenger) handleRetrievedMessages(chatWithMessages map[transport.Filte } func showNotification(publicKey ecdsa.PublicKey, n MessageNotificationBody, responseTo *common.Message) bool { - if n.Chat != nil && n.Chat.ChatType == ChatTypeOneToOne { + if n.Chat != nil && (n.Chat.OneToOne() || n.Chat.PrivateGroupChat()) { return true }