Removes groupv1 protos
This commit is contained in:
parent
6c70cd450b
commit
8aac997b4f
13 changed files with 21 additions and 373 deletions
|
@ -31,8 +31,6 @@ type MessageWithAvatar<Message extends OptionalFields> = Omit<
|
|||
expireTimer?: DurationInSeconds;
|
||||
};
|
||||
|
||||
export type ModifiedGroupDetails = MessageWithAvatar<Proto.GroupDetails>;
|
||||
|
||||
export type ModifiedContactDetails = MessageWithAvatar<Proto.ContactDetails>;
|
||||
|
||||
/* eslint-disable @typescript-eslint/brace-style -- Prettier conflicts with ESLint */
|
||||
|
@ -107,41 +105,6 @@ abstract class ParserBase<
|
|||
}
|
||||
}
|
||||
|
||||
export class GroupBuffer extends ParserBase<
|
||||
Proto.GroupDetails,
|
||||
typeof Proto.GroupDetails,
|
||||
ModifiedGroupDetails
|
||||
> {
|
||||
constructor(arrayBuffer: Uint8Array) {
|
||||
super(arrayBuffer, Proto.GroupDetails);
|
||||
}
|
||||
|
||||
public override next(): ModifiedGroupDetails | undefined {
|
||||
const proto = this.decodeDelimited();
|
||||
if (!proto) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (!proto.members) {
|
||||
return proto;
|
||||
}
|
||||
|
||||
return {
|
||||
...proto,
|
||||
members: proto.members.map((member, i) => {
|
||||
if (!member.uuid) {
|
||||
return member;
|
||||
}
|
||||
|
||||
return {
|
||||
...member,
|
||||
uuid: normalizeUuid(member.uuid, `GroupBuffer.member[${i}].uuid`),
|
||||
};
|
||||
}),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export class ContactBuffer extends ParserBase<
|
||||
Proto.ContactDetails,
|
||||
typeof Proto.ContactDetails,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue