mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-19 17:58:48 +00:00
Handle group calling event sync messages
This commit is contained in:
@@ -2656,18 +2656,8 @@ type WhatIsThis = import('./window.d').WhatIsThis;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
if (data.message.groupCallUpdate) {
|
||||
if (data.message.groupV2 && messageDescriptor.type === Message.GROUP) {
|
||||
if (window.isGroupCallingEnabled()) {
|
||||
window.reduxActions.calling.peekNotConnectedGroupCall({
|
||||
conversationId: messageDescriptor.id,
|
||||
});
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
window.log.warn(
|
||||
'Received a group call update for a conversation that is not a GV2 group. Ignoring that property and continuing.'
|
||||
);
|
||||
if (handleGroupCallUpdateMessage(data.message, messageDescriptor)) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
// Don't wait for handleDataMessage, as it has its own per-conversation queueing
|
||||
@@ -2952,6 +2942,10 @@ type WhatIsThis = import('./window.d').WhatIsThis;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
if (handleGroupCallUpdateMessage(data.message, messageDescriptor)) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
// Don't wait for handleDataMessage, as it has its own per-conversation queueing
|
||||
message.handleDataMessage(data.message, event.confirm, {
|
||||
data,
|
||||
@@ -2983,6 +2977,27 @@ type WhatIsThis = import('./window.d').WhatIsThis;
|
||||
} as WhatIsThis);
|
||||
}
|
||||
|
||||
// Returns `false` if this message isn't a group call message.
|
||||
function handleGroupCallUpdateMessage(
|
||||
message: DataMessageClass,
|
||||
messageDescriptor: MessageDescriptor
|
||||
): boolean {
|
||||
if (message.groupCallUpdate) {
|
||||
if (message.groupV2 && messageDescriptor.type === Message.GROUP) {
|
||||
if (window.isGroupCallingEnabled()) {
|
||||
window.reduxActions.calling.peekNotConnectedGroupCall({
|
||||
conversationId: messageDescriptor.id,
|
||||
});
|
||||
}
|
||||
return true;
|
||||
}
|
||||
window.log.warn(
|
||||
'Received a group call update for a conversation that is not a GV2 group. Ignoring that property and continuing.'
|
||||
);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
async function unlinkAndDisconnect() {
|
||||
window.Whisper.events.trigger('unauthorized');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user