mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-20 02:08:57 +00:00
Handle group calling event sync messages
This commit is contained in:
@@ -2656,19 +2656,9 @@ type WhatIsThis = import('./window.d').WhatIsThis;
|
|||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.message.groupCallUpdate) {
|
if (handleGroupCallUpdateMessage(data.message, messageDescriptor)) {
|
||||||
if (data.message.groupV2 && messageDescriptor.type === Message.GROUP) {
|
|
||||||
if (window.isGroupCallingEnabled()) {
|
|
||||||
window.reduxActions.calling.peekNotConnectedGroupCall({
|
|
||||||
conversationId: messageDescriptor.id,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return Promise.resolve();
|
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.'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Don't wait for handleDataMessage, as it has its own per-conversation queueing
|
// Don't wait for handleDataMessage, as it has its own per-conversation queueing
|
||||||
message.handleDataMessage(data.message, event.confirm);
|
message.handleDataMessage(data.message, event.confirm);
|
||||||
@@ -2952,6 +2942,10 @@ type WhatIsThis = import('./window.d').WhatIsThis;
|
|||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (handleGroupCallUpdateMessage(data.message, messageDescriptor)) {
|
||||||
|
return Promise.resolve();
|
||||||
|
}
|
||||||
|
|
||||||
// Don't wait for handleDataMessage, as it has its own per-conversation queueing
|
// Don't wait for handleDataMessage, as it has its own per-conversation queueing
|
||||||
message.handleDataMessage(data.message, event.confirm, {
|
message.handleDataMessage(data.message, event.confirm, {
|
||||||
data,
|
data,
|
||||||
@@ -2983,6 +2977,27 @@ type WhatIsThis = import('./window.d').WhatIsThis;
|
|||||||
} as 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() {
|
async function unlinkAndDisconnect() {
|
||||||
window.Whisper.events.trigger('unauthorized');
|
window.Whisper.events.trigger('unauthorized');
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user