Remove isPrivate, isMe, isGroupV1, isGroupV2 from model

This commit is contained in:
Josh Perez 2021-06-07 12:39:13 -04:00 committed by GitHub
parent eaf4036fc8
commit d4875fd8f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 377 additions and 267 deletions

View file

@ -38,6 +38,7 @@ import {
import { ContentClass } from '../textsecure.d';
import { assert } from './assert';
import { isGroupV2 } from './whatTypeOfConversation';
const ERROR_EXPIRED_OR_MISSING_DEVICES = 409;
const ERROR_STALE_DEVICES = 410;
@ -116,7 +117,7 @@ export async function sendContentMessageToGroup({
if (
ourConversation?.get('capabilities')?.senderKey &&
conversation.isGroupV2()
isGroupV2(conversation.attributes)
) {
try {
return await sendToGroupViaSenderKey({
@ -138,7 +139,7 @@ export async function sendContentMessageToGroup({
}
}
const groupId = conversation.isGroupV2()
const groupId = isGroupV2(conversation.attributes)
? conversation.get('groupId')
: undefined;
return window.textsecure.messaging.sendGroupProto(
@ -191,7 +192,7 @@ export async function sendToGroupViaSenderKey(options: {
}
const groupId = conversation.get('groupId');
if (!groupId || !conversation.isGroupV2()) {
if (!groupId || !isGroupV2(conversation.attributes)) {
throw new Error(
`sendToGroupViaSenderKey/${logId}: Missing groupId or group is not GV2`
);