Fix Gift Badge expiration
This commit is contained in:
parent
4cd86f558e
commit
07ee7f46b7
1 changed files with 3 additions and 3 deletions
|
@ -27,6 +27,7 @@ import type {
|
|||
import { WarnOnlyError } from './Errors';
|
||||
import { GiftBadgeStates } from '../components/conversation/Message';
|
||||
import { APPLICATION_OCTET_STREAM, stringToMIMEType } from '../types/MIME';
|
||||
import { SECOND } from '../util/durations';
|
||||
|
||||
const FLAGS = Proto.DataMessage.Flags;
|
||||
export const ATTACHMENT_MAX = 32;
|
||||
|
@ -242,7 +243,6 @@ export function processDelete(
|
|||
}
|
||||
|
||||
export function processGiftBadge(
|
||||
timestamp: number,
|
||||
giftBadge: Proto.DataMessage.IGiftBadge | null | undefined
|
||||
): ProcessedGiftBadge | undefined {
|
||||
if (
|
||||
|
@ -258,7 +258,7 @@ export function processGiftBadge(
|
|||
);
|
||||
|
||||
return {
|
||||
expiration: timestamp + Number(receipt.getReceiptExpirationTime()),
|
||||
expiration: Number(receipt.getReceiptExpirationTime()) * SECOND,
|
||||
id: undefined,
|
||||
level: Number(receipt.getReceiptLevel()),
|
||||
receiptCredentialPresentation: Bytes.toBase64(
|
||||
|
@ -317,7 +317,7 @@ export async function processDataMessage(
|
|||
bodyRanges: message.bodyRanges ?? [],
|
||||
groupCallUpdate: dropNull(message.groupCallUpdate),
|
||||
storyContext: dropNull(message.storyContext),
|
||||
giftBadge: processGiftBadge(timestamp, message.giftBadge),
|
||||
giftBadge: processGiftBadge(message.giftBadge),
|
||||
};
|
||||
|
||||
const isEndSession = Boolean(result.flags & FLAGS.END_SESSION);
|
||||
|
|
Loading…
Add table
Reference in a new issue