Better handling of calling messages
This commit is contained in:
parent
a2f1b469ea
commit
b26f60d2fc
2 changed files with 47 additions and 1 deletions
|
@ -66,7 +66,7 @@ import {
|
|||
findBestMatchingCameraId,
|
||||
} from '../calling/findBestMatchingDevice';
|
||||
import type { LocalizerType } from '../types/Util';
|
||||
import { UUID } from '../types/UUID';
|
||||
import { UUID, UUIDKind } from '../types/UUID';
|
||||
import type { ConversationModel } from '../models/conversations';
|
||||
import * as Bytes from '../Bytes';
|
||||
import { uuidToBytes, bytesToUuid } from '../Crypto';
|
||||
|
@ -1720,6 +1720,33 @@ export class CallingClass {
|
|||
log.error('handleGroupCallRingUpdate(): could not find conversation');
|
||||
return;
|
||||
}
|
||||
|
||||
const logId = `handleGroupCallRingUpdate(${conversation.idForLogging()})`;
|
||||
if (conversation.isBlocked()) {
|
||||
log.warn(`${logId}: is blocked`);
|
||||
return;
|
||||
}
|
||||
|
||||
const ourACI = window.textsecure.storage.user.getCheckedUuid(UUIDKind.ACI);
|
||||
|
||||
if (conversation.get('left') || !conversation.hasMember(ourACI)) {
|
||||
log.warn(`${logId}: we left the group`);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!conversation.hasMember(new UUID(ringerUuid))) {
|
||||
log.warn(`${logId}: they left the group`);
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
conversation.get('announcementsOnly') &&
|
||||
!conversation.isAdmin(new UUID(ringerUuid))
|
||||
) {
|
||||
log.warn(`${logId}: non-admin update to announcement-only group`);
|
||||
return;
|
||||
}
|
||||
|
||||
const conversationId = conversation.id;
|
||||
|
||||
let shouldRing = false;
|
||||
|
@ -1812,6 +1839,13 @@ export class CallingClass {
|
|||
return null;
|
||||
}
|
||||
|
||||
if (conversation.isBlocked()) {
|
||||
log.warn(
|
||||
`handleIncomingCall(): ${conversation.idForLogging()} is blocked`
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
// The peer must be 'trusted' before accepting a call from them.
|
||||
// This is mostly the safety number check, unverified meaning that they were
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue