mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
Bring back conversation.leaveGroup for GV1 scenarios
This commit is contained in:
committed by
Josh Perez
parent
04eb7bc995
commit
7b15bddfc9
@@ -1372,9 +1372,7 @@ export default class MessageSender {
|
||||
proto: DataMessageClass,
|
||||
timestamp = Date.now(),
|
||||
options = {}
|
||||
): Promise<
|
||||
CallbackResultType | Omit<CallbackResultType, 'discoveredIdentifierPairs'>
|
||||
> {
|
||||
): Promise<CallbackResultType> {
|
||||
const myE164 = window.textsecure.storage.user.getNumber();
|
||||
const myUuid = window.textsecure.storage.user.getUuid();
|
||||
const identifiers = providedIdentifiers.filter(
|
||||
@@ -1383,11 +1381,12 @@ export default class MessageSender {
|
||||
|
||||
if (identifiers.length === 0) {
|
||||
return Promise.resolve({
|
||||
successfulIdentifiers: [],
|
||||
failoverIdentifiers: [],
|
||||
errors: [],
|
||||
unidentifiedDeliveries: [],
|
||||
dataMessage: proto.toArrayBuffer(),
|
||||
discoveredIdentifierPairs: [],
|
||||
errors: [],
|
||||
failoverIdentifiers: [],
|
||||
successfulIdentifiers: [],
|
||||
unidentifiedDeliveries: [],
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1686,6 +1685,18 @@ export default class MessageSender {
|
||||
return this.server.modifyGroup(changes, options);
|
||||
}
|
||||
|
||||
async leaveGroup(
|
||||
groupId: string,
|
||||
groupIdentifiers: Array<string>,
|
||||
options?: SendOptionsType
|
||||
): Promise<CallbackResultType> {
|
||||
const proto = new window.textsecure.protobuf.DataMessage();
|
||||
proto.group = new window.textsecure.protobuf.GroupContext();
|
||||
proto.group.id = stringToArrayBuffer(groupId);
|
||||
proto.group.type = window.textsecure.protobuf.GroupContext.Type.QUIT;
|
||||
return this.sendGroupProto(groupIdentifiers, proto, Date.now(), options);
|
||||
}
|
||||
|
||||
async sendExpirationTimerUpdateToGroup(
|
||||
groupId: string,
|
||||
groupIdentifiers: Array<string>,
|
||||
|
||||
Reference in New Issue
Block a user