View-once media: backend send support

This commit is contained in:
yash-signal
2026-01-08 12:49:46 -06:00
committed by GitHub
parent c9281f7f95
commit c36c329645
7 changed files with 56 additions and 11 deletions

View File

@@ -212,6 +212,7 @@ export type SharedMessageOptionsType = Readonly<{
flags?: number;
groupCallUpdate?: GroupCallUpdateType;
groupV2?: GroupV2InfoType;
isViewOnce?: boolean;
pinMessage?: SendPinMessageType;
pollVote?: OutgoingPollVote;
pollCreate?: PollCreateType;
@@ -272,6 +273,8 @@ class Message {
groupV2?: GroupV2InfoType;
isViewOnce?: boolean;
preview?: ReadonlyArray<OutgoingLinkPreviewType>;
profileKey?: Uint8Array;
@@ -314,6 +317,7 @@ class Message {
this.expireTimerVersion = options.expireTimerVersion;
this.flags = options.flags;
this.groupV2 = options.groupV2;
this.isViewOnce = options.isViewOnce;
this.preview = options.preview;
this.profileKey = options.profileKey;
this.quote = options.quote;
@@ -584,6 +588,9 @@ class Message {
if (this.profileKey) {
proto.profileKey = this.profileKey;
}
if (this.isViewOnce) {
proto.isViewOnce = true;
}
if (this.deletedForEveryoneTimestamp) {
proto.delete = {
targetSentTimestamp: Long.fromNumber(this.deletedForEveryoneTimestamp),
@@ -1125,6 +1132,7 @@ export class MessageSender {
flags,
groupCallUpdate,
groupV2,
isViewOnce,
body,
preview,
profileKey,
@@ -1173,6 +1181,7 @@ export class MessageSender {
flags,
groupCallUpdate,
groupV2,
isViewOnce,
preview,
profileKey,
quote,