fix(chat/api): don't count muted chats' unviewed count unless mentioned (#3619)
This commit is contained in:
parent
9e7f1338f0
commit
a46bf97bf3
|
@ -149,7 +149,9 @@ func (api *API) getChannelGroups(ctx context.Context, channelGroupID string) (ma
|
||||||
if !chat.IsActivePersonalChat() {
|
if !chat.IsActivePersonalChat() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
if !chat.Muted || chat.UnviewedMentionsCount > 0 {
|
||||||
totalUnviewedMessageCount += int(chat.UnviewedMessagesCount)
|
totalUnviewedMessageCount += int(chat.UnviewedMessagesCount)
|
||||||
|
}
|
||||||
totalUnviewedMentionsCount += int(chat.UnviewedMentionsCount)
|
totalUnviewedMentionsCount += int(chat.UnviewedMentionsCount)
|
||||||
|
|
||||||
c, err := api.toAPIChat(chat, nil, pubKey, true)
|
c, err := api.toAPIChat(chat, nil, pubKey, true)
|
||||||
|
@ -197,8 +199,9 @@ func (api *API) getChannelGroups(ctx context.Context, channelGroupID string) (ma
|
||||||
if chat.CommunityID != community.IDString() || !chat.Active {
|
if chat.CommunityID != community.IDString() || !chat.Active {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
if !chat.Muted || chat.UnviewedMentionsCount > 0 {
|
||||||
totalUnviewedMessageCount += int(chat.UnviewedMessagesCount)
|
totalUnviewedMessageCount += int(chat.UnviewedMessagesCount)
|
||||||
|
}
|
||||||
totalUnviewedMentionsCount += int(chat.UnviewedMentionsCount)
|
totalUnviewedMentionsCount += int(chat.UnviewedMentionsCount)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue