Don't show "group call started" notifications for muted conversations
This commit is contained in:
parent
603c315c82
commit
fc066e05df
1 changed files with 6 additions and 3 deletions
|
@ -2034,6 +2034,11 @@ export class CallingClass {
|
||||||
conversationId: string,
|
conversationId: string,
|
||||||
creatorBytes: undefined | Readonly<Uint8Array>
|
creatorBytes: undefined | Readonly<Uint8Array>
|
||||||
): void {
|
): void {
|
||||||
|
const conversation = window.ConversationController.get(conversationId);
|
||||||
|
if (conversation?.isMuted()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const creatorUuid = creatorBytes ? bytesToUuid(creatorBytes) : undefined;
|
const creatorUuid = creatorBytes ? bytesToUuid(creatorBytes) : undefined;
|
||||||
const creatorConversation = window.ConversationController.get(creatorUuid);
|
const creatorConversation = window.ConversationController.get(creatorUuid);
|
||||||
if (creatorConversation && isMe(creatorConversation.attributes)) {
|
if (creatorConversation && isMe(creatorConversation.attributes)) {
|
||||||
|
@ -2052,8 +2057,7 @@ export class CallingClass {
|
||||||
'calling__call-notification__started-by-someone'
|
'calling__call-notification__started-by-someone'
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
default: {
|
default:
|
||||||
const conversation = window.ConversationController.get(conversationId);
|
|
||||||
// These fallbacks exist just in case something unexpected goes wrong.
|
// These fallbacks exist just in case something unexpected goes wrong.
|
||||||
notificationTitle =
|
notificationTitle =
|
||||||
conversation?.getTitle() || FALLBACK_NOTIFICATION_TITLE;
|
conversation?.getTitle() || FALLBACK_NOTIFICATION_TITLE;
|
||||||
|
@ -2063,7 +2067,6 @@ export class CallingClass {
|
||||||
])
|
])
|
||||||
: window.i18n('calling__call-notification__started-by-someone');
|
: window.i18n('calling__call-notification__started-by-someone');
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
notificationService.notify({
|
notificationService.notify({
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue