Unify MessageReceiver and MessageReceiverInner

This commit is contained in:
Fedor Indutny 2021-07-23 13:47:03 -07:00 committed by GitHub
parent a05d528c1f
commit 9c6343e10d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 356 additions and 367 deletions

View file

@ -2873,17 +2873,8 @@ export async function startApp(): Promise<void> {
const details = ev.groupDetails;
const { id } = details;
const idBuffer = id;
const idBytes = idBuffer.byteLength;
if (idBytes !== 16) {
window.log.error(
`onGroupReceived: Id was ${idBytes} bytes, expected 16 bytes. Dropping group.`
);
return;
}
const conversation = await window.ConversationController.getOrCreateAndWait(
Bytes.toBinary(id),
id,
'group'
);
if (isGroupV2(conversation.attributes)) {

File diff suppressed because it is too large Load diff

View file

@ -119,8 +119,13 @@ export class ContactSyncEvent extends Event {
}
}
export type GroupEventData = Omit<ModifiedGroupDetails, 'id'> &
Readonly<{
id: string;
}>;
export class GroupEvent extends Event {
constructor(public readonly groupDetails: ModifiedGroupDetails) {
constructor(public readonly groupDetails: GroupEventData) {
super('group');
}
}