Support for incoming gift badges

This commit is contained in:
Scott Nonnenberg 2022-05-11 13:59:58 -07:00 committed by GitHub
parent 6b4bea6330
commit 0ba6a0926e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
41 changed files with 1476 additions and 164 deletions

View file

@ -118,11 +118,12 @@ export type StickerType = {
};
export type QuoteType = {
id?: number;
authorUuid?: string;
text?: string;
attachments?: Array<AttachmentType>;
authorUuid?: string;
bodyRanges?: BodyRangesType;
id?: number;
isGiftBadge?: boolean;
text?: string;
};
export type ReactionType = {
@ -494,6 +495,12 @@ class Message {
proto.quote = new Quote();
const { quote } = proto;
if (this.quote.isGiftBadge) {
quote.type = Proto.DataMessage.Quote.Type.GIFT_BADGE;
} else {
quote.type = Proto.DataMessage.Quote.Type.NORMAL;
}
quote.id =
this.quote.id === undefined ? null : Long.fromNumber(this.quote.id);
quote.authorUuid = this.quote.authorUuid || null;