Send group call events to linked devices
This commit is contained in:
parent
496bdec35d
commit
a142cb522e
3 changed files with 27 additions and 13 deletions
|
@ -1084,7 +1084,7 @@ export async function initiateMigrationToGroupV2(
|
|||
});
|
||||
}
|
||||
|
||||
async function wrapWithSyncMessageSend({
|
||||
export async function wrapWithSyncMessageSend({
|
||||
conversation,
|
||||
logId,
|
||||
send,
|
||||
|
@ -1094,7 +1094,7 @@ async function wrapWithSyncMessageSend({
|
|||
logId: string;
|
||||
send: (sender: MessageSender) => Promise<CallbackResultType | undefined>;
|
||||
timestamp: number;
|
||||
}) {
|
||||
}): Promise<void> {
|
||||
const sender = window.textsecure.messaging;
|
||||
if (!sender) {
|
||||
throw new Error(
|
||||
|
|
|
@ -51,7 +51,11 @@ import {
|
|||
arrayBufferToUuid,
|
||||
} from '../Crypto';
|
||||
import { getOwn } from '../util/getOwn';
|
||||
import { fetchMembershipProof, getMembershipList } from '../groups';
|
||||
import {
|
||||
fetchMembershipProof,
|
||||
getMembershipList,
|
||||
wrapWithSyncMessageSend,
|
||||
} from '../groups';
|
||||
import { missingCaseError } from '../util/missingCaseError';
|
||||
import { normalizeGroupCallTimestamp } from '../util/ringrtc/normalizeGroupCallTimestamp';
|
||||
|
||||
|
@ -706,10 +710,16 @@ export class CallingClass {
|
|||
return;
|
||||
}
|
||||
|
||||
const timestamp = Date.now();
|
||||
|
||||
// We "fire and forget" because sending this message is non-essential.
|
||||
window.textsecure.messaging
|
||||
.sendGroupCallUpdate({ eraId, groupV2 }, sendOptions)
|
||||
.catch(err => {
|
||||
wrapWithSyncMessageSend({
|
||||
conversation,
|
||||
logId: `sendGroupCallUpdateMessage/${conversationId}-${eraId}`,
|
||||
send: sender =>
|
||||
sender.sendGroupCallUpdate({ eraId, groupV2, timestamp }, sendOptions),
|
||||
timestamp,
|
||||
}).catch(err => {
|
||||
window.log.error('Failed to send group call update', err);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1143,15 +1143,19 @@ export default class MessageSender {
|
|||
);
|
||||
}
|
||||
|
||||
async sendGroupCallUpdate(
|
||||
{ groupV2, eraId }: { groupV2: GroupV2InfoType; eraId: string },
|
||||
sendGroupCallUpdate(
|
||||
{
|
||||
groupV2,
|
||||
eraId,
|
||||
timestamp,
|
||||
}: { groupV2: GroupV2InfoType; eraId: string; timestamp: number },
|
||||
options?: SendOptionsType
|
||||
): Promise<void> {
|
||||
await this.sendMessageToGroup(
|
||||
): Promise<CallbackResultType> {
|
||||
return this.sendMessageToGroup(
|
||||
{
|
||||
groupV2,
|
||||
groupCallUpdate: { eraId },
|
||||
timestamp: Date.now(),
|
||||
timestamp,
|
||||
},
|
||||
options
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue