diff --git a/WAProto/WAProto.proto b/WAProto/WAProto.proto index 081bd6d..5b99f58 100644 --- a/WAProto/WAProto.proto +++ b/WAProto/WAProto.proto @@ -110,18 +110,6 @@ message CertChain { } -message Chain { - optional bytes senderRatchetKey = 1; - optional bytes senderRatchetKeyPrivate = 2; - optional ChainKey chainKey = 3; - repeated MessageKey messageKeys = 4; -} - -message ChainKey { - optional uint32 index = 1; - optional bytes key = 2; -} - message ClientPayload { optional uint64 username = 1; optional bool passive = 3; @@ -147,14 +135,8 @@ message ClientPayload { optional bytes fbDeviceId = 32; optional bool pull = 33; optional bytes paddingBytes = 34; - optional BizMarketSegment bizMarketSegment = 35; optional int32 yearClass = 36; optional int32 memClass = 37; - enum BizMarketSegment { - DEFAULT = 0; - DEVX = 1; - INBOX = 2; - } enum ConnectReason { PUSH = 0; USER_ACTIVATED = 1; @@ -267,6 +249,7 @@ message ClientPayload { WEAROS = 29; ARDEVICE = 30; VRDEVICE = 31; + BLUE_WEB = 32; } enum ReleaseChannel { RELEASE = 0; @@ -332,6 +315,9 @@ message ContextInfo { optional string parentGroupJid = 35; optional string trustBannerType = 37; optional uint32 trustBannerAction = 38; + optional bool isSampled = 39; + repeated GroupMention groupMentions = 40; + optional UTMInfo utm = 41; message AdReplyInfo { optional string advertiserName = 1; optional MediaType mediaType = 2; @@ -365,6 +351,11 @@ message ContextInfo { } } + message UTMInfo { + optional string utmSource = 1; + optional string utmCampaign = 2; + } + } message Conversation { @@ -403,8 +394,8 @@ message Conversation { optional string description = 33; optional bool support = 34; optional bool isParentGroup = 35; - optional bool isDefaultSubgroup = 36; optional string parentGroupId = 37; + optional bool isDefaultSubgroup = 36; optional string displayName = 38; optional string pnJid = 39; optional bool shareOwnPn = 40; @@ -460,6 +451,10 @@ message DeviceProps { ALOHA = 11; CATALINA = 12; TCL_TV = 13; + IOS_PHONE = 14; + IOS_CATALYST = 15; + ANDROID_PHONE = 16; + ANDROID_AMBIGUOUS = 17; } } @@ -505,6 +500,11 @@ message GlobalSettings { optional AvatarUserSettings avatarUserSettings = 11; } +message GroupMention { + optional string groupJid = 1; + optional string groupSubject = 2; +} + message GroupParticipant { required string userJid = 1; optional Rank rank = 2; @@ -557,6 +557,7 @@ message HistorySync { RECENT = 3; PUSH_NAME = 4; NON_BLOCKING_DATA = 5; + ON_DEMAND = 6; } } @@ -702,6 +703,13 @@ message Message { optional EncReactionMessage encReactionMessage = 56; optional FutureProofMessage editedMessage = 58; optional FutureProofMessage viewOnceMessageV2Extension = 59; + optional PollCreationMessage pollCreationMessageV2 = 60; + optional ScheduledCallCreationMessage scheduledCallCreationMessage = 61; + optional FutureProofMessage groupMentionedMessage = 62; + optional PinMessage pinMessage = 63; + optional PollCreationMessage pollCreationMessageV3 = 64; + optional ScheduledCallEditMessage scheduledCallEditMessage = 65; + optional VideoMessage ptvMessage = 66; message AppStateFatalExceptionNotification { repeated string collectionNames = 1; optional int64 timestamp = 2; @@ -751,6 +759,7 @@ message Message { optional bytes streamingSidecar = 18; optional bytes waveform = 19; optional fixed32 backgroundArgb = 20; + optional bool viewOnce = 21; } message ButtonsMessage { @@ -910,6 +919,11 @@ message Message { BRYNDAN_WRITE = 3; BEBASNEUE_REGULAR = 4; OSWALD_HEAVY = 5; + DAMION_REGULAR = 6; + MORNINGBREEZE_REGULAR = 7; + CALISTOGA_REGULAR = 8; + EXO2_EXTRABOLD = 9; + COURIERPRIME_BOLD = 10; } enum InviteLinkGroupType { DEFAULT = 0; @@ -1019,6 +1033,7 @@ message Message { RECENT = 3; PUSH_NAME = 4; NON_BLOCKING_DATA = 5; + ON_DEMAND = 6; } } @@ -1284,6 +1299,15 @@ message Message { optional Message.PeerDataOperationRequestType peerDataOperationRequestType = 1; repeated RequestStickerReupload requestStickerReupload = 2; repeated RequestUrlPreview requestUrlPreview = 3; + optional HistorySyncOnDemandRequest historySyncOnDemandRequest = 4; + message HistorySyncOnDemandRequest { + optional string chatJid = 1; + optional string oldestMsgId = 2; + optional bool oldestMsgFromMe = 3; + optional int32 onDemandMsgCount = 4; + optional int64 oldestMsgTimestampMs = 5; + } + message RequestStickerReupload { optional string fileSha256 = 1; } @@ -1320,7 +1344,19 @@ message Message { UPLOAD_STICKER = 0; SEND_RECENT_STICKER_BOOTSTRAP = 1; GENERATE_LINK_PREVIEW = 2; + HISTORY_SYNC_ON_DEMAND = 3; } + message PinMessage { + optional MessageKey key = 1; + optional PinMessageType pinMessageType = 2; + optional int64 senderTimestampMs = 3; + enum PinMessageType { + UNKNOWN_PIN_MESSAGE_TYPE = 0; + PIN_FOR_ALL = 1; + UNPIN_FOR_ALL = 2; + } + } + message PollCreationMessage { optional bytes encKey = 1; optional string name = 2; @@ -1434,6 +1470,26 @@ message Message { optional ContextInfo contextInfo = 1; } + message ScheduledCallCreationMessage { + optional int64 scheduledTimestampMs = 1; + optional CallType callType = 2; + optional string title = 3; + enum CallType { + UNKNOWN = 0; + VOICE = 1; + VIDEO = 2; + } + } + + message ScheduledCallEditMessage { + optional MessageKey key = 1; + optional EditType editType = 2; + enum EditType { + UNKNOWN = 0; + CANCEL = 1; + } + } + message SendPaymentMessage { optional Message noteMessage = 2; optional MessageKey requestMessageKey = 3; @@ -1592,6 +1648,10 @@ message MsgOpaqueData { optional int64 senderTimestampMs = 22; optional string pollUpdateParentKey = 23; optional PollEncValue encPollVote = 24; + optional bool isSentCagPollCreation = 28; + optional string encReactionTargetMessageKey = 25; + optional bytes encReactionEncPayload = 26; + optional bytes encReactionEncIv = 27; message PollOption { optional string name = 1; } @@ -1731,22 +1791,6 @@ message PaymentInfo { } } -message PendingKeyExchange { - optional uint32 sequence = 1; - optional bytes localBaseKey = 2; - optional bytes localBaseKeyPrivate = 3; - optional bytes localRatchetKey = 4; - optional bytes localRatchetKeyPrivate = 5; - optional bytes localIdentityKey = 7; - optional bytes localIdentityKeyPrivate = 8; -} - -message PendingPreKey { - optional uint32 preKeyId = 1; - optional int32 signedPreKeyId = 3; - optional bytes baseKey = 2; -} - message PhotoChange { optional bytes oldPhoto = 1; optional bytes newPhoto = 2; @@ -1773,6 +1817,8 @@ message PollUpdate { optional MessageKey pollUpdateMessageKey = 1; optional Message.PollVoteMessage vote = 2; optional int64 senderTimestampMs = 3; + optional int64 serverTimestampMs = 4; + optional bool unread = 5; } message PreKeyRecordStructure { @@ -1804,11 +1850,6 @@ message RecordStructure { repeated SessionStructure previousSessions = 2; } -message SenderChainKey { - optional uint32 iteration = 1; - optional bytes seed = 2; -} - message SenderKeyRecordStructure { repeated SenderKeyStateStructure senderKeyStates = 1; } @@ -1818,16 +1859,21 @@ message SenderKeyStateStructure { optional SenderChainKey senderChainKey = 2; optional SenderSigningKey senderSigningKey = 3; repeated SenderMessageKey senderMessageKeys = 4; -} - -message SenderMessageKey { - optional uint32 iteration = 1; - optional bytes seed = 2; -} - -message SenderSigningKey { - optional bytes public = 1; - optional bytes private = 2; + message SenderChainKey { + optional uint32 iteration = 1; + optional bytes seed = 2; + } + + message SenderMessageKey { + optional uint32 iteration = 1; + optional bytes seed = 2; + } + + message SenderSigningKey { + optional bytes public = 1; + optional bytes private = 2; + } + } message ServerErrorReceipt { @@ -1848,6 +1894,41 @@ message SessionStructure { optional uint32 localRegistrationId = 11; optional bool needsRefresh = 12; optional bytes aliceBaseKey = 13; + message Chain { + optional bytes senderRatchetKey = 1; + optional bytes senderRatchetKeyPrivate = 2; + optional ChainKey chainKey = 3; + repeated MessageKey messageKeys = 4; + message ChainKey { + optional uint32 index = 1; + optional bytes key = 2; + } + + message MessageKey { + optional uint32 index = 1; + optional bytes cipherKey = 2; + optional bytes macKey = 3; + optional bytes iv = 4; + } + + } + + message PendingKeyExchange { + optional uint32 sequence = 1; + optional bytes localBaseKey = 2; + optional bytes localBaseKeyPrivate = 3; + optional bytes localRatchetKey = 4; + optional bytes localRatchetKeyPrivate = 5; + optional bytes localIdentityKey = 7; + optional bytes localIdentityKeyPrivate = 8; + } + + message PendingPreKey { + optional uint32 preKeyId = 1; + optional int32 signedPreKeyId = 3; + optional bytes baseKey = 2; + } + } message SignedPreKeyRecordStructure { @@ -1916,6 +1997,7 @@ message SyncActionValue { optional RemoveRecentStickerAction removeRecentStickerAction = 34; optional ChatAssignmentAction chatAssignment = 35; optional ChatAssignmentOpenedStatusAction chatAssignmentOpenedStatus = 36; + optional PnForLidChatAction pnForLidChatAction = 37; message AgentAction { optional string name = 1; optional int32 deviceID = 2; @@ -1996,6 +2078,10 @@ message SyncActionValue { optional bool pinned = 1; } + message PnForLidChatAction { + optional string pnJid = 1; + } + message PrimaryFeature { repeated string flags = 1; } diff --git a/WAProto/index.d.ts b/WAProto/index.d.ts index 70d2bdd..5cc6b4a 100644 --- a/WAProto/index.d.ts +++ b/WAProto/index.d.ts @@ -1502,210 +1502,6 @@ export namespace proto { } } - /** Properties of a Chain. */ - interface IChain { - - /** Chain senderRatchetKey */ - senderRatchetKey?: (Uint8Array|null); - - /** Chain senderRatchetKeyPrivate */ - senderRatchetKeyPrivate?: (Uint8Array|null); - - /** Chain chainKey */ - chainKey?: (proto.IChainKey|null); - - /** Chain messageKeys */ - messageKeys?: (proto.IMessageKey[]|null); - } - - /** Represents a Chain. */ - class Chain implements IChain { - - /** - * Constructs a new Chain. - * @param [properties] Properties to set - */ - constructor(properties?: proto.IChain); - - /** Chain senderRatchetKey. */ - public senderRatchetKey: Uint8Array; - - /** Chain senderRatchetKeyPrivate. */ - public senderRatchetKeyPrivate: Uint8Array; - - /** Chain chainKey. */ - public chainKey?: (proto.IChainKey|null); - - /** Chain messageKeys. */ - public messageKeys: proto.IMessageKey[]; - - /** - * Creates a new Chain instance using the specified properties. - * @param [properties] Properties to set - * @returns Chain instance - */ - public static create(properties?: proto.IChain): proto.Chain; - - /** - * Encodes the specified Chain message. Does not implicitly {@link proto.Chain.verify|verify} messages. - * @param message Chain message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: proto.IChain, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Chain message, length delimited. Does not implicitly {@link proto.Chain.verify|verify} messages. - * @param message Chain message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: proto.IChain, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Chain message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Chain - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Chain; - - /** - * Decodes a Chain message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Chain - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Chain; - - /** - * Verifies a Chain message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Chain message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Chain - */ - public static fromObject(object: { [k: string]: any }): proto.Chain; - - /** - * Creates a plain object from a Chain message. Also converts values to other types if specified. - * @param message Chain - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: proto.Chain, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Chain to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ChainKey. */ - interface IChainKey { - - /** ChainKey index */ - index?: (number|null); - - /** ChainKey key */ - key?: (Uint8Array|null); - } - - /** Represents a ChainKey. */ - class ChainKey implements IChainKey { - - /** - * Constructs a new ChainKey. - * @param [properties] Properties to set - */ - constructor(properties?: proto.IChainKey); - - /** ChainKey index. */ - public index: number; - - /** ChainKey key. */ - public key: Uint8Array; - - /** - * Creates a new ChainKey instance using the specified properties. - * @param [properties] Properties to set - * @returns ChainKey instance - */ - public static create(properties?: proto.IChainKey): proto.ChainKey; - - /** - * Encodes the specified ChainKey message. Does not implicitly {@link proto.ChainKey.verify|verify} messages. - * @param message ChainKey message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: proto.IChainKey, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ChainKey message, length delimited. Does not implicitly {@link proto.ChainKey.verify|verify} messages. - * @param message ChainKey message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: proto.IChainKey, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ChainKey message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ChainKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ChainKey; - - /** - * Decodes a ChainKey message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ChainKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ChainKey; - - /** - * Verifies a ChainKey message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ChainKey message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ChainKey - */ - public static fromObject(object: { [k: string]: any }): proto.ChainKey; - - /** - * Creates a plain object from a ChainKey message. Also converts values to other types if specified. - * @param message ChainKey - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: proto.ChainKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ChainKey to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - /** Properties of a ClientPayload. */ interface IClientPayload { @@ -1781,9 +1577,6 @@ export namespace proto { /** ClientPayload paddingBytes */ paddingBytes?: (Uint8Array|null); - /** ClientPayload bizMarketSegment */ - bizMarketSegment?: (proto.ClientPayload.BizMarketSegment|null); - /** ClientPayload yearClass */ yearClass?: (number|null); @@ -1872,9 +1665,6 @@ export namespace proto { /** ClientPayload paddingBytes. */ public paddingBytes: Uint8Array; - /** ClientPayload bizMarketSegment. */ - public bizMarketSegment: proto.ClientPayload.BizMarketSegment; - /** ClientPayload yearClass. */ public yearClass: number; @@ -1954,13 +1744,6 @@ export namespace proto { namespace ClientPayload { - /** BizMarketSegment enum. */ - enum BizMarketSegment { - DEFAULT = 0, - DEVX = 1, - INBOX = 2 - } - /** ConnectReason enum. */ enum ConnectReason { PUSH = 0, @@ -2554,7 +2337,8 @@ export namespace proto { CAPI = 28, WEAROS = 29, ARDEVICE = 30, - VRDEVICE = 31 + VRDEVICE = 31, + BLUE_WEB = 32 } /** ReleaseChannel enum. */ @@ -2914,6 +2698,15 @@ export namespace proto { /** ContextInfo trustBannerAction */ trustBannerAction?: (number|null); + + /** ContextInfo isSampled */ + isSampled?: (boolean|null); + + /** ContextInfo groupMentions */ + groupMentions?: (proto.IGroupMention[]|null); + + /** ContextInfo utm */ + utm?: (proto.ContextInfo.IUTMInfo|null); } /** Represents a ContextInfo. */ @@ -3000,6 +2793,15 @@ export namespace proto { /** ContextInfo trustBannerAction. */ public trustBannerAction: number; + /** ContextInfo isSampled. */ + public isSampled: boolean; + + /** ContextInfo groupMentions. */ + public groupMentions: proto.IGroupMention[]; + + /** ContextInfo utm. */ + public utm?: (proto.ContextInfo.IUTMInfo|null); + /** * Creates a new ContextInfo instance using the specified properties. * @param [properties] Properties to set @@ -3362,6 +3164,102 @@ export namespace proto { VIDEO = 2 } } + + /** Properties of a UTMInfo. */ + interface IUTMInfo { + + /** UTMInfo utmSource */ + utmSource?: (string|null); + + /** UTMInfo utmCampaign */ + utmCampaign?: (string|null); + } + + /** Represents a UTMInfo. */ + class UTMInfo implements IUTMInfo { + + /** + * Constructs a new UTMInfo. + * @param [properties] Properties to set + */ + constructor(properties?: proto.ContextInfo.IUTMInfo); + + /** UTMInfo utmSource. */ + public utmSource: string; + + /** UTMInfo utmCampaign. */ + public utmCampaign: string; + + /** + * Creates a new UTMInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns UTMInfo instance + */ + public static create(properties?: proto.ContextInfo.IUTMInfo): proto.ContextInfo.UTMInfo; + + /** + * Encodes the specified UTMInfo message. Does not implicitly {@link proto.ContextInfo.UTMInfo.verify|verify} messages. + * @param message UTMInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.ContextInfo.IUTMInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UTMInfo message, length delimited. Does not implicitly {@link proto.ContextInfo.UTMInfo.verify|verify} messages. + * @param message UTMInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.ContextInfo.IUTMInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UTMInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UTMInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ContextInfo.UTMInfo; + + /** + * Decodes a UTMInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UTMInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ContextInfo.UTMInfo; + + /** + * Verifies a UTMInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UTMInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UTMInfo + */ + public static fromObject(object: { [k: string]: any }): proto.ContextInfo.UTMInfo; + + /** + * Creates a plain object from a UTMInfo message. Also converts values to other types if specified. + * @param message UTMInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.ContextInfo.UTMInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UTMInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } /** Properties of a Conversation. */ @@ -3472,12 +3370,12 @@ export namespace proto { /** Conversation isParentGroup */ isParentGroup?: (boolean|null); - /** Conversation isDefaultSubgroup */ - isDefaultSubgroup?: (boolean|null); - /** Conversation parentGroupId */ parentGroupId?: (string|null); + /** Conversation isDefaultSubgroup */ + isDefaultSubgroup?: (boolean|null); + /** Conversation displayName */ displayName?: (string|null); @@ -3608,12 +3506,12 @@ export namespace proto { /** Conversation isParentGroup. */ public isParentGroup: boolean; - /** Conversation isDefaultSubgroup. */ - public isDefaultSubgroup: boolean; - /** Conversation parentGroupId. */ public parentGroupId: string; + /** Conversation isDefaultSubgroup. */ + public isDefaultSubgroup: boolean; + /** Conversation displayName. */ public displayName: string; @@ -4176,7 +4074,11 @@ export namespace proto { OHANA = 10, ALOHA = 11, CATALINA = 12, - TCL_TV = 13 + TCL_TV = 13, + IOS_PHONE = 14, + IOS_CATALYST = 15, + ANDROID_PHONE = 16, + ANDROID_AMBIGUOUS = 17 } } @@ -4742,6 +4644,102 @@ export namespace proto { public toJSON(): { [k: string]: any }; } + /** Properties of a GroupMention. */ + interface IGroupMention { + + /** GroupMention groupJid */ + groupJid?: (string|null); + + /** GroupMention groupSubject */ + groupSubject?: (string|null); + } + + /** Represents a GroupMention. */ + class GroupMention implements IGroupMention { + + /** + * Constructs a new GroupMention. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IGroupMention); + + /** GroupMention groupJid. */ + public groupJid: string; + + /** GroupMention groupSubject. */ + public groupSubject: string; + + /** + * Creates a new GroupMention instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupMention instance + */ + public static create(properties?: proto.IGroupMention): proto.GroupMention; + + /** + * Encodes the specified GroupMention message. Does not implicitly {@link proto.GroupMention.verify|verify} messages. + * @param message GroupMention message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IGroupMention, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupMention message, length delimited. Does not implicitly {@link proto.GroupMention.verify|verify} messages. + * @param message GroupMention message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IGroupMention, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupMention message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupMention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.GroupMention; + + /** + * Decodes a GroupMention message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupMention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.GroupMention; + + /** + * Verifies a GroupMention message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroupMention message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupMention + */ + public static fromObject(object: { [k: string]: any }): proto.GroupMention; + + /** + * Creates a plain object from a GroupMention message. Also converts values to other types if specified. + * @param message GroupMention + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.GroupMention, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupMention to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a GroupParticipant. */ interface IGroupParticipant { @@ -5412,7 +5410,8 @@ export namespace proto { FULL = 2, RECENT = 3, PUSH_NAME = 4, - NON_BLOCKING_DATA = 5 + NON_BLOCKING_DATA = 5, + ON_DEMAND = 6 } } @@ -6889,6 +6888,27 @@ export namespace proto { /** Message viewOnceMessageV2Extension */ viewOnceMessageV2Extension?: (proto.Message.IFutureProofMessage|null); + + /** Message pollCreationMessageV2 */ + pollCreationMessageV2?: (proto.Message.IPollCreationMessage|null); + + /** Message scheduledCallCreationMessage */ + scheduledCallCreationMessage?: (proto.Message.IScheduledCallCreationMessage|null); + + /** Message groupMentionedMessage */ + groupMentionedMessage?: (proto.Message.IFutureProofMessage|null); + + /** Message pinMessage */ + pinMessage?: (proto.Message.IPinMessage|null); + + /** Message pollCreationMessageV3 */ + pollCreationMessageV3?: (proto.Message.IPollCreationMessage|null); + + /** Message scheduledCallEditMessage */ + scheduledCallEditMessage?: (proto.Message.IScheduledCallEditMessage|null); + + /** Message ptvMessage */ + ptvMessage?: (proto.Message.IVideoMessage|null); } /** Represents a Message. */ @@ -7047,6 +7067,27 @@ export namespace proto { /** Message viewOnceMessageV2Extension. */ public viewOnceMessageV2Extension?: (proto.Message.IFutureProofMessage|null); + /** Message pollCreationMessageV2. */ + public pollCreationMessageV2?: (proto.Message.IPollCreationMessage|null); + + /** Message scheduledCallCreationMessage. */ + public scheduledCallCreationMessage?: (proto.Message.IScheduledCallCreationMessage|null); + + /** Message groupMentionedMessage. */ + public groupMentionedMessage?: (proto.Message.IFutureProofMessage|null); + + /** Message pinMessage. */ + public pinMessage?: (proto.Message.IPinMessage|null); + + /** Message pollCreationMessageV3. */ + public pollCreationMessageV3?: (proto.Message.IPollCreationMessage|null); + + /** Message scheduledCallEditMessage. */ + public scheduledCallEditMessage?: (proto.Message.IScheduledCallEditMessage|null); + + /** Message ptvMessage. */ + public ptvMessage?: (proto.Message.IVideoMessage|null); + /** * Creates a new Message instance using the specified properties. * @param [properties] Properties to set @@ -7830,6 +7871,9 @@ export namespace proto { /** AudioMessage backgroundArgb */ backgroundArgb?: (number|null); + + /** AudioMessage viewOnce */ + viewOnce?: (boolean|null); } /** Represents an AudioMessage. */ @@ -7883,6 +7927,9 @@ export namespace proto { /** AudioMessage backgroundArgb. */ public backgroundArgb: number; + /** AudioMessage viewOnce. */ + public viewOnce: boolean; + /** * Creates a new AudioMessage instance using the specified properties. * @param [properties] Properties to set @@ -9772,7 +9819,12 @@ export namespace proto { NORICAN_REGULAR = 2, BRYNDAN_WRITE = 3, BEBASNEUE_REGULAR = 4, - OSWALD_HEAVY = 5 + OSWALD_HEAVY = 5, + DAMION_REGULAR = 6, + MORNINGBREEZE_REGULAR = 7, + CALISTOGA_REGULAR = 8, + EXO2_EXTRABOLD = 9, + COURIERPRIME_BOLD = 10 } /** InviteLinkGroupType enum. */ @@ -10857,7 +10909,8 @@ export namespace proto { FULL = 2, RECENT = 3, PUSH_NAME = 4, - NON_BLOCKING_DATA = 5 + NON_BLOCKING_DATA = 5, + ON_DEMAND = 6 } } @@ -14127,6 +14180,9 @@ export namespace proto { /** PeerDataOperationRequestMessage requestUrlPreview */ requestUrlPreview?: (proto.Message.PeerDataOperationRequestMessage.IRequestUrlPreview[]|null); + + /** PeerDataOperationRequestMessage historySyncOnDemandRequest */ + historySyncOnDemandRequest?: (proto.Message.PeerDataOperationRequestMessage.IHistorySyncOnDemandRequest|null); } /** Represents a PeerDataOperationRequestMessage. */ @@ -14147,6 +14203,9 @@ export namespace proto { /** PeerDataOperationRequestMessage requestUrlPreview. */ public requestUrlPreview: proto.Message.PeerDataOperationRequestMessage.IRequestUrlPreview[]; + /** PeerDataOperationRequestMessage historySyncOnDemandRequest. */ + public historySyncOnDemandRequest?: (proto.Message.PeerDataOperationRequestMessage.IHistorySyncOnDemandRequest|null); + /** * Creates a new PeerDataOperationRequestMessage instance using the specified properties. * @param [properties] Properties to set @@ -14220,6 +14279,120 @@ export namespace proto { namespace PeerDataOperationRequestMessage { + /** Properties of a HistorySyncOnDemandRequest. */ + interface IHistorySyncOnDemandRequest { + + /** HistorySyncOnDemandRequest chatJid */ + chatJid?: (string|null); + + /** HistorySyncOnDemandRequest oldestMsgId */ + oldestMsgId?: (string|null); + + /** HistorySyncOnDemandRequest oldestMsgFromMe */ + oldestMsgFromMe?: (boolean|null); + + /** HistorySyncOnDemandRequest onDemandMsgCount */ + onDemandMsgCount?: (number|null); + + /** HistorySyncOnDemandRequest oldestMsgTimestampMs */ + oldestMsgTimestampMs?: (number|Long|null); + } + + /** Represents a HistorySyncOnDemandRequest. */ + class HistorySyncOnDemandRequest implements IHistorySyncOnDemandRequest { + + /** + * Constructs a new HistorySyncOnDemandRequest. + * @param [properties] Properties to set + */ + constructor(properties?: proto.Message.PeerDataOperationRequestMessage.IHistorySyncOnDemandRequest); + + /** HistorySyncOnDemandRequest chatJid. */ + public chatJid: string; + + /** HistorySyncOnDemandRequest oldestMsgId. */ + public oldestMsgId: string; + + /** HistorySyncOnDemandRequest oldestMsgFromMe. */ + public oldestMsgFromMe: boolean; + + /** HistorySyncOnDemandRequest onDemandMsgCount. */ + public onDemandMsgCount: number; + + /** HistorySyncOnDemandRequest oldestMsgTimestampMs. */ + public oldestMsgTimestampMs: (number|Long); + + /** + * Creates a new HistorySyncOnDemandRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns HistorySyncOnDemandRequest instance + */ + public static create(properties?: proto.Message.PeerDataOperationRequestMessage.IHistorySyncOnDemandRequest): proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest; + + /** + * Encodes the specified HistorySyncOnDemandRequest message. Does not implicitly {@link proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest.verify|verify} messages. + * @param message HistorySyncOnDemandRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.Message.PeerDataOperationRequestMessage.IHistorySyncOnDemandRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HistorySyncOnDemandRequest message, length delimited. Does not implicitly {@link proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest.verify|verify} messages. + * @param message HistorySyncOnDemandRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.Message.PeerDataOperationRequestMessage.IHistorySyncOnDemandRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HistorySyncOnDemandRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HistorySyncOnDemandRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest; + + /** + * Decodes a HistorySyncOnDemandRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HistorySyncOnDemandRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest; + + /** + * Verifies a HistorySyncOnDemandRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HistorySyncOnDemandRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HistorySyncOnDemandRequest + */ + public static fromObject(object: { [k: string]: any }): proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest; + + /** + * Creates a plain object from a HistorySyncOnDemandRequest message. Also converts values to other types if specified. + * @param message HistorySyncOnDemandRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HistorySyncOnDemandRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a RequestStickerReupload. */ interface IRequestStickerReupload { @@ -14741,7 +14914,120 @@ export namespace proto { enum PeerDataOperationRequestType { UPLOAD_STICKER = 0, SEND_RECENT_STICKER_BOOTSTRAP = 1, - GENERATE_LINK_PREVIEW = 2 + GENERATE_LINK_PREVIEW = 2, + HISTORY_SYNC_ON_DEMAND = 3 + } + + /** Properties of a PinMessage. */ + interface IPinMessage { + + /** PinMessage key */ + key?: (proto.IMessageKey|null); + + /** PinMessage pinMessageType */ + pinMessageType?: (proto.Message.PinMessage.PinMessageType|null); + + /** PinMessage senderTimestampMs */ + senderTimestampMs?: (number|Long|null); + } + + /** Represents a PinMessage. */ + class PinMessage implements IPinMessage { + + /** + * Constructs a new PinMessage. + * @param [properties] Properties to set + */ + constructor(properties?: proto.Message.IPinMessage); + + /** PinMessage key. */ + public key?: (proto.IMessageKey|null); + + /** PinMessage pinMessageType. */ + public pinMessageType: proto.Message.PinMessage.PinMessageType; + + /** PinMessage senderTimestampMs. */ + public senderTimestampMs: (number|Long); + + /** + * Creates a new PinMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns PinMessage instance + */ + public static create(properties?: proto.Message.IPinMessage): proto.Message.PinMessage; + + /** + * Encodes the specified PinMessage message. Does not implicitly {@link proto.Message.PinMessage.verify|verify} messages. + * @param message PinMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.Message.IPinMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PinMessage message, length delimited. Does not implicitly {@link proto.Message.PinMessage.verify|verify} messages. + * @param message PinMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.Message.IPinMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PinMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PinMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Message.PinMessage; + + /** + * Decodes a PinMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PinMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Message.PinMessage; + + /** + * Verifies a PinMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PinMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PinMessage + */ + public static fromObject(object: { [k: string]: any }): proto.Message.PinMessage; + + /** + * Creates a plain object from a PinMessage message. Also converts values to other types if specified. + * @param message PinMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.Message.PinMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PinMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace PinMessage { + + /** PinMessageType enum. */ + enum PinMessageType { + UNKNOWN_PIN_MESSAGE_TYPE = 0, + PIN_FOR_ALL = 1, + UNPIN_FOR_ALL = 2 + } } /** Properties of a PollCreationMessage. */ @@ -16216,6 +16502,223 @@ export namespace proto { public toJSON(): { [k: string]: any }; } + /** Properties of a ScheduledCallCreationMessage. */ + interface IScheduledCallCreationMessage { + + /** ScheduledCallCreationMessage scheduledTimestampMs */ + scheduledTimestampMs?: (number|Long|null); + + /** ScheduledCallCreationMessage callType */ + callType?: (proto.Message.ScheduledCallCreationMessage.CallType|null); + + /** ScheduledCallCreationMessage title */ + title?: (string|null); + } + + /** Represents a ScheduledCallCreationMessage. */ + class ScheduledCallCreationMessage implements IScheduledCallCreationMessage { + + /** + * Constructs a new ScheduledCallCreationMessage. + * @param [properties] Properties to set + */ + constructor(properties?: proto.Message.IScheduledCallCreationMessage); + + /** ScheduledCallCreationMessage scheduledTimestampMs. */ + public scheduledTimestampMs: (number|Long); + + /** ScheduledCallCreationMessage callType. */ + public callType: proto.Message.ScheduledCallCreationMessage.CallType; + + /** ScheduledCallCreationMessage title. */ + public title: string; + + /** + * Creates a new ScheduledCallCreationMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduledCallCreationMessage instance + */ + public static create(properties?: proto.Message.IScheduledCallCreationMessage): proto.Message.ScheduledCallCreationMessage; + + /** + * Encodes the specified ScheduledCallCreationMessage message. Does not implicitly {@link proto.Message.ScheduledCallCreationMessage.verify|verify} messages. + * @param message ScheduledCallCreationMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.Message.IScheduledCallCreationMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScheduledCallCreationMessage message, length delimited. Does not implicitly {@link proto.Message.ScheduledCallCreationMessage.verify|verify} messages. + * @param message ScheduledCallCreationMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.Message.IScheduledCallCreationMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduledCallCreationMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScheduledCallCreationMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Message.ScheduledCallCreationMessage; + + /** + * Decodes a ScheduledCallCreationMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScheduledCallCreationMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Message.ScheduledCallCreationMessage; + + /** + * Verifies a ScheduledCallCreationMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScheduledCallCreationMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScheduledCallCreationMessage + */ + public static fromObject(object: { [k: string]: any }): proto.Message.ScheduledCallCreationMessage; + + /** + * Creates a plain object from a ScheduledCallCreationMessage message. Also converts values to other types if specified. + * @param message ScheduledCallCreationMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.Message.ScheduledCallCreationMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScheduledCallCreationMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ScheduledCallCreationMessage { + + /** CallType enum. */ + enum CallType { + UNKNOWN = 0, + VOICE = 1, + VIDEO = 2 + } + } + + /** Properties of a ScheduledCallEditMessage. */ + interface IScheduledCallEditMessage { + + /** ScheduledCallEditMessage key */ + key?: (proto.IMessageKey|null); + + /** ScheduledCallEditMessage editType */ + editType?: (proto.Message.ScheduledCallEditMessage.EditType|null); + } + + /** Represents a ScheduledCallEditMessage. */ + class ScheduledCallEditMessage implements IScheduledCallEditMessage { + + /** + * Constructs a new ScheduledCallEditMessage. + * @param [properties] Properties to set + */ + constructor(properties?: proto.Message.IScheduledCallEditMessage); + + /** ScheduledCallEditMessage key. */ + public key?: (proto.IMessageKey|null); + + /** ScheduledCallEditMessage editType. */ + public editType: proto.Message.ScheduledCallEditMessage.EditType; + + /** + * Creates a new ScheduledCallEditMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduledCallEditMessage instance + */ + public static create(properties?: proto.Message.IScheduledCallEditMessage): proto.Message.ScheduledCallEditMessage; + + /** + * Encodes the specified ScheduledCallEditMessage message. Does not implicitly {@link proto.Message.ScheduledCallEditMessage.verify|verify} messages. + * @param message ScheduledCallEditMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.Message.IScheduledCallEditMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScheduledCallEditMessage message, length delimited. Does not implicitly {@link proto.Message.ScheduledCallEditMessage.verify|verify} messages. + * @param message ScheduledCallEditMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.Message.IScheduledCallEditMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduledCallEditMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScheduledCallEditMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Message.ScheduledCallEditMessage; + + /** + * Decodes a ScheduledCallEditMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScheduledCallEditMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Message.ScheduledCallEditMessage; + + /** + * Verifies a ScheduledCallEditMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScheduledCallEditMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScheduledCallEditMessage + */ + public static fromObject(object: { [k: string]: any }): proto.Message.ScheduledCallEditMessage; + + /** + * Creates a plain object from a ScheduledCallEditMessage message. Also converts values to other types if specified. + * @param message ScheduledCallEditMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.Message.ScheduledCallEditMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScheduledCallEditMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ScheduledCallEditMessage { + + /** EditType enum. */ + enum EditType { + UNKNOWN = 0, + CANCEL = 1 + } + } + /** Properties of a SendPaymentMessage. */ interface ISendPaymentMessage { @@ -17831,6 +18334,18 @@ export namespace proto { /** MsgOpaqueData encPollVote */ encPollVote?: (proto.IPollEncValue|null); + + /** MsgOpaqueData isSentCagPollCreation */ + isSentCagPollCreation?: (boolean|null); + + /** MsgOpaqueData encReactionTargetMessageKey */ + encReactionTargetMessageKey?: (string|null); + + /** MsgOpaqueData encReactionEncPayload */ + encReactionEncPayload?: (Uint8Array|null); + + /** MsgOpaqueData encReactionEncIv */ + encReactionEncIv?: (Uint8Array|null); } /** Represents a MsgOpaqueData. */ @@ -17908,6 +18423,18 @@ export namespace proto { /** MsgOpaqueData encPollVote. */ public encPollVote?: (proto.IPollEncValue|null); + /** MsgOpaqueData isSentCagPollCreation. */ + public isSentCagPollCreation: boolean; + + /** MsgOpaqueData encReactionTargetMessageKey. */ + public encReactionTargetMessageKey: string; + + /** MsgOpaqueData encReactionEncPayload. */ + public encReactionEncPayload: Uint8Array; + + /** MsgOpaqueData encReactionEncIv. */ + public encReactionEncIv: Uint8Array; + /** * Creates a new MsgOpaqueData instance using the specified properties. * @param [properties] Properties to set @@ -19186,234 +19713,6 @@ export namespace proto { } } - /** Properties of a PendingKeyExchange. */ - interface IPendingKeyExchange { - - /** PendingKeyExchange sequence */ - sequence?: (number|null); - - /** PendingKeyExchange localBaseKey */ - localBaseKey?: (Uint8Array|null); - - /** PendingKeyExchange localBaseKeyPrivate */ - localBaseKeyPrivate?: (Uint8Array|null); - - /** PendingKeyExchange localRatchetKey */ - localRatchetKey?: (Uint8Array|null); - - /** PendingKeyExchange localRatchetKeyPrivate */ - localRatchetKeyPrivate?: (Uint8Array|null); - - /** PendingKeyExchange localIdentityKey */ - localIdentityKey?: (Uint8Array|null); - - /** PendingKeyExchange localIdentityKeyPrivate */ - localIdentityKeyPrivate?: (Uint8Array|null); - } - - /** Represents a PendingKeyExchange. */ - class PendingKeyExchange implements IPendingKeyExchange { - - /** - * Constructs a new PendingKeyExchange. - * @param [properties] Properties to set - */ - constructor(properties?: proto.IPendingKeyExchange); - - /** PendingKeyExchange sequence. */ - public sequence: number; - - /** PendingKeyExchange localBaseKey. */ - public localBaseKey: Uint8Array; - - /** PendingKeyExchange localBaseKeyPrivate. */ - public localBaseKeyPrivate: Uint8Array; - - /** PendingKeyExchange localRatchetKey. */ - public localRatchetKey: Uint8Array; - - /** PendingKeyExchange localRatchetKeyPrivate. */ - public localRatchetKeyPrivate: Uint8Array; - - /** PendingKeyExchange localIdentityKey. */ - public localIdentityKey: Uint8Array; - - /** PendingKeyExchange localIdentityKeyPrivate. */ - public localIdentityKeyPrivate: Uint8Array; - - /** - * Creates a new PendingKeyExchange instance using the specified properties. - * @param [properties] Properties to set - * @returns PendingKeyExchange instance - */ - public static create(properties?: proto.IPendingKeyExchange): proto.PendingKeyExchange; - - /** - * Encodes the specified PendingKeyExchange message. Does not implicitly {@link proto.PendingKeyExchange.verify|verify} messages. - * @param message PendingKeyExchange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: proto.IPendingKeyExchange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PendingKeyExchange message, length delimited. Does not implicitly {@link proto.PendingKeyExchange.verify|verify} messages. - * @param message PendingKeyExchange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: proto.IPendingKeyExchange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PendingKeyExchange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PendingKeyExchange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.PendingKeyExchange; - - /** - * Decodes a PendingKeyExchange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PendingKeyExchange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.PendingKeyExchange; - - /** - * Verifies a PendingKeyExchange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PendingKeyExchange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PendingKeyExchange - */ - public static fromObject(object: { [k: string]: any }): proto.PendingKeyExchange; - - /** - * Creates a plain object from a PendingKeyExchange message. Also converts values to other types if specified. - * @param message PendingKeyExchange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: proto.PendingKeyExchange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PendingKeyExchange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a PendingPreKey. */ - interface IPendingPreKey { - - /** PendingPreKey preKeyId */ - preKeyId?: (number|null); - - /** PendingPreKey signedPreKeyId */ - signedPreKeyId?: (number|null); - - /** PendingPreKey baseKey */ - baseKey?: (Uint8Array|null); - } - - /** Represents a PendingPreKey. */ - class PendingPreKey implements IPendingPreKey { - - /** - * Constructs a new PendingPreKey. - * @param [properties] Properties to set - */ - constructor(properties?: proto.IPendingPreKey); - - /** PendingPreKey preKeyId. */ - public preKeyId: number; - - /** PendingPreKey signedPreKeyId. */ - public signedPreKeyId: number; - - /** PendingPreKey baseKey. */ - public baseKey: Uint8Array; - - /** - * Creates a new PendingPreKey instance using the specified properties. - * @param [properties] Properties to set - * @returns PendingPreKey instance - */ - public static create(properties?: proto.IPendingPreKey): proto.PendingPreKey; - - /** - * Encodes the specified PendingPreKey message. Does not implicitly {@link proto.PendingPreKey.verify|verify} messages. - * @param message PendingPreKey message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: proto.IPendingPreKey, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PendingPreKey message, length delimited. Does not implicitly {@link proto.PendingPreKey.verify|verify} messages. - * @param message PendingPreKey message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: proto.IPendingPreKey, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PendingPreKey message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PendingPreKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.PendingPreKey; - - /** - * Decodes a PendingPreKey message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PendingPreKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.PendingPreKey; - - /** - * Verifies a PendingPreKey message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PendingPreKey message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PendingPreKey - */ - public static fromObject(object: { [k: string]: any }): proto.PendingPreKey; - - /** - * Creates a plain object from a PendingPreKey message. Also converts values to other types if specified. - * @param message PendingPreKey - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: proto.PendingPreKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PendingPreKey to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - /** Properties of a PhotoChange. */ interface IPhotoChange { @@ -19821,6 +20120,12 @@ export namespace proto { /** PollUpdate senderTimestampMs */ senderTimestampMs?: (number|Long|null); + + /** PollUpdate serverTimestampMs */ + serverTimestampMs?: (number|Long|null); + + /** PollUpdate unread */ + unread?: (boolean|null); } /** Represents a PollUpdate. */ @@ -19841,6 +20146,12 @@ export namespace proto { /** PollUpdate senderTimestampMs. */ public senderTimestampMs: (number|Long); + /** PollUpdate serverTimestampMs. */ + public serverTimestampMs: (number|Long); + + /** PollUpdate unread. */ + public unread: boolean; + /** * Creates a new PollUpdate instance using the specified properties. * @param [properties] Properties to set @@ -20416,102 +20727,6 @@ export namespace proto { public toJSON(): { [k: string]: any }; } - /** Properties of a SenderChainKey. */ - interface ISenderChainKey { - - /** SenderChainKey iteration */ - iteration?: (number|null); - - /** SenderChainKey seed */ - seed?: (Uint8Array|null); - } - - /** Represents a SenderChainKey. */ - class SenderChainKey implements ISenderChainKey { - - /** - * Constructs a new SenderChainKey. - * @param [properties] Properties to set - */ - constructor(properties?: proto.ISenderChainKey); - - /** SenderChainKey iteration. */ - public iteration: number; - - /** SenderChainKey seed. */ - public seed: Uint8Array; - - /** - * Creates a new SenderChainKey instance using the specified properties. - * @param [properties] Properties to set - * @returns SenderChainKey instance - */ - public static create(properties?: proto.ISenderChainKey): proto.SenderChainKey; - - /** - * Encodes the specified SenderChainKey message. Does not implicitly {@link proto.SenderChainKey.verify|verify} messages. - * @param message SenderChainKey message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: proto.ISenderChainKey, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SenderChainKey message, length delimited. Does not implicitly {@link proto.SenderChainKey.verify|verify} messages. - * @param message SenderChainKey message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: proto.ISenderChainKey, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SenderChainKey message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SenderChainKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SenderChainKey; - - /** - * Decodes a SenderChainKey message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SenderChainKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SenderChainKey; - - /** - * Verifies a SenderChainKey message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SenderChainKey message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SenderChainKey - */ - public static fromObject(object: { [k: string]: any }): proto.SenderChainKey; - - /** - * Creates a plain object from a SenderChainKey message. Also converts values to other types if specified. - * @param message SenderChainKey - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: proto.SenderChainKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SenderChainKey to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - /** Properties of a SenderKeyRecordStructure. */ interface ISenderKeyRecordStructure { @@ -20609,13 +20824,13 @@ export namespace proto { senderKeyId?: (number|null); /** SenderKeyStateStructure senderChainKey */ - senderChainKey?: (proto.ISenderChainKey|null); + senderChainKey?: (proto.SenderKeyStateStructure.ISenderChainKey|null); /** SenderKeyStateStructure senderSigningKey */ - senderSigningKey?: (proto.ISenderSigningKey|null); + senderSigningKey?: (proto.SenderKeyStateStructure.ISenderSigningKey|null); /** SenderKeyStateStructure senderMessageKeys */ - senderMessageKeys?: (proto.ISenderMessageKey[]|null); + senderMessageKeys?: (proto.SenderKeyStateStructure.ISenderMessageKey[]|null); } /** Represents a SenderKeyStateStructure. */ @@ -20631,13 +20846,13 @@ export namespace proto { public senderKeyId: number; /** SenderKeyStateStructure senderChainKey. */ - public senderChainKey?: (proto.ISenderChainKey|null); + public senderChainKey?: (proto.SenderKeyStateStructure.ISenderChainKey|null); /** SenderKeyStateStructure senderSigningKey. */ - public senderSigningKey?: (proto.ISenderSigningKey|null); + public senderSigningKey?: (proto.SenderKeyStateStructure.ISenderSigningKey|null); /** SenderKeyStateStructure senderMessageKeys. */ - public senderMessageKeys: proto.ISenderMessageKey[]; + public senderMessageKeys: proto.SenderKeyStateStructure.ISenderMessageKey[]; /** * Creates a new SenderKeyStateStructure instance using the specified properties. @@ -20710,196 +20925,295 @@ export namespace proto { public toJSON(): { [k: string]: any }; } - /** Properties of a SenderMessageKey. */ - interface ISenderMessageKey { + namespace SenderKeyStateStructure { - /** SenderMessageKey iteration */ - iteration?: (number|null); + /** Properties of a SenderChainKey. */ + interface ISenderChainKey { - /** SenderMessageKey seed */ - seed?: (Uint8Array|null); - } + /** SenderChainKey iteration */ + iteration?: (number|null); - /** Represents a SenderMessageKey. */ - class SenderMessageKey implements ISenderMessageKey { + /** SenderChainKey seed */ + seed?: (Uint8Array|null); + } - /** - * Constructs a new SenderMessageKey. - * @param [properties] Properties to set - */ - constructor(properties?: proto.ISenderMessageKey); + /** Represents a SenderChainKey. */ + class SenderChainKey implements ISenderChainKey { - /** SenderMessageKey iteration. */ - public iteration: number; + /** + * Constructs a new SenderChainKey. + * @param [properties] Properties to set + */ + constructor(properties?: proto.SenderKeyStateStructure.ISenderChainKey); - /** SenderMessageKey seed. */ - public seed: Uint8Array; + /** SenderChainKey iteration. */ + public iteration: number; - /** - * Creates a new SenderMessageKey instance using the specified properties. - * @param [properties] Properties to set - * @returns SenderMessageKey instance - */ - public static create(properties?: proto.ISenderMessageKey): proto.SenderMessageKey; + /** SenderChainKey seed. */ + public seed: Uint8Array; - /** - * Encodes the specified SenderMessageKey message. Does not implicitly {@link proto.SenderMessageKey.verify|verify} messages. - * @param message SenderMessageKey message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: proto.ISenderMessageKey, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new SenderChainKey instance using the specified properties. + * @param [properties] Properties to set + * @returns SenderChainKey instance + */ + public static create(properties?: proto.SenderKeyStateStructure.ISenderChainKey): proto.SenderKeyStateStructure.SenderChainKey; - /** - * Encodes the specified SenderMessageKey message, length delimited. Does not implicitly {@link proto.SenderMessageKey.verify|verify} messages. - * @param message SenderMessageKey message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: proto.ISenderMessageKey, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified SenderChainKey message. Does not implicitly {@link proto.SenderKeyStateStructure.SenderChainKey.verify|verify} messages. + * @param message SenderChainKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.SenderKeyStateStructure.ISenderChainKey, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a SenderMessageKey message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SenderMessageKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SenderMessageKey; + /** + * Encodes the specified SenderChainKey message, length delimited. Does not implicitly {@link proto.SenderKeyStateStructure.SenderChainKey.verify|verify} messages. + * @param message SenderChainKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.SenderKeyStateStructure.ISenderChainKey, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a SenderMessageKey message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SenderMessageKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SenderMessageKey; + /** + * Decodes a SenderChainKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SenderChainKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SenderKeyStateStructure.SenderChainKey; - /** - * Verifies a SenderMessageKey message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes a SenderChainKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SenderChainKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SenderKeyStateStructure.SenderChainKey; - /** - * Creates a SenderMessageKey message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SenderMessageKey - */ - public static fromObject(object: { [k: string]: any }): proto.SenderMessageKey; + /** + * Verifies a SenderChainKey message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a plain object from a SenderMessageKey message. Also converts values to other types if specified. - * @param message SenderMessageKey - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: proto.SenderMessageKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a SenderChainKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SenderChainKey + */ + public static fromObject(object: { [k: string]: any }): proto.SenderKeyStateStructure.SenderChainKey; - /** - * Converts this SenderMessageKey to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a plain object from a SenderChainKey message. Also converts values to other types if specified. + * @param message SenderChainKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.SenderKeyStateStructure.SenderChainKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Properties of a SenderSigningKey. */ - interface ISenderSigningKey { + /** + * Converts this SenderChainKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** SenderSigningKey public */ - "public"?: (Uint8Array|null); + /** Properties of a SenderMessageKey. */ + interface ISenderMessageKey { - /** SenderSigningKey private */ - "private"?: (Uint8Array|null); - } + /** SenderMessageKey iteration */ + iteration?: (number|null); - /** Represents a SenderSigningKey. */ - class SenderSigningKey implements ISenderSigningKey { + /** SenderMessageKey seed */ + seed?: (Uint8Array|null); + } - /** - * Constructs a new SenderSigningKey. - * @param [properties] Properties to set - */ - constructor(properties?: proto.ISenderSigningKey); + /** Represents a SenderMessageKey. */ + class SenderMessageKey implements ISenderMessageKey { - /** SenderSigningKey public. */ - public public: Uint8Array; + /** + * Constructs a new SenderMessageKey. + * @param [properties] Properties to set + */ + constructor(properties?: proto.SenderKeyStateStructure.ISenderMessageKey); - /** SenderSigningKey private. */ - public private: Uint8Array; + /** SenderMessageKey iteration. */ + public iteration: number; - /** - * Creates a new SenderSigningKey instance using the specified properties. - * @param [properties] Properties to set - * @returns SenderSigningKey instance - */ - public static create(properties?: proto.ISenderSigningKey): proto.SenderSigningKey; + /** SenderMessageKey seed. */ + public seed: Uint8Array; - /** - * Encodes the specified SenderSigningKey message. Does not implicitly {@link proto.SenderSigningKey.verify|verify} messages. - * @param message SenderSigningKey message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: proto.ISenderSigningKey, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new SenderMessageKey instance using the specified properties. + * @param [properties] Properties to set + * @returns SenderMessageKey instance + */ + public static create(properties?: proto.SenderKeyStateStructure.ISenderMessageKey): proto.SenderKeyStateStructure.SenderMessageKey; - /** - * Encodes the specified SenderSigningKey message, length delimited. Does not implicitly {@link proto.SenderSigningKey.verify|verify} messages. - * @param message SenderSigningKey message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: proto.ISenderSigningKey, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified SenderMessageKey message. Does not implicitly {@link proto.SenderKeyStateStructure.SenderMessageKey.verify|verify} messages. + * @param message SenderMessageKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.SenderKeyStateStructure.ISenderMessageKey, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a SenderSigningKey message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SenderSigningKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SenderSigningKey; + /** + * Encodes the specified SenderMessageKey message, length delimited. Does not implicitly {@link proto.SenderKeyStateStructure.SenderMessageKey.verify|verify} messages. + * @param message SenderMessageKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.SenderKeyStateStructure.ISenderMessageKey, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a SenderSigningKey message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SenderSigningKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SenderSigningKey; + /** + * Decodes a SenderMessageKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SenderMessageKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SenderKeyStateStructure.SenderMessageKey; - /** - * Verifies a SenderSigningKey message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes a SenderMessageKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SenderMessageKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SenderKeyStateStructure.SenderMessageKey; - /** - * Creates a SenderSigningKey message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SenderSigningKey - */ - public static fromObject(object: { [k: string]: any }): proto.SenderSigningKey; + /** + * Verifies a SenderMessageKey message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a plain object from a SenderSigningKey message. Also converts values to other types if specified. - * @param message SenderSigningKey - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: proto.SenderSigningKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a SenderMessageKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SenderMessageKey + */ + public static fromObject(object: { [k: string]: any }): proto.SenderKeyStateStructure.SenderMessageKey; - /** - * Converts this SenderSigningKey to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Creates a plain object from a SenderMessageKey message. Also converts values to other types if specified. + * @param message SenderMessageKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.SenderKeyStateStructure.SenderMessageKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SenderMessageKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SenderSigningKey. */ + interface ISenderSigningKey { + + /** SenderSigningKey public */ + "public"?: (Uint8Array|null); + + /** SenderSigningKey private */ + "private"?: (Uint8Array|null); + } + + /** Represents a SenderSigningKey. */ + class SenderSigningKey implements ISenderSigningKey { + + /** + * Constructs a new SenderSigningKey. + * @param [properties] Properties to set + */ + constructor(properties?: proto.SenderKeyStateStructure.ISenderSigningKey); + + /** SenderSigningKey public. */ + public public: Uint8Array; + + /** SenderSigningKey private. */ + public private: Uint8Array; + + /** + * Creates a new SenderSigningKey instance using the specified properties. + * @param [properties] Properties to set + * @returns SenderSigningKey instance + */ + public static create(properties?: proto.SenderKeyStateStructure.ISenderSigningKey): proto.SenderKeyStateStructure.SenderSigningKey; + + /** + * Encodes the specified SenderSigningKey message. Does not implicitly {@link proto.SenderKeyStateStructure.SenderSigningKey.verify|verify} messages. + * @param message SenderSigningKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.SenderKeyStateStructure.ISenderSigningKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SenderSigningKey message, length delimited. Does not implicitly {@link proto.SenderKeyStateStructure.SenderSigningKey.verify|verify} messages. + * @param message SenderSigningKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.SenderKeyStateStructure.ISenderSigningKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SenderSigningKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SenderSigningKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SenderKeyStateStructure.SenderSigningKey; + + /** + * Decodes a SenderSigningKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SenderSigningKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SenderKeyStateStructure.SenderSigningKey; + + /** + * Verifies a SenderSigningKey message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SenderSigningKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SenderSigningKey + */ + public static fromObject(object: { [k: string]: any }): proto.SenderKeyStateStructure.SenderSigningKey; + + /** + * Creates a plain object from a SenderSigningKey message. Also converts values to other types if specified. + * @param message SenderSigningKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.SenderKeyStateStructure.SenderSigningKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SenderSigningKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } /** Properties of a ServerErrorReceipt. */ @@ -21011,16 +21325,16 @@ export namespace proto { previousCounter?: (number|null); /** SessionStructure senderChain */ - senderChain?: (proto.IChain|null); + senderChain?: (proto.SessionStructure.IChain|null); /** SessionStructure receiverChains */ - receiverChains?: (proto.IChain[]|null); + receiverChains?: (proto.SessionStructure.IChain[]|null); /** SessionStructure pendingKeyExchange */ - pendingKeyExchange?: (proto.IPendingKeyExchange|null); + pendingKeyExchange?: (proto.SessionStructure.IPendingKeyExchange|null); /** SessionStructure pendingPreKey */ - pendingPreKey?: (proto.IPendingPreKey|null); + pendingPreKey?: (proto.SessionStructure.IPendingPreKey|null); /** SessionStructure remoteRegistrationId */ remoteRegistrationId?: (number|null); @@ -21060,16 +21374,16 @@ export namespace proto { public previousCounter: number; /** SessionStructure senderChain. */ - public senderChain?: (proto.IChain|null); + public senderChain?: (proto.SessionStructure.IChain|null); /** SessionStructure receiverChains. */ - public receiverChains: proto.IChain[]; + public receiverChains: proto.SessionStructure.IChain[]; /** SessionStructure pendingKeyExchange. */ - public pendingKeyExchange?: (proto.IPendingKeyExchange|null); + public pendingKeyExchange?: (proto.SessionStructure.IPendingKeyExchange|null); /** SessionStructure pendingPreKey. */ - public pendingPreKey?: (proto.IPendingPreKey|null); + public pendingPreKey?: (proto.SessionStructure.IPendingPreKey|null); /** SessionStructure remoteRegistrationId. */ public remoteRegistrationId: number; @@ -21154,6 +21468,552 @@ export namespace proto { public toJSON(): { [k: string]: any }; } + namespace SessionStructure { + + /** Properties of a Chain. */ + interface IChain { + + /** Chain senderRatchetKey */ + senderRatchetKey?: (Uint8Array|null); + + /** Chain senderRatchetKeyPrivate */ + senderRatchetKeyPrivate?: (Uint8Array|null); + + /** Chain chainKey */ + chainKey?: (proto.SessionStructure.Chain.IChainKey|null); + + /** Chain messageKeys */ + messageKeys?: (proto.SessionStructure.Chain.IMessageKey[]|null); + } + + /** Represents a Chain. */ + class Chain implements IChain { + + /** + * Constructs a new Chain. + * @param [properties] Properties to set + */ + constructor(properties?: proto.SessionStructure.IChain); + + /** Chain senderRatchetKey. */ + public senderRatchetKey: Uint8Array; + + /** Chain senderRatchetKeyPrivate. */ + public senderRatchetKeyPrivate: Uint8Array; + + /** Chain chainKey. */ + public chainKey?: (proto.SessionStructure.Chain.IChainKey|null); + + /** Chain messageKeys. */ + public messageKeys: proto.SessionStructure.Chain.IMessageKey[]; + + /** + * Creates a new Chain instance using the specified properties. + * @param [properties] Properties to set + * @returns Chain instance + */ + public static create(properties?: proto.SessionStructure.IChain): proto.SessionStructure.Chain; + + /** + * Encodes the specified Chain message. Does not implicitly {@link proto.SessionStructure.Chain.verify|verify} messages. + * @param message Chain message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.SessionStructure.IChain, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Chain message, length delimited. Does not implicitly {@link proto.SessionStructure.Chain.verify|verify} messages. + * @param message Chain message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.SessionStructure.IChain, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Chain message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Chain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SessionStructure.Chain; + + /** + * Decodes a Chain message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Chain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SessionStructure.Chain; + + /** + * Verifies a Chain message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Chain message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Chain + */ + public static fromObject(object: { [k: string]: any }): proto.SessionStructure.Chain; + + /** + * Creates a plain object from a Chain message. Also converts values to other types if specified. + * @param message Chain + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.SessionStructure.Chain, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Chain to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Chain { + + /** Properties of a ChainKey. */ + interface IChainKey { + + /** ChainKey index */ + index?: (number|null); + + /** ChainKey key */ + key?: (Uint8Array|null); + } + + /** Represents a ChainKey. */ + class ChainKey implements IChainKey { + + /** + * Constructs a new ChainKey. + * @param [properties] Properties to set + */ + constructor(properties?: proto.SessionStructure.Chain.IChainKey); + + /** ChainKey index. */ + public index: number; + + /** ChainKey key. */ + public key: Uint8Array; + + /** + * Creates a new ChainKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ChainKey instance + */ + public static create(properties?: proto.SessionStructure.Chain.IChainKey): proto.SessionStructure.Chain.ChainKey; + + /** + * Encodes the specified ChainKey message. Does not implicitly {@link proto.SessionStructure.Chain.ChainKey.verify|verify} messages. + * @param message ChainKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.SessionStructure.Chain.IChainKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChainKey message, length delimited. Does not implicitly {@link proto.SessionStructure.Chain.ChainKey.verify|verify} messages. + * @param message ChainKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.SessionStructure.Chain.IChainKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChainKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChainKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SessionStructure.Chain.ChainKey; + + /** + * Decodes a ChainKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChainKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SessionStructure.Chain.ChainKey; + + /** + * Verifies a ChainKey message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChainKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChainKey + */ + public static fromObject(object: { [k: string]: any }): proto.SessionStructure.Chain.ChainKey; + + /** + * Creates a plain object from a ChainKey message. Also converts values to other types if specified. + * @param message ChainKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.SessionStructure.Chain.ChainKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChainKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MessageKey. */ + interface IMessageKey { + + /** MessageKey index */ + index?: (number|null); + + /** MessageKey cipherKey */ + cipherKey?: (Uint8Array|null); + + /** MessageKey macKey */ + macKey?: (Uint8Array|null); + + /** MessageKey iv */ + iv?: (Uint8Array|null); + } + + /** Represents a MessageKey. */ + class MessageKey implements IMessageKey { + + /** + * Constructs a new MessageKey. + * @param [properties] Properties to set + */ + constructor(properties?: proto.SessionStructure.Chain.IMessageKey); + + /** MessageKey index. */ + public index: number; + + /** MessageKey cipherKey. */ + public cipherKey: Uint8Array; + + /** MessageKey macKey. */ + public macKey: Uint8Array; + + /** MessageKey iv. */ + public iv: Uint8Array; + + /** + * Creates a new MessageKey instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageKey instance + */ + public static create(properties?: proto.SessionStructure.Chain.IMessageKey): proto.SessionStructure.Chain.MessageKey; + + /** + * Encodes the specified MessageKey message. Does not implicitly {@link proto.SessionStructure.Chain.MessageKey.verify|verify} messages. + * @param message MessageKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.SessionStructure.Chain.IMessageKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageKey message, length delimited. Does not implicitly {@link proto.SessionStructure.Chain.MessageKey.verify|verify} messages. + * @param message MessageKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.SessionStructure.Chain.IMessageKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SessionStructure.Chain.MessageKey; + + /** + * Decodes a MessageKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SessionStructure.Chain.MessageKey; + + /** + * Verifies a MessageKey message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageKey + */ + public static fromObject(object: { [k: string]: any }): proto.SessionStructure.Chain.MessageKey; + + /** + * Creates a plain object from a MessageKey message. Also converts values to other types if specified. + * @param message MessageKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.SessionStructure.Chain.MessageKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a PendingKeyExchange. */ + interface IPendingKeyExchange { + + /** PendingKeyExchange sequence */ + sequence?: (number|null); + + /** PendingKeyExchange localBaseKey */ + localBaseKey?: (Uint8Array|null); + + /** PendingKeyExchange localBaseKeyPrivate */ + localBaseKeyPrivate?: (Uint8Array|null); + + /** PendingKeyExchange localRatchetKey */ + localRatchetKey?: (Uint8Array|null); + + /** PendingKeyExchange localRatchetKeyPrivate */ + localRatchetKeyPrivate?: (Uint8Array|null); + + /** PendingKeyExchange localIdentityKey */ + localIdentityKey?: (Uint8Array|null); + + /** PendingKeyExchange localIdentityKeyPrivate */ + localIdentityKeyPrivate?: (Uint8Array|null); + } + + /** Represents a PendingKeyExchange. */ + class PendingKeyExchange implements IPendingKeyExchange { + + /** + * Constructs a new PendingKeyExchange. + * @param [properties] Properties to set + */ + constructor(properties?: proto.SessionStructure.IPendingKeyExchange); + + /** PendingKeyExchange sequence. */ + public sequence: number; + + /** PendingKeyExchange localBaseKey. */ + public localBaseKey: Uint8Array; + + /** PendingKeyExchange localBaseKeyPrivate. */ + public localBaseKeyPrivate: Uint8Array; + + /** PendingKeyExchange localRatchetKey. */ + public localRatchetKey: Uint8Array; + + /** PendingKeyExchange localRatchetKeyPrivate. */ + public localRatchetKeyPrivate: Uint8Array; + + /** PendingKeyExchange localIdentityKey. */ + public localIdentityKey: Uint8Array; + + /** PendingKeyExchange localIdentityKeyPrivate. */ + public localIdentityKeyPrivate: Uint8Array; + + /** + * Creates a new PendingKeyExchange instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingKeyExchange instance + */ + public static create(properties?: proto.SessionStructure.IPendingKeyExchange): proto.SessionStructure.PendingKeyExchange; + + /** + * Encodes the specified PendingKeyExchange message. Does not implicitly {@link proto.SessionStructure.PendingKeyExchange.verify|verify} messages. + * @param message PendingKeyExchange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.SessionStructure.IPendingKeyExchange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PendingKeyExchange message, length delimited. Does not implicitly {@link proto.SessionStructure.PendingKeyExchange.verify|verify} messages. + * @param message PendingKeyExchange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.SessionStructure.IPendingKeyExchange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingKeyExchange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PendingKeyExchange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SessionStructure.PendingKeyExchange; + + /** + * Decodes a PendingKeyExchange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PendingKeyExchange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SessionStructure.PendingKeyExchange; + + /** + * Verifies a PendingKeyExchange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PendingKeyExchange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PendingKeyExchange + */ + public static fromObject(object: { [k: string]: any }): proto.SessionStructure.PendingKeyExchange; + + /** + * Creates a plain object from a PendingKeyExchange message. Also converts values to other types if specified. + * @param message PendingKeyExchange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.SessionStructure.PendingKeyExchange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PendingKeyExchange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PendingPreKey. */ + interface IPendingPreKey { + + /** PendingPreKey preKeyId */ + preKeyId?: (number|null); + + /** PendingPreKey signedPreKeyId */ + signedPreKeyId?: (number|null); + + /** PendingPreKey baseKey */ + baseKey?: (Uint8Array|null); + } + + /** Represents a PendingPreKey. */ + class PendingPreKey implements IPendingPreKey { + + /** + * Constructs a new PendingPreKey. + * @param [properties] Properties to set + */ + constructor(properties?: proto.SessionStructure.IPendingPreKey); + + /** PendingPreKey preKeyId. */ + public preKeyId: number; + + /** PendingPreKey signedPreKeyId. */ + public signedPreKeyId: number; + + /** PendingPreKey baseKey. */ + public baseKey: Uint8Array; + + /** + * Creates a new PendingPreKey instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingPreKey instance + */ + public static create(properties?: proto.SessionStructure.IPendingPreKey): proto.SessionStructure.PendingPreKey; + + /** + * Encodes the specified PendingPreKey message. Does not implicitly {@link proto.SessionStructure.PendingPreKey.verify|verify} messages. + * @param message PendingPreKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.SessionStructure.IPendingPreKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PendingPreKey message, length delimited. Does not implicitly {@link proto.SessionStructure.PendingPreKey.verify|verify} messages. + * @param message PendingPreKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.SessionStructure.IPendingPreKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingPreKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PendingPreKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SessionStructure.PendingPreKey; + + /** + * Decodes a PendingPreKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PendingPreKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SessionStructure.PendingPreKey; + + /** + * Verifies a PendingPreKey message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PendingPreKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PendingPreKey + */ + public static fromObject(object: { [k: string]: any }): proto.SessionStructure.PendingPreKey; + + /** + * Creates a plain object from a PendingPreKey message. Also converts values to other types if specified. + * @param message PendingPreKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.SessionStructure.PendingPreKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PendingPreKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + /** Properties of a SignedPreKeyRecordStructure. */ interface ISignedPreKeyRecordStructure { @@ -21717,6 +22577,9 @@ export namespace proto { /** SyncActionValue chatAssignmentOpenedStatus */ chatAssignmentOpenedStatus?: (proto.SyncActionValue.IChatAssignmentOpenedStatusAction|null); + + /** SyncActionValue pnForLidChatAction */ + pnForLidChatAction?: (proto.SyncActionValue.IPnForLidChatAction|null); } /** Represents a SyncActionValue. */ @@ -21821,6 +22684,9 @@ export namespace proto { /** SyncActionValue chatAssignmentOpenedStatus. */ public chatAssignmentOpenedStatus?: (proto.SyncActionValue.IChatAssignmentOpenedStatusAction|null); + /** SyncActionValue pnForLidChatAction. */ + public pnForLidChatAction?: (proto.SyncActionValue.IPnForLidChatAction|null); + /** * Creates a new SyncActionValue instance using the specified properties. * @param [properties] Properties to set @@ -23496,6 +24362,96 @@ export namespace proto { public toJSON(): { [k: string]: any }; } + /** Properties of a PnForLidChatAction. */ + interface IPnForLidChatAction { + + /** PnForLidChatAction pnJid */ + pnJid?: (string|null); + } + + /** Represents a PnForLidChatAction. */ + class PnForLidChatAction implements IPnForLidChatAction { + + /** + * Constructs a new PnForLidChatAction. + * @param [properties] Properties to set + */ + constructor(properties?: proto.SyncActionValue.IPnForLidChatAction); + + /** PnForLidChatAction pnJid. */ + public pnJid: string; + + /** + * Creates a new PnForLidChatAction instance using the specified properties. + * @param [properties] Properties to set + * @returns PnForLidChatAction instance + */ + public static create(properties?: proto.SyncActionValue.IPnForLidChatAction): proto.SyncActionValue.PnForLidChatAction; + + /** + * Encodes the specified PnForLidChatAction message. Does not implicitly {@link proto.SyncActionValue.PnForLidChatAction.verify|verify} messages. + * @param message PnForLidChatAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.SyncActionValue.IPnForLidChatAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PnForLidChatAction message, length delimited. Does not implicitly {@link proto.SyncActionValue.PnForLidChatAction.verify|verify} messages. + * @param message PnForLidChatAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.SyncActionValue.IPnForLidChatAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PnForLidChatAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PnForLidChatAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SyncActionValue.PnForLidChatAction; + + /** + * Decodes a PnForLidChatAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PnForLidChatAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SyncActionValue.PnForLidChatAction; + + /** + * Verifies a PnForLidChatAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PnForLidChatAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PnForLidChatAction + */ + public static fromObject(object: { [k: string]: any }): proto.SyncActionValue.PnForLidChatAction; + + /** + * Creates a plain object from a PnForLidChatAction message. Also converts values to other types if specified. + * @param message PnForLidChatAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.SyncActionValue.PnForLidChatAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PnForLidChatAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a PrimaryFeature. */ interface IPrimaryFeature { diff --git a/WAProto/index.js b/WAProto/index.js index bca23b3..17d396d 100644 --- a/WAProto/index.js +++ b/WAProto/index.js @@ -3776,524 +3776,6 @@ $root.proto = (function() { return CertChain; })(); - proto.Chain = (function() { - - /** - * Properties of a Chain. - * @memberof proto - * @interface IChain - * @property {Uint8Array|null} [senderRatchetKey] Chain senderRatchetKey - * @property {Uint8Array|null} [senderRatchetKeyPrivate] Chain senderRatchetKeyPrivate - * @property {proto.IChainKey|null} [chainKey] Chain chainKey - * @property {Array.|null} [messageKeys] Chain messageKeys - */ - - /** - * Constructs a new Chain. - * @memberof proto - * @classdesc Represents a Chain. - * @implements IChain - * @constructor - * @param {proto.IChain=} [properties] Properties to set - */ - function Chain(properties) { - this.messageKeys = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Chain senderRatchetKey. - * @member {Uint8Array} senderRatchetKey - * @memberof proto.Chain - * @instance - */ - Chain.prototype.senderRatchetKey = $util.newBuffer([]); - - /** - * Chain senderRatchetKeyPrivate. - * @member {Uint8Array} senderRatchetKeyPrivate - * @memberof proto.Chain - * @instance - */ - Chain.prototype.senderRatchetKeyPrivate = $util.newBuffer([]); - - /** - * Chain chainKey. - * @member {proto.IChainKey|null|undefined} chainKey - * @memberof proto.Chain - * @instance - */ - Chain.prototype.chainKey = null; - - /** - * Chain messageKeys. - * @member {Array.} messageKeys - * @memberof proto.Chain - * @instance - */ - Chain.prototype.messageKeys = $util.emptyArray; - - /** - * Creates a new Chain instance using the specified properties. - * @function create - * @memberof proto.Chain - * @static - * @param {proto.IChain=} [properties] Properties to set - * @returns {proto.Chain} Chain instance - */ - Chain.create = function create(properties) { - return new Chain(properties); - }; - - /** - * Encodes the specified Chain message. Does not implicitly {@link proto.Chain.verify|verify} messages. - * @function encode - * @memberof proto.Chain - * @static - * @param {proto.IChain} message Chain message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Chain.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.senderRatchetKey != null && Object.hasOwnProperty.call(message, "senderRatchetKey")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.senderRatchetKey); - if (message.senderRatchetKeyPrivate != null && Object.hasOwnProperty.call(message, "senderRatchetKeyPrivate")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.senderRatchetKeyPrivate); - if (message.chainKey != null && Object.hasOwnProperty.call(message, "chainKey")) - $root.proto.ChainKey.encode(message.chainKey, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.messageKeys != null && message.messageKeys.length) - for (var i = 0; i < message.messageKeys.length; ++i) - $root.proto.MessageKey.encode(message.messageKeys[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Chain message, length delimited. Does not implicitly {@link proto.Chain.verify|verify} messages. - * @function encodeDelimited - * @memberof proto.Chain - * @static - * @param {proto.IChain} message Chain message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Chain.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Chain message from the specified reader or buffer. - * @function decode - * @memberof proto.Chain - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {proto.Chain} Chain - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Chain.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Chain(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.senderRatchetKey = reader.bytes(); - break; - case 2: - message.senderRatchetKeyPrivate = reader.bytes(); - break; - case 3: - message.chainKey = $root.proto.ChainKey.decode(reader, reader.uint32()); - break; - case 4: - if (!(message.messageKeys && message.messageKeys.length)) - message.messageKeys = []; - message.messageKeys.push($root.proto.MessageKey.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Chain message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof proto.Chain - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.Chain} Chain - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Chain.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Chain message. - * @function verify - * @memberof proto.Chain - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Chain.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.senderRatchetKey != null && message.hasOwnProperty("senderRatchetKey")) - if (!(message.senderRatchetKey && typeof message.senderRatchetKey.length === "number" || $util.isString(message.senderRatchetKey))) - return "senderRatchetKey: buffer expected"; - if (message.senderRatchetKeyPrivate != null && message.hasOwnProperty("senderRatchetKeyPrivate")) - if (!(message.senderRatchetKeyPrivate && typeof message.senderRatchetKeyPrivate.length === "number" || $util.isString(message.senderRatchetKeyPrivate))) - return "senderRatchetKeyPrivate: buffer expected"; - if (message.chainKey != null && message.hasOwnProperty("chainKey")) { - var error = $root.proto.ChainKey.verify(message.chainKey); - if (error) - return "chainKey." + error; - } - if (message.messageKeys != null && message.hasOwnProperty("messageKeys")) { - if (!Array.isArray(message.messageKeys)) - return "messageKeys: array expected"; - for (var i = 0; i < message.messageKeys.length; ++i) { - var error = $root.proto.MessageKey.verify(message.messageKeys[i]); - if (error) - return "messageKeys." + error; - } - } - return null; - }; - - /** - * Creates a Chain message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof proto.Chain - * @static - * @param {Object.} object Plain object - * @returns {proto.Chain} Chain - */ - Chain.fromObject = function fromObject(object) { - if (object instanceof $root.proto.Chain) - return object; - var message = new $root.proto.Chain(); - if (object.senderRatchetKey != null) - if (typeof object.senderRatchetKey === "string") - $util.base64.decode(object.senderRatchetKey, message.senderRatchetKey = $util.newBuffer($util.base64.length(object.senderRatchetKey)), 0); - else if (object.senderRatchetKey.length) - message.senderRatchetKey = object.senderRatchetKey; - if (object.senderRatchetKeyPrivate != null) - if (typeof object.senderRatchetKeyPrivate === "string") - $util.base64.decode(object.senderRatchetKeyPrivate, message.senderRatchetKeyPrivate = $util.newBuffer($util.base64.length(object.senderRatchetKeyPrivate)), 0); - else if (object.senderRatchetKeyPrivate.length) - message.senderRatchetKeyPrivate = object.senderRatchetKeyPrivate; - if (object.chainKey != null) { - if (typeof object.chainKey !== "object") - throw TypeError(".proto.Chain.chainKey: object expected"); - message.chainKey = $root.proto.ChainKey.fromObject(object.chainKey); - } - if (object.messageKeys) { - if (!Array.isArray(object.messageKeys)) - throw TypeError(".proto.Chain.messageKeys: array expected"); - message.messageKeys = []; - for (var i = 0; i < object.messageKeys.length; ++i) { - if (typeof object.messageKeys[i] !== "object") - throw TypeError(".proto.Chain.messageKeys: object expected"); - message.messageKeys[i] = $root.proto.MessageKey.fromObject(object.messageKeys[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Chain message. Also converts values to other types if specified. - * @function toObject - * @memberof proto.Chain - * @static - * @param {proto.Chain} message Chain - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Chain.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.messageKeys = []; - if (options.defaults) { - if (options.bytes === String) - object.senderRatchetKey = ""; - else { - object.senderRatchetKey = []; - if (options.bytes !== Array) - object.senderRatchetKey = $util.newBuffer(object.senderRatchetKey); - } - if (options.bytes === String) - object.senderRatchetKeyPrivate = ""; - else { - object.senderRatchetKeyPrivate = []; - if (options.bytes !== Array) - object.senderRatchetKeyPrivate = $util.newBuffer(object.senderRatchetKeyPrivate); - } - object.chainKey = null; - } - if (message.senderRatchetKey != null && message.hasOwnProperty("senderRatchetKey")) - object.senderRatchetKey = options.bytes === String ? $util.base64.encode(message.senderRatchetKey, 0, message.senderRatchetKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.senderRatchetKey) : message.senderRatchetKey; - if (message.senderRatchetKeyPrivate != null && message.hasOwnProperty("senderRatchetKeyPrivate")) - object.senderRatchetKeyPrivate = options.bytes === String ? $util.base64.encode(message.senderRatchetKeyPrivate, 0, message.senderRatchetKeyPrivate.length) : options.bytes === Array ? Array.prototype.slice.call(message.senderRatchetKeyPrivate) : message.senderRatchetKeyPrivate; - if (message.chainKey != null && message.hasOwnProperty("chainKey")) - object.chainKey = $root.proto.ChainKey.toObject(message.chainKey, options); - if (message.messageKeys && message.messageKeys.length) { - object.messageKeys = []; - for (var j = 0; j < message.messageKeys.length; ++j) - object.messageKeys[j] = $root.proto.MessageKey.toObject(message.messageKeys[j], options); - } - return object; - }; - - /** - * Converts this Chain to JSON. - * @function toJSON - * @memberof proto.Chain - * @instance - * @returns {Object.} JSON object - */ - Chain.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Chain; - })(); - - proto.ChainKey = (function() { - - /** - * Properties of a ChainKey. - * @memberof proto - * @interface IChainKey - * @property {number|null} [index] ChainKey index - * @property {Uint8Array|null} [key] ChainKey key - */ - - /** - * Constructs a new ChainKey. - * @memberof proto - * @classdesc Represents a ChainKey. - * @implements IChainKey - * @constructor - * @param {proto.IChainKey=} [properties] Properties to set - */ - function ChainKey(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ChainKey index. - * @member {number} index - * @memberof proto.ChainKey - * @instance - */ - ChainKey.prototype.index = 0; - - /** - * ChainKey key. - * @member {Uint8Array} key - * @memberof proto.ChainKey - * @instance - */ - ChainKey.prototype.key = $util.newBuffer([]); - - /** - * Creates a new ChainKey instance using the specified properties. - * @function create - * @memberof proto.ChainKey - * @static - * @param {proto.IChainKey=} [properties] Properties to set - * @returns {proto.ChainKey} ChainKey instance - */ - ChainKey.create = function create(properties) { - return new ChainKey(properties); - }; - - /** - * Encodes the specified ChainKey message. Does not implicitly {@link proto.ChainKey.verify|verify} messages. - * @function encode - * @memberof proto.ChainKey - * @static - * @param {proto.IChainKey} message ChainKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChainKey.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.index != null && Object.hasOwnProperty.call(message, "index")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.index); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.key); - return writer; - }; - - /** - * Encodes the specified ChainKey message, length delimited. Does not implicitly {@link proto.ChainKey.verify|verify} messages. - * @function encodeDelimited - * @memberof proto.ChainKey - * @static - * @param {proto.IChainKey} message ChainKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChainKey.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ChainKey message from the specified reader or buffer. - * @function decode - * @memberof proto.ChainKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {proto.ChainKey} ChainKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChainKey.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ChainKey(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.index = reader.uint32(); - break; - case 2: - message.key = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ChainKey message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof proto.ChainKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.ChainKey} ChainKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChainKey.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ChainKey message. - * @function verify - * @memberof proto.ChainKey - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ChainKey.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.index != null && message.hasOwnProperty("index")) - if (!$util.isInteger(message.index)) - return "index: integer expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) - return "key: buffer expected"; - return null; - }; - - /** - * Creates a ChainKey message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof proto.ChainKey - * @static - * @param {Object.} object Plain object - * @returns {proto.ChainKey} ChainKey - */ - ChainKey.fromObject = function fromObject(object) { - if (object instanceof $root.proto.ChainKey) - return object; - var message = new $root.proto.ChainKey(); - if (object.index != null) - message.index = object.index >>> 0; - if (object.key != null) - if (typeof object.key === "string") - $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); - else if (object.key.length) - message.key = object.key; - return message; - }; - - /** - * Creates a plain object from a ChainKey message. Also converts values to other types if specified. - * @function toObject - * @memberof proto.ChainKey - * @static - * @param {proto.ChainKey} message ChainKey - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ChainKey.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.index = 0; - if (options.bytes === String) - object.key = ""; - else { - object.key = []; - if (options.bytes !== Array) - object.key = $util.newBuffer(object.key); - } - } - if (message.index != null && message.hasOwnProperty("index")) - object.index = message.index; - if (message.key != null && message.hasOwnProperty("key")) - object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; - return object; - }; - - /** - * Converts this ChainKey to JSON. - * @function toJSON - * @memberof proto.ChainKey - * @instance - * @returns {Object.} JSON object - */ - ChainKey.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ChainKey; - })(); - proto.ClientPayload = (function() { /** @@ -4324,7 +3806,6 @@ $root.proto = (function() { * @property {Uint8Array|null} [fbDeviceId] ClientPayload fbDeviceId * @property {boolean|null} [pull] ClientPayload pull * @property {Uint8Array|null} [paddingBytes] ClientPayload paddingBytes - * @property {proto.ClientPayload.BizMarketSegment|null} [bizMarketSegment] ClientPayload bizMarketSegment * @property {number|null} [yearClass] ClientPayload yearClass * @property {number|null} [memClass] ClientPayload memClass */ @@ -4537,14 +4018,6 @@ $root.proto = (function() { */ ClientPayload.prototype.paddingBytes = $util.newBuffer([]); - /** - * ClientPayload bizMarketSegment. - * @member {proto.ClientPayload.BizMarketSegment} bizMarketSegment - * @memberof proto.ClientPayload - * @instance - */ - ClientPayload.prototype.bizMarketSegment = 0; - /** * ClientPayload yearClass. * @member {number} yearClass @@ -4634,8 +4107,6 @@ $root.proto = (function() { writer.uint32(/* id 33, wireType 0 =*/264).bool(message.pull); if (message.paddingBytes != null && Object.hasOwnProperty.call(message, "paddingBytes")) writer.uint32(/* id 34, wireType 2 =*/274).bytes(message.paddingBytes); - if (message.bizMarketSegment != null && Object.hasOwnProperty.call(message, "bizMarketSegment")) - writer.uint32(/* id 35, wireType 0 =*/280).int32(message.bizMarketSegment); if (message.yearClass != null && Object.hasOwnProperty.call(message, "yearClass")) writer.uint32(/* id 36, wireType 0 =*/288).int32(message.yearClass); if (message.memClass != null && Object.hasOwnProperty.call(message, "memClass")) @@ -4753,9 +4224,6 @@ $root.proto = (function() { case 34: message.paddingBytes = reader.bytes(); break; - case 35: - message.bizMarketSegment = reader.int32(); - break; case 36: message.yearClass = reader.int32(); break; @@ -4919,15 +4387,6 @@ $root.proto = (function() { if (message.paddingBytes != null && message.hasOwnProperty("paddingBytes")) if (!(message.paddingBytes && typeof message.paddingBytes.length === "number" || $util.isString(message.paddingBytes))) return "paddingBytes: buffer expected"; - if (message.bizMarketSegment != null && message.hasOwnProperty("bizMarketSegment")) - switch (message.bizMarketSegment) { - default: - return "bizMarketSegment: enum value expected"; - case 0: - case 1: - case 2: - break; - } if (message.yearClass != null && message.hasOwnProperty("yearClass")) if (!$util.isInteger(message.yearClass)) return "yearClass: integer expected"; @@ -5144,20 +4603,6 @@ $root.proto = (function() { $util.base64.decode(object.paddingBytes, message.paddingBytes = $util.newBuffer($util.base64.length(object.paddingBytes)), 0); else if (object.paddingBytes.length) message.paddingBytes = object.paddingBytes; - switch (object.bizMarketSegment) { - case "DEFAULT": - case 0: - message.bizMarketSegment = 0; - break; - case "DEVX": - case 1: - message.bizMarketSegment = 1; - break; - case "INBOX": - case 2: - message.bizMarketSegment = 2; - break; - } if (object.yearClass != null) message.yearClass = object.yearClass | 0; if (object.memClass != null) @@ -5236,7 +4681,6 @@ $root.proto = (function() { if (options.bytes !== Array) object.paddingBytes = $util.newBuffer(object.paddingBytes); } - object.bizMarketSegment = options.enums === String ? "DEFAULT" : 0; object.yearClass = 0; object.memClass = 0; } @@ -5297,8 +4741,6 @@ $root.proto = (function() { object.pull = message.pull; if (message.paddingBytes != null && message.hasOwnProperty("paddingBytes")) object.paddingBytes = options.bytes === String ? $util.base64.encode(message.paddingBytes, 0, message.paddingBytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.paddingBytes) : message.paddingBytes; - if (message.bizMarketSegment != null && message.hasOwnProperty("bizMarketSegment")) - object.bizMarketSegment = options.enums === String ? $root.proto.ClientPayload.BizMarketSegment[message.bizMarketSegment] : message.bizMarketSegment; if (message.yearClass != null && message.hasOwnProperty("yearClass")) object.yearClass = message.yearClass; if (message.memClass != null && message.hasOwnProperty("memClass")) @@ -5317,22 +4759,6 @@ $root.proto = (function() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * BizMarketSegment enum. - * @name proto.ClientPayload.BizMarketSegment - * @enum {number} - * @property {number} DEFAULT=0 DEFAULT value - * @property {number} DEVX=1 DEVX value - * @property {number} INBOX=2 INBOX value - */ - ClientPayload.BizMarketSegment = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DEFAULT"] = 0; - values[valuesById[1] = "DEVX"] = 1; - values[valuesById[2] = "INBOX"] = 2; - return values; - })(); - /** * ConnectReason enum. * @name proto.ClientPayload.ConnectReason @@ -6431,6 +5857,7 @@ $root.proto = (function() { case 29: case 30: case 31: + case 32: break; } if (message.appVersion != null && message.hasOwnProperty("appVersion")) { @@ -6622,6 +6049,10 @@ $root.proto = (function() { case 31: message.platform = 31; break; + case "BLUE_WEB": + case 32: + message.platform = 32; + break; } if (object.appVersion != null) { if (typeof object.appVersion !== "object") @@ -7049,6 +6480,7 @@ $root.proto = (function() { * @property {number} WEAROS=29 WEAROS value * @property {number} ARDEVICE=30 ARDEVICE value * @property {number} VRDEVICE=31 VRDEVICE value + * @property {number} BLUE_WEB=32 BLUE_WEB value */ UserAgent.Platform = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -7084,6 +6516,7 @@ $root.proto = (function() { values[valuesById[29] = "WEAROS"] = 29; values[valuesById[30] = "ARDEVICE"] = 30; values[valuesById[31] = "VRDEVICE"] = 31; + values[valuesById[32] = "BLUE_WEB"] = 32; return values; })(); @@ -7866,6 +7299,9 @@ $root.proto = (function() { * @property {string|null} [parentGroupJid] ContextInfo parentGroupJid * @property {string|null} [trustBannerType] ContextInfo trustBannerType * @property {number|null} [trustBannerAction] ContextInfo trustBannerAction + * @property {boolean|null} [isSampled] ContextInfo isSampled + * @property {Array.|null} [groupMentions] ContextInfo groupMentions + * @property {proto.ContextInfo.IUTMInfo|null} [utm] ContextInfo utm */ /** @@ -7878,6 +7314,7 @@ $root.proto = (function() { */ function ContextInfo(properties) { this.mentionedJid = []; + this.groupMentions = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8084,6 +7521,30 @@ $root.proto = (function() { */ ContextInfo.prototype.trustBannerAction = 0; + /** + * ContextInfo isSampled. + * @member {boolean} isSampled + * @memberof proto.ContextInfo + * @instance + */ + ContextInfo.prototype.isSampled = false; + + /** + * ContextInfo groupMentions. + * @member {Array.} groupMentions + * @memberof proto.ContextInfo + * @instance + */ + ContextInfo.prototype.groupMentions = $util.emptyArray; + + /** + * ContextInfo utm. + * @member {proto.ContextInfo.IUTMInfo|null|undefined} utm + * @memberof proto.ContextInfo + * @instance + */ + ContextInfo.prototype.utm = null; + /** * Creates a new ContextInfo instance using the specified properties. * @function create @@ -8159,6 +7620,13 @@ $root.proto = (function() { writer.uint32(/* id 37, wireType 2 =*/298).string(message.trustBannerType); if (message.trustBannerAction != null && Object.hasOwnProperty.call(message, "trustBannerAction")) writer.uint32(/* id 38, wireType 0 =*/304).uint32(message.trustBannerAction); + if (message.isSampled != null && Object.hasOwnProperty.call(message, "isSampled")) + writer.uint32(/* id 39, wireType 0 =*/312).bool(message.isSampled); + if (message.groupMentions != null && message.groupMentions.length) + for (var i = 0; i < message.groupMentions.length; ++i) + $root.proto.GroupMention.encode(message.groupMentions[i], writer.uint32(/* id 40, wireType 2 =*/322).fork()).ldelim(); + if (message.utm != null && Object.hasOwnProperty.call(message, "utm")) + $root.proto.ContextInfo.UTMInfo.encode(message.utm, writer.uint32(/* id 41, wireType 2 =*/330).fork()).ldelim(); return writer; }; @@ -8270,6 +7738,17 @@ $root.proto = (function() { case 38: message.trustBannerAction = reader.uint32(); break; + case 39: + message.isSampled = reader.bool(); + break; + case 40: + if (!(message.groupMentions && message.groupMentions.length)) + message.groupMentions = []; + message.groupMentions.push($root.proto.GroupMention.decode(reader, reader.uint32())); + break; + case 41: + message.utm = $root.proto.ContextInfo.UTMInfo.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -8396,6 +7875,23 @@ $root.proto = (function() { if (message.trustBannerAction != null && message.hasOwnProperty("trustBannerAction")) if (!$util.isInteger(message.trustBannerAction)) return "trustBannerAction: integer expected"; + if (message.isSampled != null && message.hasOwnProperty("isSampled")) + if (typeof message.isSampled !== "boolean") + return "isSampled: boolean expected"; + if (message.groupMentions != null && message.hasOwnProperty("groupMentions")) { + if (!Array.isArray(message.groupMentions)) + return "groupMentions: array expected"; + for (var i = 0; i < message.groupMentions.length; ++i) { + var error = $root.proto.GroupMention.verify(message.groupMentions[i]); + if (error) + return "groupMentions." + error; + } + } + if (message.utm != null && message.hasOwnProperty("utm")) { + var error = $root.proto.ContextInfo.UTMInfo.verify(message.utm); + if (error) + return "utm." + error; + } return null; }; @@ -8497,6 +7993,23 @@ $root.proto = (function() { message.trustBannerType = String(object.trustBannerType); if (object.trustBannerAction != null) message.trustBannerAction = object.trustBannerAction >>> 0; + if (object.isSampled != null) + message.isSampled = Boolean(object.isSampled); + if (object.groupMentions) { + if (!Array.isArray(object.groupMentions)) + throw TypeError(".proto.ContextInfo.groupMentions: array expected"); + message.groupMentions = []; + for (var i = 0; i < object.groupMentions.length; ++i) { + if (typeof object.groupMentions[i] !== "object") + throw TypeError(".proto.ContextInfo.groupMentions: object expected"); + message.groupMentions[i] = $root.proto.GroupMention.fromObject(object.groupMentions[i]); + } + } + if (object.utm != null) { + if (typeof object.utm !== "object") + throw TypeError(".proto.ContextInfo.utm: object expected"); + message.utm = $root.proto.ContextInfo.UTMInfo.fromObject(object.utm); + } return message; }; @@ -8513,8 +8026,10 @@ $root.proto = (function() { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.mentionedJid = []; + object.groupMentions = []; + } if (options.defaults) { object.stanzaId = ""; object.participant = ""; @@ -8556,6 +8071,8 @@ $root.proto = (function() { object.parentGroupJid = ""; object.trustBannerType = ""; object.trustBannerAction = 0; + object.isSampled = false; + object.utm = null; } if (message.stanzaId != null && message.hasOwnProperty("stanzaId")) object.stanzaId = message.stanzaId; @@ -8613,6 +8130,15 @@ $root.proto = (function() { object.trustBannerType = message.trustBannerType; if (message.trustBannerAction != null && message.hasOwnProperty("trustBannerAction")) object.trustBannerAction = message.trustBannerAction; + if (message.isSampled != null && message.hasOwnProperty("isSampled")) + object.isSampled = message.isSampled; + if (message.groupMentions && message.groupMentions.length) { + object.groupMentions = []; + for (var j = 0; j < message.groupMentions.length; ++j) + object.groupMentions[j] = $root.proto.GroupMention.toObject(message.groupMentions[j], options); + } + if (message.utm != null && message.hasOwnProperty("utm")) + object.utm = $root.proto.ContextInfo.UTMInfo.toObject(message.utm, options); return object; }; @@ -9419,6 +8945,216 @@ $root.proto = (function() { return ExternalAdReplyInfo; })(); + ContextInfo.UTMInfo = (function() { + + /** + * Properties of a UTMInfo. + * @memberof proto.ContextInfo + * @interface IUTMInfo + * @property {string|null} [utmSource] UTMInfo utmSource + * @property {string|null} [utmCampaign] UTMInfo utmCampaign + */ + + /** + * Constructs a new UTMInfo. + * @memberof proto.ContextInfo + * @classdesc Represents a UTMInfo. + * @implements IUTMInfo + * @constructor + * @param {proto.ContextInfo.IUTMInfo=} [properties] Properties to set + */ + function UTMInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UTMInfo utmSource. + * @member {string} utmSource + * @memberof proto.ContextInfo.UTMInfo + * @instance + */ + UTMInfo.prototype.utmSource = ""; + + /** + * UTMInfo utmCampaign. + * @member {string} utmCampaign + * @memberof proto.ContextInfo.UTMInfo + * @instance + */ + UTMInfo.prototype.utmCampaign = ""; + + /** + * Creates a new UTMInfo instance using the specified properties. + * @function create + * @memberof proto.ContextInfo.UTMInfo + * @static + * @param {proto.ContextInfo.IUTMInfo=} [properties] Properties to set + * @returns {proto.ContextInfo.UTMInfo} UTMInfo instance + */ + UTMInfo.create = function create(properties) { + return new UTMInfo(properties); + }; + + /** + * Encodes the specified UTMInfo message. Does not implicitly {@link proto.ContextInfo.UTMInfo.verify|verify} messages. + * @function encode + * @memberof proto.ContextInfo.UTMInfo + * @static + * @param {proto.ContextInfo.IUTMInfo} message UTMInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UTMInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.utmSource != null && Object.hasOwnProperty.call(message, "utmSource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.utmSource); + if (message.utmCampaign != null && Object.hasOwnProperty.call(message, "utmCampaign")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.utmCampaign); + return writer; + }; + + /** + * Encodes the specified UTMInfo message, length delimited. Does not implicitly {@link proto.ContextInfo.UTMInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.ContextInfo.UTMInfo + * @static + * @param {proto.ContextInfo.IUTMInfo} message UTMInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UTMInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UTMInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.ContextInfo.UTMInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.ContextInfo.UTMInfo} UTMInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UTMInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ContextInfo.UTMInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.utmSource = reader.string(); + break; + case 2: + message.utmCampaign = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UTMInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.ContextInfo.UTMInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.ContextInfo.UTMInfo} UTMInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UTMInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UTMInfo message. + * @function verify + * @memberof proto.ContextInfo.UTMInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UTMInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.utmSource != null && message.hasOwnProperty("utmSource")) + if (!$util.isString(message.utmSource)) + return "utmSource: string expected"; + if (message.utmCampaign != null && message.hasOwnProperty("utmCampaign")) + if (!$util.isString(message.utmCampaign)) + return "utmCampaign: string expected"; + return null; + }; + + /** + * Creates a UTMInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.ContextInfo.UTMInfo + * @static + * @param {Object.} object Plain object + * @returns {proto.ContextInfo.UTMInfo} UTMInfo + */ + UTMInfo.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ContextInfo.UTMInfo) + return object; + var message = new $root.proto.ContextInfo.UTMInfo(); + if (object.utmSource != null) + message.utmSource = String(object.utmSource); + if (object.utmCampaign != null) + message.utmCampaign = String(object.utmCampaign); + return message; + }; + + /** + * Creates a plain object from a UTMInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.ContextInfo.UTMInfo + * @static + * @param {proto.ContextInfo.UTMInfo} message UTMInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UTMInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.utmSource = ""; + object.utmCampaign = ""; + } + if (message.utmSource != null && message.hasOwnProperty("utmSource")) + object.utmSource = message.utmSource; + if (message.utmCampaign != null && message.hasOwnProperty("utmCampaign")) + object.utmCampaign = message.utmCampaign; + return object; + }; + + /** + * Converts this UTMInfo to JSON. + * @function toJSON + * @memberof proto.ContextInfo.UTMInfo + * @instance + * @returns {Object.} JSON object + */ + UTMInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UTMInfo; + })(); + return ContextInfo; })(); @@ -9463,8 +9199,8 @@ $root.proto = (function() { * @property {string|null} [description] Conversation description * @property {boolean|null} [support] Conversation support * @property {boolean|null} [isParentGroup] Conversation isParentGroup - * @property {boolean|null} [isDefaultSubgroup] Conversation isDefaultSubgroup * @property {string|null} [parentGroupId] Conversation parentGroupId + * @property {boolean|null} [isDefaultSubgroup] Conversation isDefaultSubgroup * @property {string|null} [displayName] Conversation displayName * @property {string|null} [pnJid] Conversation pnJid * @property {boolean|null} [shareOwnPn] Conversation shareOwnPn @@ -9769,14 +9505,6 @@ $root.proto = (function() { */ Conversation.prototype.isParentGroup = false; - /** - * Conversation isDefaultSubgroup. - * @member {boolean} isDefaultSubgroup - * @memberof proto.Conversation - * @instance - */ - Conversation.prototype.isDefaultSubgroup = false; - /** * Conversation parentGroupId. * @member {string} parentGroupId @@ -9785,6 +9513,14 @@ $root.proto = (function() { */ Conversation.prototype.parentGroupId = ""; + /** + * Conversation isDefaultSubgroup. + * @member {boolean} isDefaultSubgroup + * @memberof proto.Conversation + * @instance + */ + Conversation.prototype.isDefaultSubgroup = false; + /** * Conversation displayName. * @member {string} displayName @@ -10077,12 +9813,12 @@ $root.proto = (function() { case 35: message.isParentGroup = reader.bool(); break; - case 36: - message.isDefaultSubgroup = reader.bool(); - break; case 37: message.parentGroupId = reader.string(); break; + case 36: + message.isDefaultSubgroup = reader.bool(); + break; case 38: message.displayName = reader.string(); break; @@ -10266,12 +10002,12 @@ $root.proto = (function() { if (message.isParentGroup != null && message.hasOwnProperty("isParentGroup")) if (typeof message.isParentGroup !== "boolean") return "isParentGroup: boolean expected"; - if (message.isDefaultSubgroup != null && message.hasOwnProperty("isDefaultSubgroup")) - if (typeof message.isDefaultSubgroup !== "boolean") - return "isDefaultSubgroup: boolean expected"; if (message.parentGroupId != null && message.hasOwnProperty("parentGroupId")) if (!$util.isString(message.parentGroupId)) return "parentGroupId: string expected"; + if (message.isDefaultSubgroup != null && message.hasOwnProperty("isDefaultSubgroup")) + if (typeof message.isDefaultSubgroup !== "boolean") + return "isDefaultSubgroup: boolean expected"; if (message.displayName != null && message.hasOwnProperty("displayName")) if (!$util.isString(message.displayName)) return "displayName: string expected"; @@ -10469,10 +10205,10 @@ $root.proto = (function() { message.support = Boolean(object.support); if (object.isParentGroup != null) message.isParentGroup = Boolean(object.isParentGroup); - if (object.isDefaultSubgroup != null) - message.isDefaultSubgroup = Boolean(object.isDefaultSubgroup); if (object.parentGroupId != null) message.parentGroupId = String(object.parentGroupId); + if (object.isDefaultSubgroup != null) + message.isDefaultSubgroup = Boolean(object.isDefaultSubgroup); if (object.displayName != null) message.displayName = String(object.displayName); if (object.pnJid != null) @@ -11333,6 +11069,10 @@ $root.proto = (function() { case 11: case 12: case 13: + case 14: + case 15: + case 16: + case 17: break; } if (message.requireFullSync != null && message.hasOwnProperty("requireFullSync")) @@ -11422,6 +11162,22 @@ $root.proto = (function() { case 13: message.platformType = 13; break; + case "IOS_PHONE": + case 14: + message.platformType = 14; + break; + case "IOS_CATALYST": + case 15: + message.platformType = 15; + break; + case "ANDROID_PHONE": + case 16: + message.platformType = 16; + break; + case "ANDROID_AMBIGUOUS": + case 17: + message.platformType = 17; + break; } if (object.requireFullSync != null) message.requireFullSync = Boolean(object.requireFullSync); @@ -12003,6 +11759,10 @@ $root.proto = (function() { * @property {number} ALOHA=11 ALOHA value * @property {number} CATALINA=12 CATALINA value * @property {number} TCL_TV=13 TCL_TV value + * @property {number} IOS_PHONE=14 IOS_PHONE value + * @property {number} IOS_CATALYST=15 IOS_CATALYST value + * @property {number} ANDROID_PHONE=16 ANDROID_PHONE value + * @property {number} ANDROID_AMBIGUOUS=17 ANDROID_AMBIGUOUS value */ DeviceProps.PlatformType = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -12020,6 +11780,10 @@ $root.proto = (function() { values[valuesById[11] = "ALOHA"] = 11; values[valuesById[12] = "CATALINA"] = 12; values[valuesById[13] = "TCL_TV"] = 13; + values[valuesById[14] = "IOS_PHONE"] = 14; + values[valuesById[15] = "IOS_CATALYST"] = 15; + values[valuesById[16] = "ANDROID_PHONE"] = 16; + values[valuesById[17] = "ANDROID_AMBIGUOUS"] = 17; return values; })(); @@ -13504,6 +13268,216 @@ $root.proto = (function() { return GlobalSettings; })(); + proto.GroupMention = (function() { + + /** + * Properties of a GroupMention. + * @memberof proto + * @interface IGroupMention + * @property {string|null} [groupJid] GroupMention groupJid + * @property {string|null} [groupSubject] GroupMention groupSubject + */ + + /** + * Constructs a new GroupMention. + * @memberof proto + * @classdesc Represents a GroupMention. + * @implements IGroupMention + * @constructor + * @param {proto.IGroupMention=} [properties] Properties to set + */ + function GroupMention(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupMention groupJid. + * @member {string} groupJid + * @memberof proto.GroupMention + * @instance + */ + GroupMention.prototype.groupJid = ""; + + /** + * GroupMention groupSubject. + * @member {string} groupSubject + * @memberof proto.GroupMention + * @instance + */ + GroupMention.prototype.groupSubject = ""; + + /** + * Creates a new GroupMention instance using the specified properties. + * @function create + * @memberof proto.GroupMention + * @static + * @param {proto.IGroupMention=} [properties] Properties to set + * @returns {proto.GroupMention} GroupMention instance + */ + GroupMention.create = function create(properties) { + return new GroupMention(properties); + }; + + /** + * Encodes the specified GroupMention message. Does not implicitly {@link proto.GroupMention.verify|verify} messages. + * @function encode + * @memberof proto.GroupMention + * @static + * @param {proto.IGroupMention} message GroupMention message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupMention.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupJid != null && Object.hasOwnProperty.call(message, "groupJid")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.groupJid); + if (message.groupSubject != null && Object.hasOwnProperty.call(message, "groupSubject")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.groupSubject); + return writer; + }; + + /** + * Encodes the specified GroupMention message, length delimited. Does not implicitly {@link proto.GroupMention.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.GroupMention + * @static + * @param {proto.IGroupMention} message GroupMention message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupMention.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupMention message from the specified reader or buffer. + * @function decode + * @memberof proto.GroupMention + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.GroupMention} GroupMention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupMention.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.GroupMention(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupJid = reader.string(); + break; + case 2: + message.groupSubject = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupMention message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.GroupMention + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.GroupMention} GroupMention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupMention.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupMention message. + * @function verify + * @memberof proto.GroupMention + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupMention.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groupJid != null && message.hasOwnProperty("groupJid")) + if (!$util.isString(message.groupJid)) + return "groupJid: string expected"; + if (message.groupSubject != null && message.hasOwnProperty("groupSubject")) + if (!$util.isString(message.groupSubject)) + return "groupSubject: string expected"; + return null; + }; + + /** + * Creates a GroupMention message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.GroupMention + * @static + * @param {Object.} object Plain object + * @returns {proto.GroupMention} GroupMention + */ + GroupMention.fromObject = function fromObject(object) { + if (object instanceof $root.proto.GroupMention) + return object; + var message = new $root.proto.GroupMention(); + if (object.groupJid != null) + message.groupJid = String(object.groupJid); + if (object.groupSubject != null) + message.groupSubject = String(object.groupSubject); + return message; + }; + + /** + * Creates a plain object from a GroupMention message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.GroupMention + * @static + * @param {proto.GroupMention} message GroupMention + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupMention.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.groupJid = ""; + object.groupSubject = ""; + } + if (message.groupJid != null && message.hasOwnProperty("groupJid")) + object.groupJid = message.groupJid; + if (message.groupSubject != null && message.hasOwnProperty("groupSubject")) + object.groupSubject = message.groupSubject; + return object; + }; + + /** + * Converts this GroupMention to JSON. + * @function toJSON + * @memberof proto.GroupMention + * @instance + * @returns {Object.} JSON object + */ + GroupMention.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupMention; + })(); + proto.GroupParticipant = (function() { /** @@ -15041,6 +15015,7 @@ $root.proto = (function() { case 3: case 4: case 5: + case 6: break; } if (message.conversations != null && message.hasOwnProperty("conversations")) { @@ -15145,6 +15120,10 @@ $root.proto = (function() { case 5: message.syncType = 5; break; + case "ON_DEMAND": + case 6: + message.syncType = 6; + break; } if (object.conversations) { if (!Array.isArray(object.conversations)) @@ -15310,6 +15289,7 @@ $root.proto = (function() { * @property {number} RECENT=3 RECENT value * @property {number} PUSH_NAME=4 PUSH_NAME value * @property {number} NON_BLOCKING_DATA=5 NON_BLOCKING_DATA value + * @property {number} ON_DEMAND=6 ON_DEMAND value */ HistorySync.HistorySyncType = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -15319,6 +15299,7 @@ $root.proto = (function() { values[valuesById[3] = "RECENT"] = 3; values[valuesById[4] = "PUSH_NAME"] = 4; values[valuesById[5] = "NON_BLOCKING_DATA"] = 5; + values[valuesById[6] = "ON_DEMAND"] = 6; return values; })(); @@ -18539,6 +18520,13 @@ $root.proto = (function() { * @property {proto.Message.IEncReactionMessage|null} [encReactionMessage] Message encReactionMessage * @property {proto.Message.IFutureProofMessage|null} [editedMessage] Message editedMessage * @property {proto.Message.IFutureProofMessage|null} [viewOnceMessageV2Extension] Message viewOnceMessageV2Extension + * @property {proto.Message.IPollCreationMessage|null} [pollCreationMessageV2] Message pollCreationMessageV2 + * @property {proto.Message.IScheduledCallCreationMessage|null} [scheduledCallCreationMessage] Message scheduledCallCreationMessage + * @property {proto.Message.IFutureProofMessage|null} [groupMentionedMessage] Message groupMentionedMessage + * @property {proto.Message.IPinMessage|null} [pinMessage] Message pinMessage + * @property {proto.Message.IPollCreationMessage|null} [pollCreationMessageV3] Message pollCreationMessageV3 + * @property {proto.Message.IScheduledCallEditMessage|null} [scheduledCallEditMessage] Message scheduledCallEditMessage + * @property {proto.Message.IVideoMessage|null} [ptvMessage] Message ptvMessage */ /** @@ -18948,6 +18936,62 @@ $root.proto = (function() { */ Message.prototype.viewOnceMessageV2Extension = null; + /** + * Message pollCreationMessageV2. + * @member {proto.Message.IPollCreationMessage|null|undefined} pollCreationMessageV2 + * @memberof proto.Message + * @instance + */ + Message.prototype.pollCreationMessageV2 = null; + + /** + * Message scheduledCallCreationMessage. + * @member {proto.Message.IScheduledCallCreationMessage|null|undefined} scheduledCallCreationMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.scheduledCallCreationMessage = null; + + /** + * Message groupMentionedMessage. + * @member {proto.Message.IFutureProofMessage|null|undefined} groupMentionedMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.groupMentionedMessage = null; + + /** + * Message pinMessage. + * @member {proto.Message.IPinMessage|null|undefined} pinMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.pinMessage = null; + + /** + * Message pollCreationMessageV3. + * @member {proto.Message.IPollCreationMessage|null|undefined} pollCreationMessageV3 + * @memberof proto.Message + * @instance + */ + Message.prototype.pollCreationMessageV3 = null; + + /** + * Message scheduledCallEditMessage. + * @member {proto.Message.IScheduledCallEditMessage|null|undefined} scheduledCallEditMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.scheduledCallEditMessage = null; + + /** + * Message ptvMessage. + * @member {proto.Message.IVideoMessage|null|undefined} ptvMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.ptvMessage = null; + /** * Creates a new Message instance using the specified properties. * @function create @@ -19070,6 +19114,20 @@ $root.proto = (function() { $root.proto.Message.FutureProofMessage.encode(message.editedMessage, writer.uint32(/* id 58, wireType 2 =*/466).fork()).ldelim(); if (message.viewOnceMessageV2Extension != null && Object.hasOwnProperty.call(message, "viewOnceMessageV2Extension")) $root.proto.Message.FutureProofMessage.encode(message.viewOnceMessageV2Extension, writer.uint32(/* id 59, wireType 2 =*/474).fork()).ldelim(); + if (message.pollCreationMessageV2 != null && Object.hasOwnProperty.call(message, "pollCreationMessageV2")) + $root.proto.Message.PollCreationMessage.encode(message.pollCreationMessageV2, writer.uint32(/* id 60, wireType 2 =*/482).fork()).ldelim(); + if (message.scheduledCallCreationMessage != null && Object.hasOwnProperty.call(message, "scheduledCallCreationMessage")) + $root.proto.Message.ScheduledCallCreationMessage.encode(message.scheduledCallCreationMessage, writer.uint32(/* id 61, wireType 2 =*/490).fork()).ldelim(); + if (message.groupMentionedMessage != null && Object.hasOwnProperty.call(message, "groupMentionedMessage")) + $root.proto.Message.FutureProofMessage.encode(message.groupMentionedMessage, writer.uint32(/* id 62, wireType 2 =*/498).fork()).ldelim(); + if (message.pinMessage != null && Object.hasOwnProperty.call(message, "pinMessage")) + $root.proto.Message.PinMessage.encode(message.pinMessage, writer.uint32(/* id 63, wireType 2 =*/506).fork()).ldelim(); + if (message.pollCreationMessageV3 != null && Object.hasOwnProperty.call(message, "pollCreationMessageV3")) + $root.proto.Message.PollCreationMessage.encode(message.pollCreationMessageV3, writer.uint32(/* id 64, wireType 2 =*/514).fork()).ldelim(); + if (message.scheduledCallEditMessage != null && Object.hasOwnProperty.call(message, "scheduledCallEditMessage")) + $root.proto.Message.ScheduledCallEditMessage.encode(message.scheduledCallEditMessage, writer.uint32(/* id 65, wireType 2 =*/522).fork()).ldelim(); + if (message.ptvMessage != null && Object.hasOwnProperty.call(message, "ptvMessage")) + $root.proto.Message.VideoMessage.encode(message.ptvMessage, writer.uint32(/* id 66, wireType 2 =*/530).fork()).ldelim(); return writer; }; @@ -19251,6 +19309,27 @@ $root.proto = (function() { case 59: message.viewOnceMessageV2Extension = $root.proto.Message.FutureProofMessage.decode(reader, reader.uint32()); break; + case 60: + message.pollCreationMessageV2 = $root.proto.Message.PollCreationMessage.decode(reader, reader.uint32()); + break; + case 61: + message.scheduledCallCreationMessage = $root.proto.Message.ScheduledCallCreationMessage.decode(reader, reader.uint32()); + break; + case 62: + message.groupMentionedMessage = $root.proto.Message.FutureProofMessage.decode(reader, reader.uint32()); + break; + case 63: + message.pinMessage = $root.proto.Message.PinMessage.decode(reader, reader.uint32()); + break; + case 64: + message.pollCreationMessageV3 = $root.proto.Message.PollCreationMessage.decode(reader, reader.uint32()); + break; + case 65: + message.scheduledCallEditMessage = $root.proto.Message.ScheduledCallEditMessage.decode(reader, reader.uint32()); + break; + case 66: + message.ptvMessage = $root.proto.Message.VideoMessage.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -19529,6 +19608,41 @@ $root.proto = (function() { if (error) return "viewOnceMessageV2Extension." + error; } + if (message.pollCreationMessageV2 != null && message.hasOwnProperty("pollCreationMessageV2")) { + var error = $root.proto.Message.PollCreationMessage.verify(message.pollCreationMessageV2); + if (error) + return "pollCreationMessageV2." + error; + } + if (message.scheduledCallCreationMessage != null && message.hasOwnProperty("scheduledCallCreationMessage")) { + var error = $root.proto.Message.ScheduledCallCreationMessage.verify(message.scheduledCallCreationMessage); + if (error) + return "scheduledCallCreationMessage." + error; + } + if (message.groupMentionedMessage != null && message.hasOwnProperty("groupMentionedMessage")) { + var error = $root.proto.Message.FutureProofMessage.verify(message.groupMentionedMessage); + if (error) + return "groupMentionedMessage." + error; + } + if (message.pinMessage != null && message.hasOwnProperty("pinMessage")) { + var error = $root.proto.Message.PinMessage.verify(message.pinMessage); + if (error) + return "pinMessage." + error; + } + if (message.pollCreationMessageV3 != null && message.hasOwnProperty("pollCreationMessageV3")) { + var error = $root.proto.Message.PollCreationMessage.verify(message.pollCreationMessageV3); + if (error) + return "pollCreationMessageV3." + error; + } + if (message.scheduledCallEditMessage != null && message.hasOwnProperty("scheduledCallEditMessage")) { + var error = $root.proto.Message.ScheduledCallEditMessage.verify(message.scheduledCallEditMessage); + if (error) + return "scheduledCallEditMessage." + error; + } + if (message.ptvMessage != null && message.hasOwnProperty("ptvMessage")) { + var error = $root.proto.Message.VideoMessage.verify(message.ptvMessage); + if (error) + return "ptvMessage." + error; + } return null; }; @@ -19786,6 +19900,41 @@ $root.proto = (function() { throw TypeError(".proto.Message.viewOnceMessageV2Extension: object expected"); message.viewOnceMessageV2Extension = $root.proto.Message.FutureProofMessage.fromObject(object.viewOnceMessageV2Extension); } + if (object.pollCreationMessageV2 != null) { + if (typeof object.pollCreationMessageV2 !== "object") + throw TypeError(".proto.Message.pollCreationMessageV2: object expected"); + message.pollCreationMessageV2 = $root.proto.Message.PollCreationMessage.fromObject(object.pollCreationMessageV2); + } + if (object.scheduledCallCreationMessage != null) { + if (typeof object.scheduledCallCreationMessage !== "object") + throw TypeError(".proto.Message.scheduledCallCreationMessage: object expected"); + message.scheduledCallCreationMessage = $root.proto.Message.ScheduledCallCreationMessage.fromObject(object.scheduledCallCreationMessage); + } + if (object.groupMentionedMessage != null) { + if (typeof object.groupMentionedMessage !== "object") + throw TypeError(".proto.Message.groupMentionedMessage: object expected"); + message.groupMentionedMessage = $root.proto.Message.FutureProofMessage.fromObject(object.groupMentionedMessage); + } + if (object.pinMessage != null) { + if (typeof object.pinMessage !== "object") + throw TypeError(".proto.Message.pinMessage: object expected"); + message.pinMessage = $root.proto.Message.PinMessage.fromObject(object.pinMessage); + } + if (object.pollCreationMessageV3 != null) { + if (typeof object.pollCreationMessageV3 !== "object") + throw TypeError(".proto.Message.pollCreationMessageV3: object expected"); + message.pollCreationMessageV3 = $root.proto.Message.PollCreationMessage.fromObject(object.pollCreationMessageV3); + } + if (object.scheduledCallEditMessage != null) { + if (typeof object.scheduledCallEditMessage !== "object") + throw TypeError(".proto.Message.scheduledCallEditMessage: object expected"); + message.scheduledCallEditMessage = $root.proto.Message.ScheduledCallEditMessage.fromObject(object.scheduledCallEditMessage); + } + if (object.ptvMessage != null) { + if (typeof object.ptvMessage !== "object") + throw TypeError(".proto.Message.ptvMessage: object expected"); + message.ptvMessage = $root.proto.Message.VideoMessage.fromObject(object.ptvMessage); + } return message; }; @@ -19852,6 +20001,13 @@ $root.proto = (function() { object.encReactionMessage = null; object.editedMessage = null; object.viewOnceMessageV2Extension = null; + object.pollCreationMessageV2 = null; + object.scheduledCallCreationMessage = null; + object.groupMentionedMessage = null; + object.pinMessage = null; + object.pollCreationMessageV3 = null; + object.scheduledCallEditMessage = null; + object.ptvMessage = null; } if (message.conversation != null && message.hasOwnProperty("conversation")) object.conversation = message.conversation; @@ -19951,6 +20107,20 @@ $root.proto = (function() { object.editedMessage = $root.proto.Message.FutureProofMessage.toObject(message.editedMessage, options); if (message.viewOnceMessageV2Extension != null && message.hasOwnProperty("viewOnceMessageV2Extension")) object.viewOnceMessageV2Extension = $root.proto.Message.FutureProofMessage.toObject(message.viewOnceMessageV2Extension, options); + if (message.pollCreationMessageV2 != null && message.hasOwnProperty("pollCreationMessageV2")) + object.pollCreationMessageV2 = $root.proto.Message.PollCreationMessage.toObject(message.pollCreationMessageV2, options); + if (message.scheduledCallCreationMessage != null && message.hasOwnProperty("scheduledCallCreationMessage")) + object.scheduledCallCreationMessage = $root.proto.Message.ScheduledCallCreationMessage.toObject(message.scheduledCallCreationMessage, options); + if (message.groupMentionedMessage != null && message.hasOwnProperty("groupMentionedMessage")) + object.groupMentionedMessage = $root.proto.Message.FutureProofMessage.toObject(message.groupMentionedMessage, options); + if (message.pinMessage != null && message.hasOwnProperty("pinMessage")) + object.pinMessage = $root.proto.Message.PinMessage.toObject(message.pinMessage, options); + if (message.pollCreationMessageV3 != null && message.hasOwnProperty("pollCreationMessageV3")) + object.pollCreationMessageV3 = $root.proto.Message.PollCreationMessage.toObject(message.pollCreationMessageV3, options); + if (message.scheduledCallEditMessage != null && message.hasOwnProperty("scheduledCallEditMessage")) + object.scheduledCallEditMessage = $root.proto.Message.ScheduledCallEditMessage.toObject(message.scheduledCallEditMessage, options); + if (message.ptvMessage != null && message.hasOwnProperty("ptvMessage")) + object.ptvMessage = $root.proto.Message.VideoMessage.toObject(message.ptvMessage, options); return object; }; @@ -21574,6 +21744,7 @@ $root.proto = (function() { * @property {Uint8Array|null} [streamingSidecar] AudioMessage streamingSidecar * @property {Uint8Array|null} [waveform] AudioMessage waveform * @property {number|null} [backgroundArgb] AudioMessage backgroundArgb + * @property {boolean|null} [viewOnce] AudioMessage viewOnce */ /** @@ -21703,6 +21874,14 @@ $root.proto = (function() { */ AudioMessage.prototype.backgroundArgb = 0; + /** + * AudioMessage viewOnce. + * @member {boolean} viewOnce + * @memberof proto.Message.AudioMessage + * @instance + */ + AudioMessage.prototype.viewOnce = false; + /** * Creates a new AudioMessage instance using the specified properties. * @function create @@ -21755,6 +21934,8 @@ $root.proto = (function() { writer.uint32(/* id 19, wireType 2 =*/154).bytes(message.waveform); if (message.backgroundArgb != null && Object.hasOwnProperty.call(message, "backgroundArgb")) writer.uint32(/* id 20, wireType 5 =*/165).fixed32(message.backgroundArgb); + if (message.viewOnce != null && Object.hasOwnProperty.call(message, "viewOnce")) + writer.uint32(/* id 21, wireType 0 =*/168).bool(message.viewOnce); return writer; }; @@ -21831,6 +22012,9 @@ $root.proto = (function() { case 20: message.backgroundArgb = reader.fixed32(); break; + case 21: + message.viewOnce = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -21910,6 +22094,9 @@ $root.proto = (function() { if (message.backgroundArgb != null && message.hasOwnProperty("backgroundArgb")) if (!$util.isInteger(message.backgroundArgb)) return "backgroundArgb: integer expected"; + if (message.viewOnce != null && message.hasOwnProperty("viewOnce")) + if (typeof message.viewOnce !== "boolean") + return "viewOnce: boolean expected"; return null; }; @@ -21985,6 +22172,8 @@ $root.proto = (function() { message.waveform = object.waveform; if (object.backgroundArgb != null) message.backgroundArgb = object.backgroundArgb >>> 0; + if (object.viewOnce != null) + message.viewOnce = Boolean(object.viewOnce); return message; }; @@ -22054,6 +22243,7 @@ $root.proto = (function() { object.waveform = $util.newBuffer(object.waveform); } object.backgroundArgb = 0; + object.viewOnce = false; } if (message.url != null && message.hasOwnProperty("url")) object.url = message.url; @@ -22089,6 +22279,8 @@ $root.proto = (function() { object.waveform = options.bytes === String ? $util.base64.encode(message.waveform, 0, message.waveform.length) : options.bytes === Array ? Array.prototype.slice.call(message.waveform) : message.waveform; if (message.backgroundArgb != null && message.hasOwnProperty("backgroundArgb")) object.backgroundArgb = message.backgroundArgb; + if (message.viewOnce != null && message.hasOwnProperty("viewOnce")) + object.viewOnce = message.viewOnce; return object; }; @@ -26678,6 +26870,11 @@ $root.proto = (function() { case 3: case 4: case 5: + case 6: + case 7: + case 8: + case 9: + case 10: break; } if (message.previewType != null && message.hasOwnProperty("previewType")) @@ -26803,6 +27000,26 @@ $root.proto = (function() { case 5: message.font = 5; break; + case "DAMION_REGULAR": + case 6: + message.font = 6; + break; + case "MORNINGBREEZE_REGULAR": + case 7: + message.font = 7; + break; + case "CALISTOGA_REGULAR": + case 8: + message.font = 8; + break; + case "EXO2_EXTRABOLD": + case 9: + message.font = 9; + break; + case "COURIERPRIME_BOLD": + case 10: + message.font = 10; + break; } switch (object.previewType) { case "NONE": @@ -27052,6 +27269,11 @@ $root.proto = (function() { * @property {number} BRYNDAN_WRITE=3 BRYNDAN_WRITE value * @property {number} BEBASNEUE_REGULAR=4 BEBASNEUE_REGULAR value * @property {number} OSWALD_HEAVY=5 OSWALD_HEAVY value + * @property {number} DAMION_REGULAR=6 DAMION_REGULAR value + * @property {number} MORNINGBREEZE_REGULAR=7 MORNINGBREEZE_REGULAR value + * @property {number} CALISTOGA_REGULAR=8 CALISTOGA_REGULAR value + * @property {number} EXO2_EXTRABOLD=9 EXO2_EXTRABOLD value + * @property {number} COURIERPRIME_BOLD=10 COURIERPRIME_BOLD value */ ExtendedTextMessage.FontType = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -27061,6 +27283,11 @@ $root.proto = (function() { values[valuesById[3] = "BRYNDAN_WRITE"] = 3; values[valuesById[4] = "BEBASNEUE_REGULAR"] = 4; values[valuesById[5] = "OSWALD_HEAVY"] = 5; + values[valuesById[6] = "DAMION_REGULAR"] = 6; + values[valuesById[7] = "MORNINGBREEZE_REGULAR"] = 7; + values[valuesById[8] = "CALISTOGA_REGULAR"] = 8; + values[valuesById[9] = "EXO2_EXTRABOLD"] = 9; + values[valuesById[10] = "COURIERPRIME_BOLD"] = 10; return values; })(); @@ -29724,6 +29951,7 @@ $root.proto = (function() { case 3: case 4: case 5: + case 6: break; } if (message.chunkOrder != null && message.hasOwnProperty("chunkOrder")) @@ -29804,6 +30032,10 @@ $root.proto = (function() { case 5: message.syncType = 5; break; + case "ON_DEMAND": + case 6: + message.syncType = 6; + break; } if (object.chunkOrder != null) message.chunkOrder = object.chunkOrder >>> 0; @@ -29924,6 +30156,7 @@ $root.proto = (function() { * @property {number} RECENT=3 RECENT value * @property {number} PUSH_NAME=4 PUSH_NAME value * @property {number} NON_BLOCKING_DATA=5 NON_BLOCKING_DATA value + * @property {number} ON_DEMAND=6 ON_DEMAND value */ HistorySyncNotification.HistorySyncType = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -29933,6 +30166,7 @@ $root.proto = (function() { values[valuesById[3] = "RECENT"] = 3; values[valuesById[4] = "PUSH_NAME"] = 4; values[valuesById[5] = "NON_BLOCKING_DATA"] = 5; + values[valuesById[6] = "ON_DEMAND"] = 6; return values; })(); @@ -38456,6 +38690,7 @@ $root.proto = (function() { * @property {proto.Message.PeerDataOperationRequestType|null} [peerDataOperationRequestType] PeerDataOperationRequestMessage peerDataOperationRequestType * @property {Array.|null} [requestStickerReupload] PeerDataOperationRequestMessage requestStickerReupload * @property {Array.|null} [requestUrlPreview] PeerDataOperationRequestMessage requestUrlPreview + * @property {proto.Message.PeerDataOperationRequestMessage.IHistorySyncOnDemandRequest|null} [historySyncOnDemandRequest] PeerDataOperationRequestMessage historySyncOnDemandRequest */ /** @@ -38499,6 +38734,14 @@ $root.proto = (function() { */ PeerDataOperationRequestMessage.prototype.requestUrlPreview = $util.emptyArray; + /** + * PeerDataOperationRequestMessage historySyncOnDemandRequest. + * @member {proto.Message.PeerDataOperationRequestMessage.IHistorySyncOnDemandRequest|null|undefined} historySyncOnDemandRequest + * @memberof proto.Message.PeerDataOperationRequestMessage + * @instance + */ + PeerDataOperationRequestMessage.prototype.historySyncOnDemandRequest = null; + /** * Creates a new PeerDataOperationRequestMessage instance using the specified properties. * @function create @@ -38531,6 +38774,8 @@ $root.proto = (function() { if (message.requestUrlPreview != null && message.requestUrlPreview.length) for (var i = 0; i < message.requestUrlPreview.length; ++i) $root.proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview.encode(message.requestUrlPreview[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.historySyncOnDemandRequest != null && Object.hasOwnProperty.call(message, "historySyncOnDemandRequest")) + $root.proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest.encode(message.historySyncOnDemandRequest, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -38578,6 +38823,9 @@ $root.proto = (function() { message.requestUrlPreview = []; message.requestUrlPreview.push($root.proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview.decode(reader, reader.uint32())); break; + case 4: + message.historySyncOnDemandRequest = $root.proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -38620,6 +38868,7 @@ $root.proto = (function() { case 0: case 1: case 2: + case 3: break; } if (message.requestStickerReupload != null && message.hasOwnProperty("requestStickerReupload")) { @@ -38640,6 +38889,11 @@ $root.proto = (function() { return "requestUrlPreview." + error; } } + if (message.historySyncOnDemandRequest != null && message.hasOwnProperty("historySyncOnDemandRequest")) { + var error = $root.proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest.verify(message.historySyncOnDemandRequest); + if (error) + return "historySyncOnDemandRequest." + error; + } return null; }; @@ -38668,6 +38922,10 @@ $root.proto = (function() { case 2: message.peerDataOperationRequestType = 2; break; + case "HISTORY_SYNC_ON_DEMAND": + case 3: + message.peerDataOperationRequestType = 3; + break; } if (object.requestStickerReupload) { if (!Array.isArray(object.requestStickerReupload)) @@ -38689,6 +38947,11 @@ $root.proto = (function() { message.requestUrlPreview[i] = $root.proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview.fromObject(object.requestUrlPreview[i]); } } + if (object.historySyncOnDemandRequest != null) { + if (typeof object.historySyncOnDemandRequest !== "object") + throw TypeError(".proto.Message.PeerDataOperationRequestMessage.historySyncOnDemandRequest: object expected"); + message.historySyncOnDemandRequest = $root.proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest.fromObject(object.historySyncOnDemandRequest); + } return message; }; @@ -38709,8 +38972,10 @@ $root.proto = (function() { object.requestStickerReupload = []; object.requestUrlPreview = []; } - if (options.defaults) + if (options.defaults) { object.peerDataOperationRequestType = options.enums === String ? "UPLOAD_STICKER" : 0; + object.historySyncOnDemandRequest = null; + } if (message.peerDataOperationRequestType != null && message.hasOwnProperty("peerDataOperationRequestType")) object.peerDataOperationRequestType = options.enums === String ? $root.proto.Message.PeerDataOperationRequestType[message.peerDataOperationRequestType] : message.peerDataOperationRequestType; if (message.requestStickerReupload && message.requestStickerReupload.length) { @@ -38723,6 +38988,8 @@ $root.proto = (function() { for (var j = 0; j < message.requestUrlPreview.length; ++j) object.requestUrlPreview[j] = $root.proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview.toObject(message.requestUrlPreview[j], options); } + if (message.historySyncOnDemandRequest != null && message.hasOwnProperty("historySyncOnDemandRequest")) + object.historySyncOnDemandRequest = $root.proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest.toObject(message.historySyncOnDemandRequest, options); return object; }; @@ -38737,6 +39004,296 @@ $root.proto = (function() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + PeerDataOperationRequestMessage.HistorySyncOnDemandRequest = (function() { + + /** + * Properties of a HistorySyncOnDemandRequest. + * @memberof proto.Message.PeerDataOperationRequestMessage + * @interface IHistorySyncOnDemandRequest + * @property {string|null} [chatJid] HistorySyncOnDemandRequest chatJid + * @property {string|null} [oldestMsgId] HistorySyncOnDemandRequest oldestMsgId + * @property {boolean|null} [oldestMsgFromMe] HistorySyncOnDemandRequest oldestMsgFromMe + * @property {number|null} [onDemandMsgCount] HistorySyncOnDemandRequest onDemandMsgCount + * @property {number|Long|null} [oldestMsgTimestampMs] HistorySyncOnDemandRequest oldestMsgTimestampMs + */ + + /** + * Constructs a new HistorySyncOnDemandRequest. + * @memberof proto.Message.PeerDataOperationRequestMessage + * @classdesc Represents a HistorySyncOnDemandRequest. + * @implements IHistorySyncOnDemandRequest + * @constructor + * @param {proto.Message.PeerDataOperationRequestMessage.IHistorySyncOnDemandRequest=} [properties] Properties to set + */ + function HistorySyncOnDemandRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HistorySyncOnDemandRequest chatJid. + * @member {string} chatJid + * @memberof proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest + * @instance + */ + HistorySyncOnDemandRequest.prototype.chatJid = ""; + + /** + * HistorySyncOnDemandRequest oldestMsgId. + * @member {string} oldestMsgId + * @memberof proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest + * @instance + */ + HistorySyncOnDemandRequest.prototype.oldestMsgId = ""; + + /** + * HistorySyncOnDemandRequest oldestMsgFromMe. + * @member {boolean} oldestMsgFromMe + * @memberof proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest + * @instance + */ + HistorySyncOnDemandRequest.prototype.oldestMsgFromMe = false; + + /** + * HistorySyncOnDemandRequest onDemandMsgCount. + * @member {number} onDemandMsgCount + * @memberof proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest + * @instance + */ + HistorySyncOnDemandRequest.prototype.onDemandMsgCount = 0; + + /** + * HistorySyncOnDemandRequest oldestMsgTimestampMs. + * @member {number|Long} oldestMsgTimestampMs + * @memberof proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest + * @instance + */ + HistorySyncOnDemandRequest.prototype.oldestMsgTimestampMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new HistorySyncOnDemandRequest instance using the specified properties. + * @function create + * @memberof proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest + * @static + * @param {proto.Message.PeerDataOperationRequestMessage.IHistorySyncOnDemandRequest=} [properties] Properties to set + * @returns {proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest} HistorySyncOnDemandRequest instance + */ + HistorySyncOnDemandRequest.create = function create(properties) { + return new HistorySyncOnDemandRequest(properties); + }; + + /** + * Encodes the specified HistorySyncOnDemandRequest message. Does not implicitly {@link proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest.verify|verify} messages. + * @function encode + * @memberof proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest + * @static + * @param {proto.Message.PeerDataOperationRequestMessage.IHistorySyncOnDemandRequest} message HistorySyncOnDemandRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HistorySyncOnDemandRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.chatJid != null && Object.hasOwnProperty.call(message, "chatJid")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.chatJid); + if (message.oldestMsgId != null && Object.hasOwnProperty.call(message, "oldestMsgId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.oldestMsgId); + if (message.oldestMsgFromMe != null && Object.hasOwnProperty.call(message, "oldestMsgFromMe")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.oldestMsgFromMe); + if (message.onDemandMsgCount != null && Object.hasOwnProperty.call(message, "onDemandMsgCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.onDemandMsgCount); + if (message.oldestMsgTimestampMs != null && Object.hasOwnProperty.call(message, "oldestMsgTimestampMs")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.oldestMsgTimestampMs); + return writer; + }; + + /** + * Encodes the specified HistorySyncOnDemandRequest message, length delimited. Does not implicitly {@link proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest + * @static + * @param {proto.Message.PeerDataOperationRequestMessage.IHistorySyncOnDemandRequest} message HistorySyncOnDemandRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HistorySyncOnDemandRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HistorySyncOnDemandRequest message from the specified reader or buffer. + * @function decode + * @memberof proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest} HistorySyncOnDemandRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HistorySyncOnDemandRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chatJid = reader.string(); + break; + case 2: + message.oldestMsgId = reader.string(); + break; + case 3: + message.oldestMsgFromMe = reader.bool(); + break; + case 4: + message.onDemandMsgCount = reader.int32(); + break; + case 5: + message.oldestMsgTimestampMs = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HistorySyncOnDemandRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest} HistorySyncOnDemandRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HistorySyncOnDemandRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HistorySyncOnDemandRequest message. + * @function verify + * @memberof proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HistorySyncOnDemandRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.chatJid != null && message.hasOwnProperty("chatJid")) + if (!$util.isString(message.chatJid)) + return "chatJid: string expected"; + if (message.oldestMsgId != null && message.hasOwnProperty("oldestMsgId")) + if (!$util.isString(message.oldestMsgId)) + return "oldestMsgId: string expected"; + if (message.oldestMsgFromMe != null && message.hasOwnProperty("oldestMsgFromMe")) + if (typeof message.oldestMsgFromMe !== "boolean") + return "oldestMsgFromMe: boolean expected"; + if (message.onDemandMsgCount != null && message.hasOwnProperty("onDemandMsgCount")) + if (!$util.isInteger(message.onDemandMsgCount)) + return "onDemandMsgCount: integer expected"; + if (message.oldestMsgTimestampMs != null && message.hasOwnProperty("oldestMsgTimestampMs")) + if (!$util.isInteger(message.oldestMsgTimestampMs) && !(message.oldestMsgTimestampMs && $util.isInteger(message.oldestMsgTimestampMs.low) && $util.isInteger(message.oldestMsgTimestampMs.high))) + return "oldestMsgTimestampMs: integer|Long expected"; + return null; + }; + + /** + * Creates a HistorySyncOnDemandRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest + * @static + * @param {Object.} object Plain object + * @returns {proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest} HistorySyncOnDemandRequest + */ + HistorySyncOnDemandRequest.fromObject = function fromObject(object) { + if (object instanceof $root.proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest) + return object; + var message = new $root.proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest(); + if (object.chatJid != null) + message.chatJid = String(object.chatJid); + if (object.oldestMsgId != null) + message.oldestMsgId = String(object.oldestMsgId); + if (object.oldestMsgFromMe != null) + message.oldestMsgFromMe = Boolean(object.oldestMsgFromMe); + if (object.onDemandMsgCount != null) + message.onDemandMsgCount = object.onDemandMsgCount | 0; + if (object.oldestMsgTimestampMs != null) + if ($util.Long) + (message.oldestMsgTimestampMs = $util.Long.fromValue(object.oldestMsgTimestampMs)).unsigned = false; + else if (typeof object.oldestMsgTimestampMs === "string") + message.oldestMsgTimestampMs = parseInt(object.oldestMsgTimestampMs, 10); + else if (typeof object.oldestMsgTimestampMs === "number") + message.oldestMsgTimestampMs = object.oldestMsgTimestampMs; + else if (typeof object.oldestMsgTimestampMs === "object") + message.oldestMsgTimestampMs = new $util.LongBits(object.oldestMsgTimestampMs.low >>> 0, object.oldestMsgTimestampMs.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a HistorySyncOnDemandRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest + * @static + * @param {proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest} message HistorySyncOnDemandRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HistorySyncOnDemandRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.chatJid = ""; + object.oldestMsgId = ""; + object.oldestMsgFromMe = false; + object.onDemandMsgCount = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.oldestMsgTimestampMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.oldestMsgTimestampMs = options.longs === String ? "0" : 0; + } + if (message.chatJid != null && message.hasOwnProperty("chatJid")) + object.chatJid = message.chatJid; + if (message.oldestMsgId != null && message.hasOwnProperty("oldestMsgId")) + object.oldestMsgId = message.oldestMsgId; + if (message.oldestMsgFromMe != null && message.hasOwnProperty("oldestMsgFromMe")) + object.oldestMsgFromMe = message.oldestMsgFromMe; + if (message.onDemandMsgCount != null && message.hasOwnProperty("onDemandMsgCount")) + object.onDemandMsgCount = message.onDemandMsgCount; + if (message.oldestMsgTimestampMs != null && message.hasOwnProperty("oldestMsgTimestampMs")) + if (typeof message.oldestMsgTimestampMs === "number") + object.oldestMsgTimestampMs = options.longs === String ? String(message.oldestMsgTimestampMs) : message.oldestMsgTimestampMs; + else + object.oldestMsgTimestampMs = options.longs === String ? $util.Long.prototype.toString.call(message.oldestMsgTimestampMs) : options.longs === Number ? new $util.LongBits(message.oldestMsgTimestampMs.low >>> 0, message.oldestMsgTimestampMs.high >>> 0).toNumber() : message.oldestMsgTimestampMs; + return object; + }; + + /** + * Converts this HistorySyncOnDemandRequest to JSON. + * @function toJSON + * @memberof proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest + * @instance + * @returns {Object.} JSON object + */ + HistorySyncOnDemandRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HistorySyncOnDemandRequest; + })(); + PeerDataOperationRequestMessage.RequestStickerReupload = (function() { /** @@ -39283,6 +39840,7 @@ $root.proto = (function() { case 0: case 1: case 2: + case 3: break; } if (message.stanzaId != null && message.hasOwnProperty("stanzaId")) @@ -39325,6 +39883,10 @@ $root.proto = (function() { case 2: message.peerDataOperationRequestType = 2; break; + case "HISTORY_SYNC_ON_DEMAND": + case 3: + message.peerDataOperationRequestType = 3; + break; } if (object.stanzaId != null) message.stanzaId = String(object.stanzaId); @@ -39987,15 +40549,302 @@ $root.proto = (function() { * @property {number} UPLOAD_STICKER=0 UPLOAD_STICKER value * @property {number} SEND_RECENT_STICKER_BOOTSTRAP=1 SEND_RECENT_STICKER_BOOTSTRAP value * @property {number} GENERATE_LINK_PREVIEW=2 GENERATE_LINK_PREVIEW value + * @property {number} HISTORY_SYNC_ON_DEMAND=3 HISTORY_SYNC_ON_DEMAND value */ Message.PeerDataOperationRequestType = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "UPLOAD_STICKER"] = 0; values[valuesById[1] = "SEND_RECENT_STICKER_BOOTSTRAP"] = 1; values[valuesById[2] = "GENERATE_LINK_PREVIEW"] = 2; + values[valuesById[3] = "HISTORY_SYNC_ON_DEMAND"] = 3; return values; })(); + Message.PinMessage = (function() { + + /** + * Properties of a PinMessage. + * @memberof proto.Message + * @interface IPinMessage + * @property {proto.IMessageKey|null} [key] PinMessage key + * @property {proto.Message.PinMessage.PinMessageType|null} [pinMessageType] PinMessage pinMessageType + * @property {number|Long|null} [senderTimestampMs] PinMessage senderTimestampMs + */ + + /** + * Constructs a new PinMessage. + * @memberof proto.Message + * @classdesc Represents a PinMessage. + * @implements IPinMessage + * @constructor + * @param {proto.Message.IPinMessage=} [properties] Properties to set + */ + function PinMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PinMessage key. + * @member {proto.IMessageKey|null|undefined} key + * @memberof proto.Message.PinMessage + * @instance + */ + PinMessage.prototype.key = null; + + /** + * PinMessage pinMessageType. + * @member {proto.Message.PinMessage.PinMessageType} pinMessageType + * @memberof proto.Message.PinMessage + * @instance + */ + PinMessage.prototype.pinMessageType = 0; + + /** + * PinMessage senderTimestampMs. + * @member {number|Long} senderTimestampMs + * @memberof proto.Message.PinMessage + * @instance + */ + PinMessage.prototype.senderTimestampMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new PinMessage instance using the specified properties. + * @function create + * @memberof proto.Message.PinMessage + * @static + * @param {proto.Message.IPinMessage=} [properties] Properties to set + * @returns {proto.Message.PinMessage} PinMessage instance + */ + PinMessage.create = function create(properties) { + return new PinMessage(properties); + }; + + /** + * Encodes the specified PinMessage message. Does not implicitly {@link proto.Message.PinMessage.verify|verify} messages. + * @function encode + * @memberof proto.Message.PinMessage + * @static + * @param {proto.Message.IPinMessage} message PinMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PinMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + $root.proto.MessageKey.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pinMessageType != null && Object.hasOwnProperty.call(message, "pinMessageType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pinMessageType); + if (message.senderTimestampMs != null && Object.hasOwnProperty.call(message, "senderTimestampMs")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.senderTimestampMs); + return writer; + }; + + /** + * Encodes the specified PinMessage message, length delimited. Does not implicitly {@link proto.Message.PinMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.Message.PinMessage + * @static + * @param {proto.Message.IPinMessage} message PinMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PinMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PinMessage message from the specified reader or buffer. + * @function decode + * @memberof proto.Message.PinMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.Message.PinMessage} PinMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PinMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Message.PinMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = $root.proto.MessageKey.decode(reader, reader.uint32()); + break; + case 2: + message.pinMessageType = reader.int32(); + break; + case 3: + message.senderTimestampMs = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PinMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.Message.PinMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.Message.PinMessage} PinMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PinMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PinMessage message. + * @function verify + * @memberof proto.Message.PinMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PinMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) { + var error = $root.proto.MessageKey.verify(message.key); + if (error) + return "key." + error; + } + if (message.pinMessageType != null && message.hasOwnProperty("pinMessageType")) + switch (message.pinMessageType) { + default: + return "pinMessageType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.senderTimestampMs != null && message.hasOwnProperty("senderTimestampMs")) + if (!$util.isInteger(message.senderTimestampMs) && !(message.senderTimestampMs && $util.isInteger(message.senderTimestampMs.low) && $util.isInteger(message.senderTimestampMs.high))) + return "senderTimestampMs: integer|Long expected"; + return null; + }; + + /** + * Creates a PinMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.Message.PinMessage + * @static + * @param {Object.} object Plain object + * @returns {proto.Message.PinMessage} PinMessage + */ + PinMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.Message.PinMessage) + return object; + var message = new $root.proto.Message.PinMessage(); + if (object.key != null) { + if (typeof object.key !== "object") + throw TypeError(".proto.Message.PinMessage.key: object expected"); + message.key = $root.proto.MessageKey.fromObject(object.key); + } + switch (object.pinMessageType) { + case "UNKNOWN_PIN_MESSAGE_TYPE": + case 0: + message.pinMessageType = 0; + break; + case "PIN_FOR_ALL": + case 1: + message.pinMessageType = 1; + break; + case "UNPIN_FOR_ALL": + case 2: + message.pinMessageType = 2; + break; + } + if (object.senderTimestampMs != null) + if ($util.Long) + (message.senderTimestampMs = $util.Long.fromValue(object.senderTimestampMs)).unsigned = false; + else if (typeof object.senderTimestampMs === "string") + message.senderTimestampMs = parseInt(object.senderTimestampMs, 10); + else if (typeof object.senderTimestampMs === "number") + message.senderTimestampMs = object.senderTimestampMs; + else if (typeof object.senderTimestampMs === "object") + message.senderTimestampMs = new $util.LongBits(object.senderTimestampMs.low >>> 0, object.senderTimestampMs.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a PinMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.Message.PinMessage + * @static + * @param {proto.Message.PinMessage} message PinMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PinMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.key = null; + object.pinMessageType = options.enums === String ? "UNKNOWN_PIN_MESSAGE_TYPE" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.senderTimestampMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.senderTimestampMs = options.longs === String ? "0" : 0; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = $root.proto.MessageKey.toObject(message.key, options); + if (message.pinMessageType != null && message.hasOwnProperty("pinMessageType")) + object.pinMessageType = options.enums === String ? $root.proto.Message.PinMessage.PinMessageType[message.pinMessageType] : message.pinMessageType; + if (message.senderTimestampMs != null && message.hasOwnProperty("senderTimestampMs")) + if (typeof message.senderTimestampMs === "number") + object.senderTimestampMs = options.longs === String ? String(message.senderTimestampMs) : message.senderTimestampMs; + else + object.senderTimestampMs = options.longs === String ? $util.Long.prototype.toString.call(message.senderTimestampMs) : options.longs === Number ? new $util.LongBits(message.senderTimestampMs.low >>> 0, message.senderTimestampMs.high >>> 0).toNumber() : message.senderTimestampMs; + return object; + }; + + /** + * Converts this PinMessage to JSON. + * @function toJSON + * @memberof proto.Message.PinMessage + * @instance + * @returns {Object.} JSON object + */ + PinMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * PinMessageType enum. + * @name proto.Message.PinMessage.PinMessageType + * @enum {number} + * @property {number} UNKNOWN_PIN_MESSAGE_TYPE=0 UNKNOWN_PIN_MESSAGE_TYPE value + * @property {number} PIN_FOR_ALL=1 PIN_FOR_ALL value + * @property {number} UNPIN_FOR_ALL=2 UNPIN_FOR_ALL value + */ + PinMessage.PinMessageType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN_PIN_MESSAGE_TYPE"] = 0; + values[valuesById[1] = "PIN_FOR_ALL"] = 1; + values[valuesById[2] = "UNPIN_FOR_ALL"] = 2; + return values; + })(); + + return PinMessage; + })(); + Message.PollCreationMessage = (function() { /** @@ -43847,6 +44696,528 @@ $root.proto = (function() { return RequestPhoneNumberMessage; })(); + Message.ScheduledCallCreationMessage = (function() { + + /** + * Properties of a ScheduledCallCreationMessage. + * @memberof proto.Message + * @interface IScheduledCallCreationMessage + * @property {number|Long|null} [scheduledTimestampMs] ScheduledCallCreationMessage scheduledTimestampMs + * @property {proto.Message.ScheduledCallCreationMessage.CallType|null} [callType] ScheduledCallCreationMessage callType + * @property {string|null} [title] ScheduledCallCreationMessage title + */ + + /** + * Constructs a new ScheduledCallCreationMessage. + * @memberof proto.Message + * @classdesc Represents a ScheduledCallCreationMessage. + * @implements IScheduledCallCreationMessage + * @constructor + * @param {proto.Message.IScheduledCallCreationMessage=} [properties] Properties to set + */ + function ScheduledCallCreationMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScheduledCallCreationMessage scheduledTimestampMs. + * @member {number|Long} scheduledTimestampMs + * @memberof proto.Message.ScheduledCallCreationMessage + * @instance + */ + ScheduledCallCreationMessage.prototype.scheduledTimestampMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ScheduledCallCreationMessage callType. + * @member {proto.Message.ScheduledCallCreationMessage.CallType} callType + * @memberof proto.Message.ScheduledCallCreationMessage + * @instance + */ + ScheduledCallCreationMessage.prototype.callType = 0; + + /** + * ScheduledCallCreationMessage title. + * @member {string} title + * @memberof proto.Message.ScheduledCallCreationMessage + * @instance + */ + ScheduledCallCreationMessage.prototype.title = ""; + + /** + * Creates a new ScheduledCallCreationMessage instance using the specified properties. + * @function create + * @memberof proto.Message.ScheduledCallCreationMessage + * @static + * @param {proto.Message.IScheduledCallCreationMessage=} [properties] Properties to set + * @returns {proto.Message.ScheduledCallCreationMessage} ScheduledCallCreationMessage instance + */ + ScheduledCallCreationMessage.create = function create(properties) { + return new ScheduledCallCreationMessage(properties); + }; + + /** + * Encodes the specified ScheduledCallCreationMessage message. Does not implicitly {@link proto.Message.ScheduledCallCreationMessage.verify|verify} messages. + * @function encode + * @memberof proto.Message.ScheduledCallCreationMessage + * @static + * @param {proto.Message.IScheduledCallCreationMessage} message ScheduledCallCreationMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduledCallCreationMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scheduledTimestampMs != null && Object.hasOwnProperty.call(message, "scheduledTimestampMs")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.scheduledTimestampMs); + if (message.callType != null && Object.hasOwnProperty.call(message, "callType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.callType); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.title); + return writer; + }; + + /** + * Encodes the specified ScheduledCallCreationMessage message, length delimited. Does not implicitly {@link proto.Message.ScheduledCallCreationMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.Message.ScheduledCallCreationMessage + * @static + * @param {proto.Message.IScheduledCallCreationMessage} message ScheduledCallCreationMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduledCallCreationMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScheduledCallCreationMessage message from the specified reader or buffer. + * @function decode + * @memberof proto.Message.ScheduledCallCreationMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.Message.ScheduledCallCreationMessage} ScheduledCallCreationMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduledCallCreationMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Message.ScheduledCallCreationMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.scheduledTimestampMs = reader.int64(); + break; + case 2: + message.callType = reader.int32(); + break; + case 3: + message.title = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScheduledCallCreationMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.Message.ScheduledCallCreationMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.Message.ScheduledCallCreationMessage} ScheduledCallCreationMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduledCallCreationMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScheduledCallCreationMessage message. + * @function verify + * @memberof proto.Message.ScheduledCallCreationMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScheduledCallCreationMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scheduledTimestampMs != null && message.hasOwnProperty("scheduledTimestampMs")) + if (!$util.isInteger(message.scheduledTimestampMs) && !(message.scheduledTimestampMs && $util.isInteger(message.scheduledTimestampMs.low) && $util.isInteger(message.scheduledTimestampMs.high))) + return "scheduledTimestampMs: integer|Long expected"; + if (message.callType != null && message.hasOwnProperty("callType")) + switch (message.callType) { + default: + return "callType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + return null; + }; + + /** + * Creates a ScheduledCallCreationMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.Message.ScheduledCallCreationMessage + * @static + * @param {Object.} object Plain object + * @returns {proto.Message.ScheduledCallCreationMessage} ScheduledCallCreationMessage + */ + ScheduledCallCreationMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.Message.ScheduledCallCreationMessage) + return object; + var message = new $root.proto.Message.ScheduledCallCreationMessage(); + if (object.scheduledTimestampMs != null) + if ($util.Long) + (message.scheduledTimestampMs = $util.Long.fromValue(object.scheduledTimestampMs)).unsigned = false; + else if (typeof object.scheduledTimestampMs === "string") + message.scheduledTimestampMs = parseInt(object.scheduledTimestampMs, 10); + else if (typeof object.scheduledTimestampMs === "number") + message.scheduledTimestampMs = object.scheduledTimestampMs; + else if (typeof object.scheduledTimestampMs === "object") + message.scheduledTimestampMs = new $util.LongBits(object.scheduledTimestampMs.low >>> 0, object.scheduledTimestampMs.high >>> 0).toNumber(); + switch (object.callType) { + case "UNKNOWN": + case 0: + message.callType = 0; + break; + case "VOICE": + case 1: + message.callType = 1; + break; + case "VIDEO": + case 2: + message.callType = 2; + break; + } + if (object.title != null) + message.title = String(object.title); + return message; + }; + + /** + * Creates a plain object from a ScheduledCallCreationMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.Message.ScheduledCallCreationMessage + * @static + * @param {proto.Message.ScheduledCallCreationMessage} message ScheduledCallCreationMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScheduledCallCreationMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.scheduledTimestampMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.scheduledTimestampMs = options.longs === String ? "0" : 0; + object.callType = options.enums === String ? "UNKNOWN" : 0; + object.title = ""; + } + if (message.scheduledTimestampMs != null && message.hasOwnProperty("scheduledTimestampMs")) + if (typeof message.scheduledTimestampMs === "number") + object.scheduledTimestampMs = options.longs === String ? String(message.scheduledTimestampMs) : message.scheduledTimestampMs; + else + object.scheduledTimestampMs = options.longs === String ? $util.Long.prototype.toString.call(message.scheduledTimestampMs) : options.longs === Number ? new $util.LongBits(message.scheduledTimestampMs.low >>> 0, message.scheduledTimestampMs.high >>> 0).toNumber() : message.scheduledTimestampMs; + if (message.callType != null && message.hasOwnProperty("callType")) + object.callType = options.enums === String ? $root.proto.Message.ScheduledCallCreationMessage.CallType[message.callType] : message.callType; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + return object; + }; + + /** + * Converts this ScheduledCallCreationMessage to JSON. + * @function toJSON + * @memberof proto.Message.ScheduledCallCreationMessage + * @instance + * @returns {Object.} JSON object + */ + ScheduledCallCreationMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * CallType enum. + * @name proto.Message.ScheduledCallCreationMessage.CallType + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} VOICE=1 VOICE value + * @property {number} VIDEO=2 VIDEO value + */ + ScheduledCallCreationMessage.CallType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "VOICE"] = 1; + values[valuesById[2] = "VIDEO"] = 2; + return values; + })(); + + return ScheduledCallCreationMessage; + })(); + + Message.ScheduledCallEditMessage = (function() { + + /** + * Properties of a ScheduledCallEditMessage. + * @memberof proto.Message + * @interface IScheduledCallEditMessage + * @property {proto.IMessageKey|null} [key] ScheduledCallEditMessage key + * @property {proto.Message.ScheduledCallEditMessage.EditType|null} [editType] ScheduledCallEditMessage editType + */ + + /** + * Constructs a new ScheduledCallEditMessage. + * @memberof proto.Message + * @classdesc Represents a ScheduledCallEditMessage. + * @implements IScheduledCallEditMessage + * @constructor + * @param {proto.Message.IScheduledCallEditMessage=} [properties] Properties to set + */ + function ScheduledCallEditMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScheduledCallEditMessage key. + * @member {proto.IMessageKey|null|undefined} key + * @memberof proto.Message.ScheduledCallEditMessage + * @instance + */ + ScheduledCallEditMessage.prototype.key = null; + + /** + * ScheduledCallEditMessage editType. + * @member {proto.Message.ScheduledCallEditMessage.EditType} editType + * @memberof proto.Message.ScheduledCallEditMessage + * @instance + */ + ScheduledCallEditMessage.prototype.editType = 0; + + /** + * Creates a new ScheduledCallEditMessage instance using the specified properties. + * @function create + * @memberof proto.Message.ScheduledCallEditMessage + * @static + * @param {proto.Message.IScheduledCallEditMessage=} [properties] Properties to set + * @returns {proto.Message.ScheduledCallEditMessage} ScheduledCallEditMessage instance + */ + ScheduledCallEditMessage.create = function create(properties) { + return new ScheduledCallEditMessage(properties); + }; + + /** + * Encodes the specified ScheduledCallEditMessage message. Does not implicitly {@link proto.Message.ScheduledCallEditMessage.verify|verify} messages. + * @function encode + * @memberof proto.Message.ScheduledCallEditMessage + * @static + * @param {proto.Message.IScheduledCallEditMessage} message ScheduledCallEditMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduledCallEditMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + $root.proto.MessageKey.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.editType != null && Object.hasOwnProperty.call(message, "editType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.editType); + return writer; + }; + + /** + * Encodes the specified ScheduledCallEditMessage message, length delimited. Does not implicitly {@link proto.Message.ScheduledCallEditMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.Message.ScheduledCallEditMessage + * @static + * @param {proto.Message.IScheduledCallEditMessage} message ScheduledCallEditMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduledCallEditMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScheduledCallEditMessage message from the specified reader or buffer. + * @function decode + * @memberof proto.Message.ScheduledCallEditMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.Message.ScheduledCallEditMessage} ScheduledCallEditMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduledCallEditMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Message.ScheduledCallEditMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = $root.proto.MessageKey.decode(reader, reader.uint32()); + break; + case 2: + message.editType = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScheduledCallEditMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.Message.ScheduledCallEditMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.Message.ScheduledCallEditMessage} ScheduledCallEditMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduledCallEditMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScheduledCallEditMessage message. + * @function verify + * @memberof proto.Message.ScheduledCallEditMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScheduledCallEditMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) { + var error = $root.proto.MessageKey.verify(message.key); + if (error) + return "key." + error; + } + if (message.editType != null && message.hasOwnProperty("editType")) + switch (message.editType) { + default: + return "editType: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a ScheduledCallEditMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.Message.ScheduledCallEditMessage + * @static + * @param {Object.} object Plain object + * @returns {proto.Message.ScheduledCallEditMessage} ScheduledCallEditMessage + */ + ScheduledCallEditMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.Message.ScheduledCallEditMessage) + return object; + var message = new $root.proto.Message.ScheduledCallEditMessage(); + if (object.key != null) { + if (typeof object.key !== "object") + throw TypeError(".proto.Message.ScheduledCallEditMessage.key: object expected"); + message.key = $root.proto.MessageKey.fromObject(object.key); + } + switch (object.editType) { + case "UNKNOWN": + case 0: + message.editType = 0; + break; + case "CANCEL": + case 1: + message.editType = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a ScheduledCallEditMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.Message.ScheduledCallEditMessage + * @static + * @param {proto.Message.ScheduledCallEditMessage} message ScheduledCallEditMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScheduledCallEditMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.key = null; + object.editType = options.enums === String ? "UNKNOWN" : 0; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = $root.proto.MessageKey.toObject(message.key, options); + if (message.editType != null && message.hasOwnProperty("editType")) + object.editType = options.enums === String ? $root.proto.Message.ScheduledCallEditMessage.EditType[message.editType] : message.editType; + return object; + }; + + /** + * Converts this ScheduledCallEditMessage to JSON. + * @function toJSON + * @memberof proto.Message.ScheduledCallEditMessage + * @instance + * @returns {Object.} JSON object + */ + ScheduledCallEditMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * EditType enum. + * @name proto.Message.ScheduledCallEditMessage.EditType + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} CANCEL=1 CANCEL value + */ + ScheduledCallEditMessage.EditType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "CANCEL"] = 1; + return values; + })(); + + return ScheduledCallEditMessage; + })(); + Message.SendPaymentMessage = (function() { /** @@ -48356,6 +49727,10 @@ $root.proto = (function() { * @property {number|Long|null} [senderTimestampMs] MsgOpaqueData senderTimestampMs * @property {string|null} [pollUpdateParentKey] MsgOpaqueData pollUpdateParentKey * @property {proto.IPollEncValue|null} [encPollVote] MsgOpaqueData encPollVote + * @property {boolean|null} [isSentCagPollCreation] MsgOpaqueData isSentCagPollCreation + * @property {string|null} [encReactionTargetMessageKey] MsgOpaqueData encReactionTargetMessageKey + * @property {Uint8Array|null} [encReactionEncPayload] MsgOpaqueData encReactionEncPayload + * @property {Uint8Array|null} [encReactionEncIv] MsgOpaqueData encReactionEncIv */ /** @@ -48550,6 +49925,38 @@ $root.proto = (function() { */ MsgOpaqueData.prototype.encPollVote = null; + /** + * MsgOpaqueData isSentCagPollCreation. + * @member {boolean} isSentCagPollCreation + * @memberof proto.MsgOpaqueData + * @instance + */ + MsgOpaqueData.prototype.isSentCagPollCreation = false; + + /** + * MsgOpaqueData encReactionTargetMessageKey. + * @member {string} encReactionTargetMessageKey + * @memberof proto.MsgOpaqueData + * @instance + */ + MsgOpaqueData.prototype.encReactionTargetMessageKey = ""; + + /** + * MsgOpaqueData encReactionEncPayload. + * @member {Uint8Array} encReactionEncPayload + * @memberof proto.MsgOpaqueData + * @instance + */ + MsgOpaqueData.prototype.encReactionEncPayload = $util.newBuffer([]); + + /** + * MsgOpaqueData encReactionEncIv. + * @member {Uint8Array} encReactionEncIv + * @memberof proto.MsgOpaqueData + * @instance + */ + MsgOpaqueData.prototype.encReactionEncIv = $util.newBuffer([]); + /** * Creates a new MsgOpaqueData instance using the specified properties. * @function create @@ -48617,6 +50024,14 @@ $root.proto = (function() { writer.uint32(/* id 23, wireType 2 =*/186).string(message.pollUpdateParentKey); if (message.encPollVote != null && Object.hasOwnProperty.call(message, "encPollVote")) $root.proto.PollEncValue.encode(message.encPollVote, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.encReactionTargetMessageKey != null && Object.hasOwnProperty.call(message, "encReactionTargetMessageKey")) + writer.uint32(/* id 25, wireType 2 =*/202).string(message.encReactionTargetMessageKey); + if (message.encReactionEncPayload != null && Object.hasOwnProperty.call(message, "encReactionEncPayload")) + writer.uint32(/* id 26, wireType 2 =*/210).bytes(message.encReactionEncPayload); + if (message.encReactionEncIv != null && Object.hasOwnProperty.call(message, "encReactionEncIv")) + writer.uint32(/* id 27, wireType 2 =*/218).bytes(message.encReactionEncIv); + if (message.isSentCagPollCreation != null && Object.hasOwnProperty.call(message, "isSentCagPollCreation")) + writer.uint32(/* id 28, wireType 0 =*/224).bool(message.isSentCagPollCreation); if (message.originalSelfAuthor != null && Object.hasOwnProperty.call(message, "originalSelfAuthor")) writer.uint32(/* id 51, wireType 2 =*/410).string(message.originalSelfAuthor); return writer; @@ -48721,6 +50136,18 @@ $root.proto = (function() { case 24: message.encPollVote = $root.proto.PollEncValue.decode(reader, reader.uint32()); break; + case 28: + message.isSentCagPollCreation = reader.bool(); + break; + case 25: + message.encReactionTargetMessageKey = reader.string(); + break; + case 26: + message.encReactionEncPayload = reader.bytes(); + break; + case 27: + message.encReactionEncIv = reader.bytes(); + break; default: reader.skipType(tag & 7); break; @@ -48830,6 +50257,18 @@ $root.proto = (function() { if (error) return "encPollVote." + error; } + if (message.isSentCagPollCreation != null && message.hasOwnProperty("isSentCagPollCreation")) + if (typeof message.isSentCagPollCreation !== "boolean") + return "isSentCagPollCreation: boolean expected"; + if (message.encReactionTargetMessageKey != null && message.hasOwnProperty("encReactionTargetMessageKey")) + if (!$util.isString(message.encReactionTargetMessageKey)) + return "encReactionTargetMessageKey: string expected"; + if (message.encReactionEncPayload != null && message.hasOwnProperty("encReactionEncPayload")) + if (!(message.encReactionEncPayload && typeof message.encReactionEncPayload.length === "number" || $util.isString(message.encReactionEncPayload))) + return "encReactionEncPayload: buffer expected"; + if (message.encReactionEncIv != null && message.hasOwnProperty("encReactionEncIv")) + if (!(message.encReactionEncIv && typeof message.encReactionEncIv.length === "number" || $util.isString(message.encReactionEncIv))) + return "encReactionEncIv: buffer expected"; return null; }; @@ -48913,6 +50352,20 @@ $root.proto = (function() { throw TypeError(".proto.MsgOpaqueData.encPollVote: object expected"); message.encPollVote = $root.proto.PollEncValue.fromObject(object.encPollVote); } + if (object.isSentCagPollCreation != null) + message.isSentCagPollCreation = Boolean(object.isSentCagPollCreation); + if (object.encReactionTargetMessageKey != null) + message.encReactionTargetMessageKey = String(object.encReactionTargetMessageKey); + if (object.encReactionEncPayload != null) + if (typeof object.encReactionEncPayload === "string") + $util.base64.decode(object.encReactionEncPayload, message.encReactionEncPayload = $util.newBuffer($util.base64.length(object.encReactionEncPayload)), 0); + else if (object.encReactionEncPayload.length) + message.encReactionEncPayload = object.encReactionEncPayload; + if (object.encReactionEncIv != null) + if (typeof object.encReactionEncIv === "string") + $util.base64.decode(object.encReactionEncIv, message.encReactionEncIv = $util.newBuffer($util.base64.length(object.encReactionEncIv)), 0); + else if (object.encReactionEncIv.length) + message.encReactionEncIv = object.encReactionEncIv; return message; }; @@ -48968,6 +50421,22 @@ $root.proto = (function() { object.senderTimestampMs = options.longs === String ? "0" : 0; object.pollUpdateParentKey = ""; object.encPollVote = null; + object.encReactionTargetMessageKey = ""; + if (options.bytes === String) + object.encReactionEncPayload = ""; + else { + object.encReactionEncPayload = []; + if (options.bytes !== Array) + object.encReactionEncPayload = $util.newBuffer(object.encReactionEncPayload); + } + if (options.bytes === String) + object.encReactionEncIv = ""; + else { + object.encReactionEncIv = []; + if (options.bytes !== Array) + object.encReactionEncIv = $util.newBuffer(object.encReactionEncIv); + } + object.isSentCagPollCreation = false; object.originalSelfAuthor = ""; } if (message.body != null && message.hasOwnProperty("body")) @@ -49018,6 +50487,14 @@ $root.proto = (function() { object.pollUpdateParentKey = message.pollUpdateParentKey; if (message.encPollVote != null && message.hasOwnProperty("encPollVote")) object.encPollVote = $root.proto.PollEncValue.toObject(message.encPollVote, options); + if (message.encReactionTargetMessageKey != null && message.hasOwnProperty("encReactionTargetMessageKey")) + object.encReactionTargetMessageKey = message.encReactionTargetMessageKey; + if (message.encReactionEncPayload != null && message.hasOwnProperty("encReactionEncPayload")) + object.encReactionEncPayload = options.bytes === String ? $util.base64.encode(message.encReactionEncPayload, 0, message.encReactionEncPayload.length) : options.bytes === Array ? Array.prototype.slice.call(message.encReactionEncPayload) : message.encReactionEncPayload; + if (message.encReactionEncIv != null && message.hasOwnProperty("encReactionEncIv")) + object.encReactionEncIv = options.bytes === String ? $util.base64.encode(message.encReactionEncIv, 0, message.encReactionEncIv.length) : options.bytes === Array ? Array.prototype.slice.call(message.encReactionEncIv) : message.encReactionEncIv; + if (message.isSentCagPollCreation != null && message.hasOwnProperty("isSentCagPollCreation")) + object.isSentCagPollCreation = message.isSentCagPollCreation; if (message.originalSelfAuthor != null && message.hasOwnProperty("originalSelfAuthor")) object.originalSelfAuthor = message.originalSelfAuthor; return object; @@ -52372,621 +53849,6 @@ $root.proto = (function() { return PaymentInfo; })(); - proto.PendingKeyExchange = (function() { - - /** - * Properties of a PendingKeyExchange. - * @memberof proto - * @interface IPendingKeyExchange - * @property {number|null} [sequence] PendingKeyExchange sequence - * @property {Uint8Array|null} [localBaseKey] PendingKeyExchange localBaseKey - * @property {Uint8Array|null} [localBaseKeyPrivate] PendingKeyExchange localBaseKeyPrivate - * @property {Uint8Array|null} [localRatchetKey] PendingKeyExchange localRatchetKey - * @property {Uint8Array|null} [localRatchetKeyPrivate] PendingKeyExchange localRatchetKeyPrivate - * @property {Uint8Array|null} [localIdentityKey] PendingKeyExchange localIdentityKey - * @property {Uint8Array|null} [localIdentityKeyPrivate] PendingKeyExchange localIdentityKeyPrivate - */ - - /** - * Constructs a new PendingKeyExchange. - * @memberof proto - * @classdesc Represents a PendingKeyExchange. - * @implements IPendingKeyExchange - * @constructor - * @param {proto.IPendingKeyExchange=} [properties] Properties to set - */ - function PendingKeyExchange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PendingKeyExchange sequence. - * @member {number} sequence - * @memberof proto.PendingKeyExchange - * @instance - */ - PendingKeyExchange.prototype.sequence = 0; - - /** - * PendingKeyExchange localBaseKey. - * @member {Uint8Array} localBaseKey - * @memberof proto.PendingKeyExchange - * @instance - */ - PendingKeyExchange.prototype.localBaseKey = $util.newBuffer([]); - - /** - * PendingKeyExchange localBaseKeyPrivate. - * @member {Uint8Array} localBaseKeyPrivate - * @memberof proto.PendingKeyExchange - * @instance - */ - PendingKeyExchange.prototype.localBaseKeyPrivate = $util.newBuffer([]); - - /** - * PendingKeyExchange localRatchetKey. - * @member {Uint8Array} localRatchetKey - * @memberof proto.PendingKeyExchange - * @instance - */ - PendingKeyExchange.prototype.localRatchetKey = $util.newBuffer([]); - - /** - * PendingKeyExchange localRatchetKeyPrivate. - * @member {Uint8Array} localRatchetKeyPrivate - * @memberof proto.PendingKeyExchange - * @instance - */ - PendingKeyExchange.prototype.localRatchetKeyPrivate = $util.newBuffer([]); - - /** - * PendingKeyExchange localIdentityKey. - * @member {Uint8Array} localIdentityKey - * @memberof proto.PendingKeyExchange - * @instance - */ - PendingKeyExchange.prototype.localIdentityKey = $util.newBuffer([]); - - /** - * PendingKeyExchange localIdentityKeyPrivate. - * @member {Uint8Array} localIdentityKeyPrivate - * @memberof proto.PendingKeyExchange - * @instance - */ - PendingKeyExchange.prototype.localIdentityKeyPrivate = $util.newBuffer([]); - - /** - * Creates a new PendingKeyExchange instance using the specified properties. - * @function create - * @memberof proto.PendingKeyExchange - * @static - * @param {proto.IPendingKeyExchange=} [properties] Properties to set - * @returns {proto.PendingKeyExchange} PendingKeyExchange instance - */ - PendingKeyExchange.create = function create(properties) { - return new PendingKeyExchange(properties); - }; - - /** - * Encodes the specified PendingKeyExchange message. Does not implicitly {@link proto.PendingKeyExchange.verify|verify} messages. - * @function encode - * @memberof proto.PendingKeyExchange - * @static - * @param {proto.IPendingKeyExchange} message PendingKeyExchange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PendingKeyExchange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.sequence); - if (message.localBaseKey != null && Object.hasOwnProperty.call(message, "localBaseKey")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.localBaseKey); - if (message.localBaseKeyPrivate != null && Object.hasOwnProperty.call(message, "localBaseKeyPrivate")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.localBaseKeyPrivate); - if (message.localRatchetKey != null && Object.hasOwnProperty.call(message, "localRatchetKey")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.localRatchetKey); - if (message.localRatchetKeyPrivate != null && Object.hasOwnProperty.call(message, "localRatchetKeyPrivate")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.localRatchetKeyPrivate); - if (message.localIdentityKey != null && Object.hasOwnProperty.call(message, "localIdentityKey")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.localIdentityKey); - if (message.localIdentityKeyPrivate != null && Object.hasOwnProperty.call(message, "localIdentityKeyPrivate")) - writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.localIdentityKeyPrivate); - return writer; - }; - - /** - * Encodes the specified PendingKeyExchange message, length delimited. Does not implicitly {@link proto.PendingKeyExchange.verify|verify} messages. - * @function encodeDelimited - * @memberof proto.PendingKeyExchange - * @static - * @param {proto.IPendingKeyExchange} message PendingKeyExchange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PendingKeyExchange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PendingKeyExchange message from the specified reader or buffer. - * @function decode - * @memberof proto.PendingKeyExchange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {proto.PendingKeyExchange} PendingKeyExchange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PendingKeyExchange.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.PendingKeyExchange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sequence = reader.uint32(); - break; - case 2: - message.localBaseKey = reader.bytes(); - break; - case 3: - message.localBaseKeyPrivate = reader.bytes(); - break; - case 4: - message.localRatchetKey = reader.bytes(); - break; - case 5: - message.localRatchetKeyPrivate = reader.bytes(); - break; - case 7: - message.localIdentityKey = reader.bytes(); - break; - case 8: - message.localIdentityKeyPrivate = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PendingKeyExchange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof proto.PendingKeyExchange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.PendingKeyExchange} PendingKeyExchange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PendingKeyExchange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PendingKeyExchange message. - * @function verify - * @memberof proto.PendingKeyExchange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PendingKeyExchange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence)) - return "sequence: integer expected"; - if (message.localBaseKey != null && message.hasOwnProperty("localBaseKey")) - if (!(message.localBaseKey && typeof message.localBaseKey.length === "number" || $util.isString(message.localBaseKey))) - return "localBaseKey: buffer expected"; - if (message.localBaseKeyPrivate != null && message.hasOwnProperty("localBaseKeyPrivate")) - if (!(message.localBaseKeyPrivate && typeof message.localBaseKeyPrivate.length === "number" || $util.isString(message.localBaseKeyPrivate))) - return "localBaseKeyPrivate: buffer expected"; - if (message.localRatchetKey != null && message.hasOwnProperty("localRatchetKey")) - if (!(message.localRatchetKey && typeof message.localRatchetKey.length === "number" || $util.isString(message.localRatchetKey))) - return "localRatchetKey: buffer expected"; - if (message.localRatchetKeyPrivate != null && message.hasOwnProperty("localRatchetKeyPrivate")) - if (!(message.localRatchetKeyPrivate && typeof message.localRatchetKeyPrivate.length === "number" || $util.isString(message.localRatchetKeyPrivate))) - return "localRatchetKeyPrivate: buffer expected"; - if (message.localIdentityKey != null && message.hasOwnProperty("localIdentityKey")) - if (!(message.localIdentityKey && typeof message.localIdentityKey.length === "number" || $util.isString(message.localIdentityKey))) - return "localIdentityKey: buffer expected"; - if (message.localIdentityKeyPrivate != null && message.hasOwnProperty("localIdentityKeyPrivate")) - if (!(message.localIdentityKeyPrivate && typeof message.localIdentityKeyPrivate.length === "number" || $util.isString(message.localIdentityKeyPrivate))) - return "localIdentityKeyPrivate: buffer expected"; - return null; - }; - - /** - * Creates a PendingKeyExchange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof proto.PendingKeyExchange - * @static - * @param {Object.} object Plain object - * @returns {proto.PendingKeyExchange} PendingKeyExchange - */ - PendingKeyExchange.fromObject = function fromObject(object) { - if (object instanceof $root.proto.PendingKeyExchange) - return object; - var message = new $root.proto.PendingKeyExchange(); - if (object.sequence != null) - message.sequence = object.sequence >>> 0; - if (object.localBaseKey != null) - if (typeof object.localBaseKey === "string") - $util.base64.decode(object.localBaseKey, message.localBaseKey = $util.newBuffer($util.base64.length(object.localBaseKey)), 0); - else if (object.localBaseKey.length) - message.localBaseKey = object.localBaseKey; - if (object.localBaseKeyPrivate != null) - if (typeof object.localBaseKeyPrivate === "string") - $util.base64.decode(object.localBaseKeyPrivate, message.localBaseKeyPrivate = $util.newBuffer($util.base64.length(object.localBaseKeyPrivate)), 0); - else if (object.localBaseKeyPrivate.length) - message.localBaseKeyPrivate = object.localBaseKeyPrivate; - if (object.localRatchetKey != null) - if (typeof object.localRatchetKey === "string") - $util.base64.decode(object.localRatchetKey, message.localRatchetKey = $util.newBuffer($util.base64.length(object.localRatchetKey)), 0); - else if (object.localRatchetKey.length) - message.localRatchetKey = object.localRatchetKey; - if (object.localRatchetKeyPrivate != null) - if (typeof object.localRatchetKeyPrivate === "string") - $util.base64.decode(object.localRatchetKeyPrivate, message.localRatchetKeyPrivate = $util.newBuffer($util.base64.length(object.localRatchetKeyPrivate)), 0); - else if (object.localRatchetKeyPrivate.length) - message.localRatchetKeyPrivate = object.localRatchetKeyPrivate; - if (object.localIdentityKey != null) - if (typeof object.localIdentityKey === "string") - $util.base64.decode(object.localIdentityKey, message.localIdentityKey = $util.newBuffer($util.base64.length(object.localIdentityKey)), 0); - else if (object.localIdentityKey.length) - message.localIdentityKey = object.localIdentityKey; - if (object.localIdentityKeyPrivate != null) - if (typeof object.localIdentityKeyPrivate === "string") - $util.base64.decode(object.localIdentityKeyPrivate, message.localIdentityKeyPrivate = $util.newBuffer($util.base64.length(object.localIdentityKeyPrivate)), 0); - else if (object.localIdentityKeyPrivate.length) - message.localIdentityKeyPrivate = object.localIdentityKeyPrivate; - return message; - }; - - /** - * Creates a plain object from a PendingKeyExchange message. Also converts values to other types if specified. - * @function toObject - * @memberof proto.PendingKeyExchange - * @static - * @param {proto.PendingKeyExchange} message PendingKeyExchange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PendingKeyExchange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.sequence = 0; - if (options.bytes === String) - object.localBaseKey = ""; - else { - object.localBaseKey = []; - if (options.bytes !== Array) - object.localBaseKey = $util.newBuffer(object.localBaseKey); - } - if (options.bytes === String) - object.localBaseKeyPrivate = ""; - else { - object.localBaseKeyPrivate = []; - if (options.bytes !== Array) - object.localBaseKeyPrivate = $util.newBuffer(object.localBaseKeyPrivate); - } - if (options.bytes === String) - object.localRatchetKey = ""; - else { - object.localRatchetKey = []; - if (options.bytes !== Array) - object.localRatchetKey = $util.newBuffer(object.localRatchetKey); - } - if (options.bytes === String) - object.localRatchetKeyPrivate = ""; - else { - object.localRatchetKeyPrivate = []; - if (options.bytes !== Array) - object.localRatchetKeyPrivate = $util.newBuffer(object.localRatchetKeyPrivate); - } - if (options.bytes === String) - object.localIdentityKey = ""; - else { - object.localIdentityKey = []; - if (options.bytes !== Array) - object.localIdentityKey = $util.newBuffer(object.localIdentityKey); - } - if (options.bytes === String) - object.localIdentityKeyPrivate = ""; - else { - object.localIdentityKeyPrivate = []; - if (options.bytes !== Array) - object.localIdentityKeyPrivate = $util.newBuffer(object.localIdentityKeyPrivate); - } - } - if (message.sequence != null && message.hasOwnProperty("sequence")) - object.sequence = message.sequence; - if (message.localBaseKey != null && message.hasOwnProperty("localBaseKey")) - object.localBaseKey = options.bytes === String ? $util.base64.encode(message.localBaseKey, 0, message.localBaseKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.localBaseKey) : message.localBaseKey; - if (message.localBaseKeyPrivate != null && message.hasOwnProperty("localBaseKeyPrivate")) - object.localBaseKeyPrivate = options.bytes === String ? $util.base64.encode(message.localBaseKeyPrivate, 0, message.localBaseKeyPrivate.length) : options.bytes === Array ? Array.prototype.slice.call(message.localBaseKeyPrivate) : message.localBaseKeyPrivate; - if (message.localRatchetKey != null && message.hasOwnProperty("localRatchetKey")) - object.localRatchetKey = options.bytes === String ? $util.base64.encode(message.localRatchetKey, 0, message.localRatchetKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.localRatchetKey) : message.localRatchetKey; - if (message.localRatchetKeyPrivate != null && message.hasOwnProperty("localRatchetKeyPrivate")) - object.localRatchetKeyPrivate = options.bytes === String ? $util.base64.encode(message.localRatchetKeyPrivate, 0, message.localRatchetKeyPrivate.length) : options.bytes === Array ? Array.prototype.slice.call(message.localRatchetKeyPrivate) : message.localRatchetKeyPrivate; - if (message.localIdentityKey != null && message.hasOwnProperty("localIdentityKey")) - object.localIdentityKey = options.bytes === String ? $util.base64.encode(message.localIdentityKey, 0, message.localIdentityKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.localIdentityKey) : message.localIdentityKey; - if (message.localIdentityKeyPrivate != null && message.hasOwnProperty("localIdentityKeyPrivate")) - object.localIdentityKeyPrivate = options.bytes === String ? $util.base64.encode(message.localIdentityKeyPrivate, 0, message.localIdentityKeyPrivate.length) : options.bytes === Array ? Array.prototype.slice.call(message.localIdentityKeyPrivate) : message.localIdentityKeyPrivate; - return object; - }; - - /** - * Converts this PendingKeyExchange to JSON. - * @function toJSON - * @memberof proto.PendingKeyExchange - * @instance - * @returns {Object.} JSON object - */ - PendingKeyExchange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PendingKeyExchange; - })(); - - proto.PendingPreKey = (function() { - - /** - * Properties of a PendingPreKey. - * @memberof proto - * @interface IPendingPreKey - * @property {number|null} [preKeyId] PendingPreKey preKeyId - * @property {number|null} [signedPreKeyId] PendingPreKey signedPreKeyId - * @property {Uint8Array|null} [baseKey] PendingPreKey baseKey - */ - - /** - * Constructs a new PendingPreKey. - * @memberof proto - * @classdesc Represents a PendingPreKey. - * @implements IPendingPreKey - * @constructor - * @param {proto.IPendingPreKey=} [properties] Properties to set - */ - function PendingPreKey(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PendingPreKey preKeyId. - * @member {number} preKeyId - * @memberof proto.PendingPreKey - * @instance - */ - PendingPreKey.prototype.preKeyId = 0; - - /** - * PendingPreKey signedPreKeyId. - * @member {number} signedPreKeyId - * @memberof proto.PendingPreKey - * @instance - */ - PendingPreKey.prototype.signedPreKeyId = 0; - - /** - * PendingPreKey baseKey. - * @member {Uint8Array} baseKey - * @memberof proto.PendingPreKey - * @instance - */ - PendingPreKey.prototype.baseKey = $util.newBuffer([]); - - /** - * Creates a new PendingPreKey instance using the specified properties. - * @function create - * @memberof proto.PendingPreKey - * @static - * @param {proto.IPendingPreKey=} [properties] Properties to set - * @returns {proto.PendingPreKey} PendingPreKey instance - */ - PendingPreKey.create = function create(properties) { - return new PendingPreKey(properties); - }; - - /** - * Encodes the specified PendingPreKey message. Does not implicitly {@link proto.PendingPreKey.verify|verify} messages. - * @function encode - * @memberof proto.PendingPreKey - * @static - * @param {proto.IPendingPreKey} message PendingPreKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PendingPreKey.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.preKeyId != null && Object.hasOwnProperty.call(message, "preKeyId")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.preKeyId); - if (message.baseKey != null && Object.hasOwnProperty.call(message, "baseKey")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.baseKey); - if (message.signedPreKeyId != null && Object.hasOwnProperty.call(message, "signedPreKeyId")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.signedPreKeyId); - return writer; - }; - - /** - * Encodes the specified PendingPreKey message, length delimited. Does not implicitly {@link proto.PendingPreKey.verify|verify} messages. - * @function encodeDelimited - * @memberof proto.PendingPreKey - * @static - * @param {proto.IPendingPreKey} message PendingPreKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PendingPreKey.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PendingPreKey message from the specified reader or buffer. - * @function decode - * @memberof proto.PendingPreKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {proto.PendingPreKey} PendingPreKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PendingPreKey.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.PendingPreKey(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.preKeyId = reader.uint32(); - break; - case 3: - message.signedPreKeyId = reader.int32(); - break; - case 2: - message.baseKey = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PendingPreKey message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof proto.PendingPreKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.PendingPreKey} PendingPreKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PendingPreKey.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PendingPreKey message. - * @function verify - * @memberof proto.PendingPreKey - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PendingPreKey.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.preKeyId != null && message.hasOwnProperty("preKeyId")) - if (!$util.isInteger(message.preKeyId)) - return "preKeyId: integer expected"; - if (message.signedPreKeyId != null && message.hasOwnProperty("signedPreKeyId")) - if (!$util.isInteger(message.signedPreKeyId)) - return "signedPreKeyId: integer expected"; - if (message.baseKey != null && message.hasOwnProperty("baseKey")) - if (!(message.baseKey && typeof message.baseKey.length === "number" || $util.isString(message.baseKey))) - return "baseKey: buffer expected"; - return null; - }; - - /** - * Creates a PendingPreKey message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof proto.PendingPreKey - * @static - * @param {Object.} object Plain object - * @returns {proto.PendingPreKey} PendingPreKey - */ - PendingPreKey.fromObject = function fromObject(object) { - if (object instanceof $root.proto.PendingPreKey) - return object; - var message = new $root.proto.PendingPreKey(); - if (object.preKeyId != null) - message.preKeyId = object.preKeyId >>> 0; - if (object.signedPreKeyId != null) - message.signedPreKeyId = object.signedPreKeyId | 0; - if (object.baseKey != null) - if (typeof object.baseKey === "string") - $util.base64.decode(object.baseKey, message.baseKey = $util.newBuffer($util.base64.length(object.baseKey)), 0); - else if (object.baseKey.length) - message.baseKey = object.baseKey; - return message; - }; - - /** - * Creates a plain object from a PendingPreKey message. Also converts values to other types if specified. - * @function toObject - * @memberof proto.PendingPreKey - * @static - * @param {proto.PendingPreKey} message PendingPreKey - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PendingPreKey.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.preKeyId = 0; - if (options.bytes === String) - object.baseKey = ""; - else { - object.baseKey = []; - if (options.bytes !== Array) - object.baseKey = $util.newBuffer(object.baseKey); - } - object.signedPreKeyId = 0; - } - if (message.preKeyId != null && message.hasOwnProperty("preKeyId")) - object.preKeyId = message.preKeyId; - if (message.baseKey != null && message.hasOwnProperty("baseKey")) - object.baseKey = options.bytes === String ? $util.base64.encode(message.baseKey, 0, message.baseKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.baseKey) : message.baseKey; - if (message.signedPreKeyId != null && message.hasOwnProperty("signedPreKeyId")) - object.signedPreKeyId = message.signedPreKeyId; - return object; - }; - - /** - * Converts this PendingPreKey to JSON. - * @function toJSON - * @memberof proto.PendingPreKey - * @instance - * @returns {Object.} JSON object - */ - PendingPreKey.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PendingPreKey; - })(); - proto.PhotoChange = (function() { /** @@ -53915,6 +54777,8 @@ $root.proto = (function() { * @property {proto.IMessageKey|null} [pollUpdateMessageKey] PollUpdate pollUpdateMessageKey * @property {proto.Message.IPollVoteMessage|null} [vote] PollUpdate vote * @property {number|Long|null} [senderTimestampMs] PollUpdate senderTimestampMs + * @property {number|Long|null} [serverTimestampMs] PollUpdate serverTimestampMs + * @property {boolean|null} [unread] PollUpdate unread */ /** @@ -53956,6 +54820,22 @@ $root.proto = (function() { */ PollUpdate.prototype.senderTimestampMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * PollUpdate serverTimestampMs. + * @member {number|Long} serverTimestampMs + * @memberof proto.PollUpdate + * @instance + */ + PollUpdate.prototype.serverTimestampMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * PollUpdate unread. + * @member {boolean} unread + * @memberof proto.PollUpdate + * @instance + */ + PollUpdate.prototype.unread = false; + /** * Creates a new PollUpdate instance using the specified properties. * @function create @@ -53986,6 +54866,10 @@ $root.proto = (function() { $root.proto.Message.PollVoteMessage.encode(message.vote, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.senderTimestampMs != null && Object.hasOwnProperty.call(message, "senderTimestampMs")) writer.uint32(/* id 3, wireType 0 =*/24).int64(message.senderTimestampMs); + if (message.serverTimestampMs != null && Object.hasOwnProperty.call(message, "serverTimestampMs")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.serverTimestampMs); + if (message.unread != null && Object.hasOwnProperty.call(message, "unread")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.unread); return writer; }; @@ -54029,6 +54913,12 @@ $root.proto = (function() { case 3: message.senderTimestampMs = reader.int64(); break; + case 4: + message.serverTimestampMs = reader.int64(); + break; + case 5: + message.unread = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -54077,6 +54967,12 @@ $root.proto = (function() { if (message.senderTimestampMs != null && message.hasOwnProperty("senderTimestampMs")) if (!$util.isInteger(message.senderTimestampMs) && !(message.senderTimestampMs && $util.isInteger(message.senderTimestampMs.low) && $util.isInteger(message.senderTimestampMs.high))) return "senderTimestampMs: integer|Long expected"; + if (message.serverTimestampMs != null && message.hasOwnProperty("serverTimestampMs")) + if (!$util.isInteger(message.serverTimestampMs) && !(message.serverTimestampMs && $util.isInteger(message.serverTimestampMs.low) && $util.isInteger(message.serverTimestampMs.high))) + return "serverTimestampMs: integer|Long expected"; + if (message.unread != null && message.hasOwnProperty("unread")) + if (typeof message.unread !== "boolean") + return "unread: boolean expected"; return null; }; @@ -54111,6 +55007,17 @@ $root.proto = (function() { message.senderTimestampMs = object.senderTimestampMs; else if (typeof object.senderTimestampMs === "object") message.senderTimestampMs = new $util.LongBits(object.senderTimestampMs.low >>> 0, object.senderTimestampMs.high >>> 0).toNumber(); + if (object.serverTimestampMs != null) + if ($util.Long) + (message.serverTimestampMs = $util.Long.fromValue(object.serverTimestampMs)).unsigned = false; + else if (typeof object.serverTimestampMs === "string") + message.serverTimestampMs = parseInt(object.serverTimestampMs, 10); + else if (typeof object.serverTimestampMs === "number") + message.serverTimestampMs = object.serverTimestampMs; + else if (typeof object.serverTimestampMs === "object") + message.serverTimestampMs = new $util.LongBits(object.serverTimestampMs.low >>> 0, object.serverTimestampMs.high >>> 0).toNumber(); + if (object.unread != null) + message.unread = Boolean(object.unread); return message; }; @@ -54135,6 +55042,12 @@ $root.proto = (function() { object.senderTimestampMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.senderTimestampMs = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.serverTimestampMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.serverTimestampMs = options.longs === String ? "0" : 0; + object.unread = false; } if (message.pollUpdateMessageKey != null && message.hasOwnProperty("pollUpdateMessageKey")) object.pollUpdateMessageKey = $root.proto.MessageKey.toObject(message.pollUpdateMessageKey, options); @@ -54145,6 +55058,13 @@ $root.proto = (function() { object.senderTimestampMs = options.longs === String ? String(message.senderTimestampMs) : message.senderTimestampMs; else object.senderTimestampMs = options.longs === String ? $util.Long.prototype.toString.call(message.senderTimestampMs) : options.longs === Number ? new $util.LongBits(message.senderTimestampMs.low >>> 0, message.senderTimestampMs.high >>> 0).toNumber() : message.senderTimestampMs; + if (message.serverTimestampMs != null && message.hasOwnProperty("serverTimestampMs")) + if (typeof message.serverTimestampMs === "number") + object.serverTimestampMs = options.longs === String ? String(message.serverTimestampMs) : message.serverTimestampMs; + else + object.serverTimestampMs = options.longs === String ? $util.Long.prototype.toString.call(message.serverTimestampMs) : options.longs === Number ? new $util.LongBits(message.serverTimestampMs.low >>> 0, message.serverTimestampMs.high >>> 0).toNumber() : message.serverTimestampMs; + if (message.unread != null && message.hasOwnProperty("unread")) + object.unread = message.unread; return object; }; @@ -55363,225 +56283,6 @@ $root.proto = (function() { return RecordStructure; })(); - proto.SenderChainKey = (function() { - - /** - * Properties of a SenderChainKey. - * @memberof proto - * @interface ISenderChainKey - * @property {number|null} [iteration] SenderChainKey iteration - * @property {Uint8Array|null} [seed] SenderChainKey seed - */ - - /** - * Constructs a new SenderChainKey. - * @memberof proto - * @classdesc Represents a SenderChainKey. - * @implements ISenderChainKey - * @constructor - * @param {proto.ISenderChainKey=} [properties] Properties to set - */ - function SenderChainKey(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SenderChainKey iteration. - * @member {number} iteration - * @memberof proto.SenderChainKey - * @instance - */ - SenderChainKey.prototype.iteration = 0; - - /** - * SenderChainKey seed. - * @member {Uint8Array} seed - * @memberof proto.SenderChainKey - * @instance - */ - SenderChainKey.prototype.seed = $util.newBuffer([]); - - /** - * Creates a new SenderChainKey instance using the specified properties. - * @function create - * @memberof proto.SenderChainKey - * @static - * @param {proto.ISenderChainKey=} [properties] Properties to set - * @returns {proto.SenderChainKey} SenderChainKey instance - */ - SenderChainKey.create = function create(properties) { - return new SenderChainKey(properties); - }; - - /** - * Encodes the specified SenderChainKey message. Does not implicitly {@link proto.SenderChainKey.verify|verify} messages. - * @function encode - * @memberof proto.SenderChainKey - * @static - * @param {proto.ISenderChainKey} message SenderChainKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SenderChainKey.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.iteration != null && Object.hasOwnProperty.call(message, "iteration")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.iteration); - if (message.seed != null && Object.hasOwnProperty.call(message, "seed")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.seed); - return writer; - }; - - /** - * Encodes the specified SenderChainKey message, length delimited. Does not implicitly {@link proto.SenderChainKey.verify|verify} messages. - * @function encodeDelimited - * @memberof proto.SenderChainKey - * @static - * @param {proto.ISenderChainKey} message SenderChainKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SenderChainKey.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SenderChainKey message from the specified reader or buffer. - * @function decode - * @memberof proto.SenderChainKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {proto.SenderChainKey} SenderChainKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SenderChainKey.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SenderChainKey(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.iteration = reader.uint32(); - break; - case 2: - message.seed = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SenderChainKey message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof proto.SenderChainKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.SenderChainKey} SenderChainKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SenderChainKey.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SenderChainKey message. - * @function verify - * @memberof proto.SenderChainKey - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SenderChainKey.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.iteration != null && message.hasOwnProperty("iteration")) - if (!$util.isInteger(message.iteration)) - return "iteration: integer expected"; - if (message.seed != null && message.hasOwnProperty("seed")) - if (!(message.seed && typeof message.seed.length === "number" || $util.isString(message.seed))) - return "seed: buffer expected"; - return null; - }; - - /** - * Creates a SenderChainKey message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof proto.SenderChainKey - * @static - * @param {Object.} object Plain object - * @returns {proto.SenderChainKey} SenderChainKey - */ - SenderChainKey.fromObject = function fromObject(object) { - if (object instanceof $root.proto.SenderChainKey) - return object; - var message = new $root.proto.SenderChainKey(); - if (object.iteration != null) - message.iteration = object.iteration >>> 0; - if (object.seed != null) - if (typeof object.seed === "string") - $util.base64.decode(object.seed, message.seed = $util.newBuffer($util.base64.length(object.seed)), 0); - else if (object.seed.length) - message.seed = object.seed; - return message; - }; - - /** - * Creates a plain object from a SenderChainKey message. Also converts values to other types if specified. - * @function toObject - * @memberof proto.SenderChainKey - * @static - * @param {proto.SenderChainKey} message SenderChainKey - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SenderChainKey.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.iteration = 0; - if (options.bytes === String) - object.seed = ""; - else { - object.seed = []; - if (options.bytes !== Array) - object.seed = $util.newBuffer(object.seed); - } - } - if (message.iteration != null && message.hasOwnProperty("iteration")) - object.iteration = message.iteration; - if (message.seed != null && message.hasOwnProperty("seed")) - object.seed = options.bytes === String ? $util.base64.encode(message.seed, 0, message.seed.length) : options.bytes === Array ? Array.prototype.slice.call(message.seed) : message.seed; - return object; - }; - - /** - * Converts this SenderChainKey to JSON. - * @function toJSON - * @memberof proto.SenderChainKey - * @instance - * @returns {Object.} JSON object - */ - SenderChainKey.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SenderChainKey; - })(); - proto.SenderKeyRecordStructure = (function() { /** @@ -55797,9 +56498,9 @@ $root.proto = (function() { * @memberof proto * @interface ISenderKeyStateStructure * @property {number|null} [senderKeyId] SenderKeyStateStructure senderKeyId - * @property {proto.ISenderChainKey|null} [senderChainKey] SenderKeyStateStructure senderChainKey - * @property {proto.ISenderSigningKey|null} [senderSigningKey] SenderKeyStateStructure senderSigningKey - * @property {Array.|null} [senderMessageKeys] SenderKeyStateStructure senderMessageKeys + * @property {proto.SenderKeyStateStructure.ISenderChainKey|null} [senderChainKey] SenderKeyStateStructure senderChainKey + * @property {proto.SenderKeyStateStructure.ISenderSigningKey|null} [senderSigningKey] SenderKeyStateStructure senderSigningKey + * @property {Array.|null} [senderMessageKeys] SenderKeyStateStructure senderMessageKeys */ /** @@ -55828,7 +56529,7 @@ $root.proto = (function() { /** * SenderKeyStateStructure senderChainKey. - * @member {proto.ISenderChainKey|null|undefined} senderChainKey + * @member {proto.SenderKeyStateStructure.ISenderChainKey|null|undefined} senderChainKey * @memberof proto.SenderKeyStateStructure * @instance */ @@ -55836,7 +56537,7 @@ $root.proto = (function() { /** * SenderKeyStateStructure senderSigningKey. - * @member {proto.ISenderSigningKey|null|undefined} senderSigningKey + * @member {proto.SenderKeyStateStructure.ISenderSigningKey|null|undefined} senderSigningKey * @memberof proto.SenderKeyStateStructure * @instance */ @@ -55844,7 +56545,7 @@ $root.proto = (function() { /** * SenderKeyStateStructure senderMessageKeys. - * @member {Array.} senderMessageKeys + * @member {Array.} senderMessageKeys * @memberof proto.SenderKeyStateStructure * @instance */ @@ -55877,12 +56578,12 @@ $root.proto = (function() { if (message.senderKeyId != null && Object.hasOwnProperty.call(message, "senderKeyId")) writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.senderKeyId); if (message.senderChainKey != null && Object.hasOwnProperty.call(message, "senderChainKey")) - $root.proto.SenderChainKey.encode(message.senderChainKey, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.proto.SenderKeyStateStructure.SenderChainKey.encode(message.senderChainKey, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.senderSigningKey != null && Object.hasOwnProperty.call(message, "senderSigningKey")) - $root.proto.SenderSigningKey.encode(message.senderSigningKey, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.proto.SenderKeyStateStructure.SenderSigningKey.encode(message.senderSigningKey, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.senderMessageKeys != null && message.senderMessageKeys.length) for (var i = 0; i < message.senderMessageKeys.length; ++i) - $root.proto.SenderMessageKey.encode(message.senderMessageKeys[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.proto.SenderKeyStateStructure.SenderMessageKey.encode(message.senderMessageKeys[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -55921,15 +56622,15 @@ $root.proto = (function() { message.senderKeyId = reader.uint32(); break; case 2: - message.senderChainKey = $root.proto.SenderChainKey.decode(reader, reader.uint32()); + message.senderChainKey = $root.proto.SenderKeyStateStructure.SenderChainKey.decode(reader, reader.uint32()); break; case 3: - message.senderSigningKey = $root.proto.SenderSigningKey.decode(reader, reader.uint32()); + message.senderSigningKey = $root.proto.SenderKeyStateStructure.SenderSigningKey.decode(reader, reader.uint32()); break; case 4: if (!(message.senderMessageKeys && message.senderMessageKeys.length)) message.senderMessageKeys = []; - message.senderMessageKeys.push($root.proto.SenderMessageKey.decode(reader, reader.uint32())); + message.senderMessageKeys.push($root.proto.SenderKeyStateStructure.SenderMessageKey.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -55970,12 +56671,12 @@ $root.proto = (function() { if (!$util.isInteger(message.senderKeyId)) return "senderKeyId: integer expected"; if (message.senderChainKey != null && message.hasOwnProperty("senderChainKey")) { - var error = $root.proto.SenderChainKey.verify(message.senderChainKey); + var error = $root.proto.SenderKeyStateStructure.SenderChainKey.verify(message.senderChainKey); if (error) return "senderChainKey." + error; } if (message.senderSigningKey != null && message.hasOwnProperty("senderSigningKey")) { - var error = $root.proto.SenderSigningKey.verify(message.senderSigningKey); + var error = $root.proto.SenderKeyStateStructure.SenderSigningKey.verify(message.senderSigningKey); if (error) return "senderSigningKey." + error; } @@ -55983,7 +56684,7 @@ $root.proto = (function() { if (!Array.isArray(message.senderMessageKeys)) return "senderMessageKeys: array expected"; for (var i = 0; i < message.senderMessageKeys.length; ++i) { - var error = $root.proto.SenderMessageKey.verify(message.senderMessageKeys[i]); + var error = $root.proto.SenderKeyStateStructure.SenderMessageKey.verify(message.senderMessageKeys[i]); if (error) return "senderMessageKeys." + error; } @@ -56008,12 +56709,12 @@ $root.proto = (function() { if (object.senderChainKey != null) { if (typeof object.senderChainKey !== "object") throw TypeError(".proto.SenderKeyStateStructure.senderChainKey: object expected"); - message.senderChainKey = $root.proto.SenderChainKey.fromObject(object.senderChainKey); + message.senderChainKey = $root.proto.SenderKeyStateStructure.SenderChainKey.fromObject(object.senderChainKey); } if (object.senderSigningKey != null) { if (typeof object.senderSigningKey !== "object") throw TypeError(".proto.SenderKeyStateStructure.senderSigningKey: object expected"); - message.senderSigningKey = $root.proto.SenderSigningKey.fromObject(object.senderSigningKey); + message.senderSigningKey = $root.proto.SenderKeyStateStructure.SenderSigningKey.fromObject(object.senderSigningKey); } if (object.senderMessageKeys) { if (!Array.isArray(object.senderMessageKeys)) @@ -56022,7 +56723,7 @@ $root.proto = (function() { for (var i = 0; i < object.senderMessageKeys.length; ++i) { if (typeof object.senderMessageKeys[i] !== "object") throw TypeError(".proto.SenderKeyStateStructure.senderMessageKeys: object expected"); - message.senderMessageKeys[i] = $root.proto.SenderMessageKey.fromObject(object.senderMessageKeys[i]); + message.senderMessageKeys[i] = $root.proto.SenderKeyStateStructure.SenderMessageKey.fromObject(object.senderMessageKeys[i]); } } return message; @@ -56051,13 +56752,13 @@ $root.proto = (function() { if (message.senderKeyId != null && message.hasOwnProperty("senderKeyId")) object.senderKeyId = message.senderKeyId; if (message.senderChainKey != null && message.hasOwnProperty("senderChainKey")) - object.senderChainKey = $root.proto.SenderChainKey.toObject(message.senderChainKey, options); + object.senderChainKey = $root.proto.SenderKeyStateStructure.SenderChainKey.toObject(message.senderChainKey, options); if (message.senderSigningKey != null && message.hasOwnProperty("senderSigningKey")) - object.senderSigningKey = $root.proto.SenderSigningKey.toObject(message.senderSigningKey, options); + object.senderSigningKey = $root.proto.SenderKeyStateStructure.SenderSigningKey.toObject(message.senderSigningKey, options); if (message.senderMessageKeys && message.senderMessageKeys.length) { object.senderMessageKeys = []; for (var j = 0; j < message.senderMessageKeys.length; ++j) - object.senderMessageKeys[j] = $root.proto.SenderMessageKey.toObject(message.senderMessageKeys[j], options); + object.senderMessageKeys[j] = $root.proto.SenderKeyStateStructure.SenderMessageKey.toObject(message.senderMessageKeys[j], options); } return object; }; @@ -56073,456 +56774,675 @@ $root.proto = (function() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + SenderKeyStateStructure.SenderChainKey = (function() { + + /** + * Properties of a SenderChainKey. + * @memberof proto.SenderKeyStateStructure + * @interface ISenderChainKey + * @property {number|null} [iteration] SenderChainKey iteration + * @property {Uint8Array|null} [seed] SenderChainKey seed + */ + + /** + * Constructs a new SenderChainKey. + * @memberof proto.SenderKeyStateStructure + * @classdesc Represents a SenderChainKey. + * @implements ISenderChainKey + * @constructor + * @param {proto.SenderKeyStateStructure.ISenderChainKey=} [properties] Properties to set + */ + function SenderChainKey(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SenderChainKey iteration. + * @member {number} iteration + * @memberof proto.SenderKeyStateStructure.SenderChainKey + * @instance + */ + SenderChainKey.prototype.iteration = 0; + + /** + * SenderChainKey seed. + * @member {Uint8Array} seed + * @memberof proto.SenderKeyStateStructure.SenderChainKey + * @instance + */ + SenderChainKey.prototype.seed = $util.newBuffer([]); + + /** + * Creates a new SenderChainKey instance using the specified properties. + * @function create + * @memberof proto.SenderKeyStateStructure.SenderChainKey + * @static + * @param {proto.SenderKeyStateStructure.ISenderChainKey=} [properties] Properties to set + * @returns {proto.SenderKeyStateStructure.SenderChainKey} SenderChainKey instance + */ + SenderChainKey.create = function create(properties) { + return new SenderChainKey(properties); + }; + + /** + * Encodes the specified SenderChainKey message. Does not implicitly {@link proto.SenderKeyStateStructure.SenderChainKey.verify|verify} messages. + * @function encode + * @memberof proto.SenderKeyStateStructure.SenderChainKey + * @static + * @param {proto.SenderKeyStateStructure.ISenderChainKey} message SenderChainKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SenderChainKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.iteration != null && Object.hasOwnProperty.call(message, "iteration")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.iteration); + if (message.seed != null && Object.hasOwnProperty.call(message, "seed")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.seed); + return writer; + }; + + /** + * Encodes the specified SenderChainKey message, length delimited. Does not implicitly {@link proto.SenderKeyStateStructure.SenderChainKey.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.SenderKeyStateStructure.SenderChainKey + * @static + * @param {proto.SenderKeyStateStructure.ISenderChainKey} message SenderChainKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SenderChainKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SenderChainKey message from the specified reader or buffer. + * @function decode + * @memberof proto.SenderKeyStateStructure.SenderChainKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.SenderKeyStateStructure.SenderChainKey} SenderChainKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SenderChainKey.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SenderKeyStateStructure.SenderChainKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.iteration = reader.uint32(); + break; + case 2: + message.seed = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SenderChainKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.SenderKeyStateStructure.SenderChainKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.SenderKeyStateStructure.SenderChainKey} SenderChainKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SenderChainKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SenderChainKey message. + * @function verify + * @memberof proto.SenderKeyStateStructure.SenderChainKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SenderChainKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.iteration != null && message.hasOwnProperty("iteration")) + if (!$util.isInteger(message.iteration)) + return "iteration: integer expected"; + if (message.seed != null && message.hasOwnProperty("seed")) + if (!(message.seed && typeof message.seed.length === "number" || $util.isString(message.seed))) + return "seed: buffer expected"; + return null; + }; + + /** + * Creates a SenderChainKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.SenderKeyStateStructure.SenderChainKey + * @static + * @param {Object.} object Plain object + * @returns {proto.SenderKeyStateStructure.SenderChainKey} SenderChainKey + */ + SenderChainKey.fromObject = function fromObject(object) { + if (object instanceof $root.proto.SenderKeyStateStructure.SenderChainKey) + return object; + var message = new $root.proto.SenderKeyStateStructure.SenderChainKey(); + if (object.iteration != null) + message.iteration = object.iteration >>> 0; + if (object.seed != null) + if (typeof object.seed === "string") + $util.base64.decode(object.seed, message.seed = $util.newBuffer($util.base64.length(object.seed)), 0); + else if (object.seed.length) + message.seed = object.seed; + return message; + }; + + /** + * Creates a plain object from a SenderChainKey message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.SenderKeyStateStructure.SenderChainKey + * @static + * @param {proto.SenderKeyStateStructure.SenderChainKey} message SenderChainKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SenderChainKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.iteration = 0; + if (options.bytes === String) + object.seed = ""; + else { + object.seed = []; + if (options.bytes !== Array) + object.seed = $util.newBuffer(object.seed); + } + } + if (message.iteration != null && message.hasOwnProperty("iteration")) + object.iteration = message.iteration; + if (message.seed != null && message.hasOwnProperty("seed")) + object.seed = options.bytes === String ? $util.base64.encode(message.seed, 0, message.seed.length) : options.bytes === Array ? Array.prototype.slice.call(message.seed) : message.seed; + return object; + }; + + /** + * Converts this SenderChainKey to JSON. + * @function toJSON + * @memberof proto.SenderKeyStateStructure.SenderChainKey + * @instance + * @returns {Object.} JSON object + */ + SenderChainKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SenderChainKey; + })(); + + SenderKeyStateStructure.SenderMessageKey = (function() { + + /** + * Properties of a SenderMessageKey. + * @memberof proto.SenderKeyStateStructure + * @interface ISenderMessageKey + * @property {number|null} [iteration] SenderMessageKey iteration + * @property {Uint8Array|null} [seed] SenderMessageKey seed + */ + + /** + * Constructs a new SenderMessageKey. + * @memberof proto.SenderKeyStateStructure + * @classdesc Represents a SenderMessageKey. + * @implements ISenderMessageKey + * @constructor + * @param {proto.SenderKeyStateStructure.ISenderMessageKey=} [properties] Properties to set + */ + function SenderMessageKey(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SenderMessageKey iteration. + * @member {number} iteration + * @memberof proto.SenderKeyStateStructure.SenderMessageKey + * @instance + */ + SenderMessageKey.prototype.iteration = 0; + + /** + * SenderMessageKey seed. + * @member {Uint8Array} seed + * @memberof proto.SenderKeyStateStructure.SenderMessageKey + * @instance + */ + SenderMessageKey.prototype.seed = $util.newBuffer([]); + + /** + * Creates a new SenderMessageKey instance using the specified properties. + * @function create + * @memberof proto.SenderKeyStateStructure.SenderMessageKey + * @static + * @param {proto.SenderKeyStateStructure.ISenderMessageKey=} [properties] Properties to set + * @returns {proto.SenderKeyStateStructure.SenderMessageKey} SenderMessageKey instance + */ + SenderMessageKey.create = function create(properties) { + return new SenderMessageKey(properties); + }; + + /** + * Encodes the specified SenderMessageKey message. Does not implicitly {@link proto.SenderKeyStateStructure.SenderMessageKey.verify|verify} messages. + * @function encode + * @memberof proto.SenderKeyStateStructure.SenderMessageKey + * @static + * @param {proto.SenderKeyStateStructure.ISenderMessageKey} message SenderMessageKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SenderMessageKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.iteration != null && Object.hasOwnProperty.call(message, "iteration")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.iteration); + if (message.seed != null && Object.hasOwnProperty.call(message, "seed")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.seed); + return writer; + }; + + /** + * Encodes the specified SenderMessageKey message, length delimited. Does not implicitly {@link proto.SenderKeyStateStructure.SenderMessageKey.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.SenderKeyStateStructure.SenderMessageKey + * @static + * @param {proto.SenderKeyStateStructure.ISenderMessageKey} message SenderMessageKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SenderMessageKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SenderMessageKey message from the specified reader or buffer. + * @function decode + * @memberof proto.SenderKeyStateStructure.SenderMessageKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.SenderKeyStateStructure.SenderMessageKey} SenderMessageKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SenderMessageKey.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SenderKeyStateStructure.SenderMessageKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.iteration = reader.uint32(); + break; + case 2: + message.seed = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SenderMessageKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.SenderKeyStateStructure.SenderMessageKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.SenderKeyStateStructure.SenderMessageKey} SenderMessageKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SenderMessageKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SenderMessageKey message. + * @function verify + * @memberof proto.SenderKeyStateStructure.SenderMessageKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SenderMessageKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.iteration != null && message.hasOwnProperty("iteration")) + if (!$util.isInteger(message.iteration)) + return "iteration: integer expected"; + if (message.seed != null && message.hasOwnProperty("seed")) + if (!(message.seed && typeof message.seed.length === "number" || $util.isString(message.seed))) + return "seed: buffer expected"; + return null; + }; + + /** + * Creates a SenderMessageKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.SenderKeyStateStructure.SenderMessageKey + * @static + * @param {Object.} object Plain object + * @returns {proto.SenderKeyStateStructure.SenderMessageKey} SenderMessageKey + */ + SenderMessageKey.fromObject = function fromObject(object) { + if (object instanceof $root.proto.SenderKeyStateStructure.SenderMessageKey) + return object; + var message = new $root.proto.SenderKeyStateStructure.SenderMessageKey(); + if (object.iteration != null) + message.iteration = object.iteration >>> 0; + if (object.seed != null) + if (typeof object.seed === "string") + $util.base64.decode(object.seed, message.seed = $util.newBuffer($util.base64.length(object.seed)), 0); + else if (object.seed.length) + message.seed = object.seed; + return message; + }; + + /** + * Creates a plain object from a SenderMessageKey message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.SenderKeyStateStructure.SenderMessageKey + * @static + * @param {proto.SenderKeyStateStructure.SenderMessageKey} message SenderMessageKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SenderMessageKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.iteration = 0; + if (options.bytes === String) + object.seed = ""; + else { + object.seed = []; + if (options.bytes !== Array) + object.seed = $util.newBuffer(object.seed); + } + } + if (message.iteration != null && message.hasOwnProperty("iteration")) + object.iteration = message.iteration; + if (message.seed != null && message.hasOwnProperty("seed")) + object.seed = options.bytes === String ? $util.base64.encode(message.seed, 0, message.seed.length) : options.bytes === Array ? Array.prototype.slice.call(message.seed) : message.seed; + return object; + }; + + /** + * Converts this SenderMessageKey to JSON. + * @function toJSON + * @memberof proto.SenderKeyStateStructure.SenderMessageKey + * @instance + * @returns {Object.} JSON object + */ + SenderMessageKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SenderMessageKey; + })(); + + SenderKeyStateStructure.SenderSigningKey = (function() { + + /** + * Properties of a SenderSigningKey. + * @memberof proto.SenderKeyStateStructure + * @interface ISenderSigningKey + * @property {Uint8Array|null} ["public"] SenderSigningKey public + * @property {Uint8Array|null} ["private"] SenderSigningKey private + */ + + /** + * Constructs a new SenderSigningKey. + * @memberof proto.SenderKeyStateStructure + * @classdesc Represents a SenderSigningKey. + * @implements ISenderSigningKey + * @constructor + * @param {proto.SenderKeyStateStructure.ISenderSigningKey=} [properties] Properties to set + */ + function SenderSigningKey(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SenderSigningKey public. + * @member {Uint8Array} public + * @memberof proto.SenderKeyStateStructure.SenderSigningKey + * @instance + */ + SenderSigningKey.prototype["public"] = $util.newBuffer([]); + + /** + * SenderSigningKey private. + * @member {Uint8Array} private + * @memberof proto.SenderKeyStateStructure.SenderSigningKey + * @instance + */ + SenderSigningKey.prototype["private"] = $util.newBuffer([]); + + /** + * Creates a new SenderSigningKey instance using the specified properties. + * @function create + * @memberof proto.SenderKeyStateStructure.SenderSigningKey + * @static + * @param {proto.SenderKeyStateStructure.ISenderSigningKey=} [properties] Properties to set + * @returns {proto.SenderKeyStateStructure.SenderSigningKey} SenderSigningKey instance + */ + SenderSigningKey.create = function create(properties) { + return new SenderSigningKey(properties); + }; + + /** + * Encodes the specified SenderSigningKey message. Does not implicitly {@link proto.SenderKeyStateStructure.SenderSigningKey.verify|verify} messages. + * @function encode + * @memberof proto.SenderKeyStateStructure.SenderSigningKey + * @static + * @param {proto.SenderKeyStateStructure.ISenderSigningKey} message SenderSigningKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SenderSigningKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message["public"] != null && Object.hasOwnProperty.call(message, "public")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message["public"]); + if (message["private"] != null && Object.hasOwnProperty.call(message, "private")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message["private"]); + return writer; + }; + + /** + * Encodes the specified SenderSigningKey message, length delimited. Does not implicitly {@link proto.SenderKeyStateStructure.SenderSigningKey.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.SenderKeyStateStructure.SenderSigningKey + * @static + * @param {proto.SenderKeyStateStructure.ISenderSigningKey} message SenderSigningKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SenderSigningKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SenderSigningKey message from the specified reader or buffer. + * @function decode + * @memberof proto.SenderKeyStateStructure.SenderSigningKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.SenderKeyStateStructure.SenderSigningKey} SenderSigningKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SenderSigningKey.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SenderKeyStateStructure.SenderSigningKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message["public"] = reader.bytes(); + break; + case 2: + message["private"] = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SenderSigningKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.SenderKeyStateStructure.SenderSigningKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.SenderKeyStateStructure.SenderSigningKey} SenderSigningKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SenderSigningKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SenderSigningKey message. + * @function verify + * @memberof proto.SenderKeyStateStructure.SenderSigningKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SenderSigningKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message["public"] != null && message.hasOwnProperty("public")) + if (!(message["public"] && typeof message["public"].length === "number" || $util.isString(message["public"]))) + return "public: buffer expected"; + if (message["private"] != null && message.hasOwnProperty("private")) + if (!(message["private"] && typeof message["private"].length === "number" || $util.isString(message["private"]))) + return "private: buffer expected"; + return null; + }; + + /** + * Creates a SenderSigningKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.SenderKeyStateStructure.SenderSigningKey + * @static + * @param {Object.} object Plain object + * @returns {proto.SenderKeyStateStructure.SenderSigningKey} SenderSigningKey + */ + SenderSigningKey.fromObject = function fromObject(object) { + if (object instanceof $root.proto.SenderKeyStateStructure.SenderSigningKey) + return object; + var message = new $root.proto.SenderKeyStateStructure.SenderSigningKey(); + if (object["public"] != null) + if (typeof object["public"] === "string") + $util.base64.decode(object["public"], message["public"] = $util.newBuffer($util.base64.length(object["public"])), 0); + else if (object["public"].length) + message["public"] = object["public"]; + if (object["private"] != null) + if (typeof object["private"] === "string") + $util.base64.decode(object["private"], message["private"] = $util.newBuffer($util.base64.length(object["private"])), 0); + else if (object["private"].length) + message["private"] = object["private"]; + return message; + }; + + /** + * Creates a plain object from a SenderSigningKey message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.SenderKeyStateStructure.SenderSigningKey + * @static + * @param {proto.SenderKeyStateStructure.SenderSigningKey} message SenderSigningKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SenderSigningKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object["public"] = ""; + else { + object["public"] = []; + if (options.bytes !== Array) + object["public"] = $util.newBuffer(object["public"]); + } + if (options.bytes === String) + object["private"] = ""; + else { + object["private"] = []; + if (options.bytes !== Array) + object["private"] = $util.newBuffer(object["private"]); + } + } + if (message["public"] != null && message.hasOwnProperty("public")) + object["public"] = options.bytes === String ? $util.base64.encode(message["public"], 0, message["public"].length) : options.bytes === Array ? Array.prototype.slice.call(message["public"]) : message["public"]; + if (message["private"] != null && message.hasOwnProperty("private")) + object["private"] = options.bytes === String ? $util.base64.encode(message["private"], 0, message["private"].length) : options.bytes === Array ? Array.prototype.slice.call(message["private"]) : message["private"]; + return object; + }; + + /** + * Converts this SenderSigningKey to JSON. + * @function toJSON + * @memberof proto.SenderKeyStateStructure.SenderSigningKey + * @instance + * @returns {Object.} JSON object + */ + SenderSigningKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SenderSigningKey; + })(); + return SenderKeyStateStructure; })(); - proto.SenderMessageKey = (function() { - - /** - * Properties of a SenderMessageKey. - * @memberof proto - * @interface ISenderMessageKey - * @property {number|null} [iteration] SenderMessageKey iteration - * @property {Uint8Array|null} [seed] SenderMessageKey seed - */ - - /** - * Constructs a new SenderMessageKey. - * @memberof proto - * @classdesc Represents a SenderMessageKey. - * @implements ISenderMessageKey - * @constructor - * @param {proto.ISenderMessageKey=} [properties] Properties to set - */ - function SenderMessageKey(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SenderMessageKey iteration. - * @member {number} iteration - * @memberof proto.SenderMessageKey - * @instance - */ - SenderMessageKey.prototype.iteration = 0; - - /** - * SenderMessageKey seed. - * @member {Uint8Array} seed - * @memberof proto.SenderMessageKey - * @instance - */ - SenderMessageKey.prototype.seed = $util.newBuffer([]); - - /** - * Creates a new SenderMessageKey instance using the specified properties. - * @function create - * @memberof proto.SenderMessageKey - * @static - * @param {proto.ISenderMessageKey=} [properties] Properties to set - * @returns {proto.SenderMessageKey} SenderMessageKey instance - */ - SenderMessageKey.create = function create(properties) { - return new SenderMessageKey(properties); - }; - - /** - * Encodes the specified SenderMessageKey message. Does not implicitly {@link proto.SenderMessageKey.verify|verify} messages. - * @function encode - * @memberof proto.SenderMessageKey - * @static - * @param {proto.ISenderMessageKey} message SenderMessageKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SenderMessageKey.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.iteration != null && Object.hasOwnProperty.call(message, "iteration")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.iteration); - if (message.seed != null && Object.hasOwnProperty.call(message, "seed")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.seed); - return writer; - }; - - /** - * Encodes the specified SenderMessageKey message, length delimited. Does not implicitly {@link proto.SenderMessageKey.verify|verify} messages. - * @function encodeDelimited - * @memberof proto.SenderMessageKey - * @static - * @param {proto.ISenderMessageKey} message SenderMessageKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SenderMessageKey.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SenderMessageKey message from the specified reader or buffer. - * @function decode - * @memberof proto.SenderMessageKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {proto.SenderMessageKey} SenderMessageKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SenderMessageKey.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SenderMessageKey(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.iteration = reader.uint32(); - break; - case 2: - message.seed = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SenderMessageKey message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof proto.SenderMessageKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.SenderMessageKey} SenderMessageKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SenderMessageKey.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SenderMessageKey message. - * @function verify - * @memberof proto.SenderMessageKey - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SenderMessageKey.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.iteration != null && message.hasOwnProperty("iteration")) - if (!$util.isInteger(message.iteration)) - return "iteration: integer expected"; - if (message.seed != null && message.hasOwnProperty("seed")) - if (!(message.seed && typeof message.seed.length === "number" || $util.isString(message.seed))) - return "seed: buffer expected"; - return null; - }; - - /** - * Creates a SenderMessageKey message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof proto.SenderMessageKey - * @static - * @param {Object.} object Plain object - * @returns {proto.SenderMessageKey} SenderMessageKey - */ - SenderMessageKey.fromObject = function fromObject(object) { - if (object instanceof $root.proto.SenderMessageKey) - return object; - var message = new $root.proto.SenderMessageKey(); - if (object.iteration != null) - message.iteration = object.iteration >>> 0; - if (object.seed != null) - if (typeof object.seed === "string") - $util.base64.decode(object.seed, message.seed = $util.newBuffer($util.base64.length(object.seed)), 0); - else if (object.seed.length) - message.seed = object.seed; - return message; - }; - - /** - * Creates a plain object from a SenderMessageKey message. Also converts values to other types if specified. - * @function toObject - * @memberof proto.SenderMessageKey - * @static - * @param {proto.SenderMessageKey} message SenderMessageKey - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SenderMessageKey.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.iteration = 0; - if (options.bytes === String) - object.seed = ""; - else { - object.seed = []; - if (options.bytes !== Array) - object.seed = $util.newBuffer(object.seed); - } - } - if (message.iteration != null && message.hasOwnProperty("iteration")) - object.iteration = message.iteration; - if (message.seed != null && message.hasOwnProperty("seed")) - object.seed = options.bytes === String ? $util.base64.encode(message.seed, 0, message.seed.length) : options.bytes === Array ? Array.prototype.slice.call(message.seed) : message.seed; - return object; - }; - - /** - * Converts this SenderMessageKey to JSON. - * @function toJSON - * @memberof proto.SenderMessageKey - * @instance - * @returns {Object.} JSON object - */ - SenderMessageKey.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SenderMessageKey; - })(); - - proto.SenderSigningKey = (function() { - - /** - * Properties of a SenderSigningKey. - * @memberof proto - * @interface ISenderSigningKey - * @property {Uint8Array|null} ["public"] SenderSigningKey public - * @property {Uint8Array|null} ["private"] SenderSigningKey private - */ - - /** - * Constructs a new SenderSigningKey. - * @memberof proto - * @classdesc Represents a SenderSigningKey. - * @implements ISenderSigningKey - * @constructor - * @param {proto.ISenderSigningKey=} [properties] Properties to set - */ - function SenderSigningKey(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SenderSigningKey public. - * @member {Uint8Array} public - * @memberof proto.SenderSigningKey - * @instance - */ - SenderSigningKey.prototype["public"] = $util.newBuffer([]); - - /** - * SenderSigningKey private. - * @member {Uint8Array} private - * @memberof proto.SenderSigningKey - * @instance - */ - SenderSigningKey.prototype["private"] = $util.newBuffer([]); - - /** - * Creates a new SenderSigningKey instance using the specified properties. - * @function create - * @memberof proto.SenderSigningKey - * @static - * @param {proto.ISenderSigningKey=} [properties] Properties to set - * @returns {proto.SenderSigningKey} SenderSigningKey instance - */ - SenderSigningKey.create = function create(properties) { - return new SenderSigningKey(properties); - }; - - /** - * Encodes the specified SenderSigningKey message. Does not implicitly {@link proto.SenderSigningKey.verify|verify} messages. - * @function encode - * @memberof proto.SenderSigningKey - * @static - * @param {proto.ISenderSigningKey} message SenderSigningKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SenderSigningKey.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message["public"] != null && Object.hasOwnProperty.call(message, "public")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message["public"]); - if (message["private"] != null && Object.hasOwnProperty.call(message, "private")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message["private"]); - return writer; - }; - - /** - * Encodes the specified SenderSigningKey message, length delimited. Does not implicitly {@link proto.SenderSigningKey.verify|verify} messages. - * @function encodeDelimited - * @memberof proto.SenderSigningKey - * @static - * @param {proto.ISenderSigningKey} message SenderSigningKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SenderSigningKey.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SenderSigningKey message from the specified reader or buffer. - * @function decode - * @memberof proto.SenderSigningKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {proto.SenderSigningKey} SenderSigningKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SenderSigningKey.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SenderSigningKey(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message["public"] = reader.bytes(); - break; - case 2: - message["private"] = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SenderSigningKey message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof proto.SenderSigningKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.SenderSigningKey} SenderSigningKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SenderSigningKey.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SenderSigningKey message. - * @function verify - * @memberof proto.SenderSigningKey - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SenderSigningKey.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message["public"] != null && message.hasOwnProperty("public")) - if (!(message["public"] && typeof message["public"].length === "number" || $util.isString(message["public"]))) - return "public: buffer expected"; - if (message["private"] != null && message.hasOwnProperty("private")) - if (!(message["private"] && typeof message["private"].length === "number" || $util.isString(message["private"]))) - return "private: buffer expected"; - return null; - }; - - /** - * Creates a SenderSigningKey message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof proto.SenderSigningKey - * @static - * @param {Object.} object Plain object - * @returns {proto.SenderSigningKey} SenderSigningKey - */ - SenderSigningKey.fromObject = function fromObject(object) { - if (object instanceof $root.proto.SenderSigningKey) - return object; - var message = new $root.proto.SenderSigningKey(); - if (object["public"] != null) - if (typeof object["public"] === "string") - $util.base64.decode(object["public"], message["public"] = $util.newBuffer($util.base64.length(object["public"])), 0); - else if (object["public"].length) - message["public"] = object["public"]; - if (object["private"] != null) - if (typeof object["private"] === "string") - $util.base64.decode(object["private"], message["private"] = $util.newBuffer($util.base64.length(object["private"])), 0); - else if (object["private"].length) - message["private"] = object["private"]; - return message; - }; - - /** - * Creates a plain object from a SenderSigningKey message. Also converts values to other types if specified. - * @function toObject - * @memberof proto.SenderSigningKey - * @static - * @param {proto.SenderSigningKey} message SenderSigningKey - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SenderSigningKey.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object["public"] = ""; - else { - object["public"] = []; - if (options.bytes !== Array) - object["public"] = $util.newBuffer(object["public"]); - } - if (options.bytes === String) - object["private"] = ""; - else { - object["private"] = []; - if (options.bytes !== Array) - object["private"] = $util.newBuffer(object["private"]); - } - } - if (message["public"] != null && message.hasOwnProperty("public")) - object["public"] = options.bytes === String ? $util.base64.encode(message["public"], 0, message["public"].length) : options.bytes === Array ? Array.prototype.slice.call(message["public"]) : message["public"]; - if (message["private"] != null && message.hasOwnProperty("private")) - object["private"] = options.bytes === String ? $util.base64.encode(message["private"], 0, message["private"].length) : options.bytes === Array ? Array.prototype.slice.call(message["private"]) : message["private"]; - return object; - }; - - /** - * Converts this SenderSigningKey to JSON. - * @function toJSON - * @memberof proto.SenderSigningKey - * @instance - * @returns {Object.} JSON object - */ - SenderSigningKey.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SenderSigningKey; - })(); - proto.ServerErrorReceipt = (function() { /** @@ -56721,10 +57641,10 @@ $root.proto = (function() { * @property {Uint8Array|null} [remoteIdentityPublic] SessionStructure remoteIdentityPublic * @property {Uint8Array|null} [rootKey] SessionStructure rootKey * @property {number|null} [previousCounter] SessionStructure previousCounter - * @property {proto.IChain|null} [senderChain] SessionStructure senderChain - * @property {Array.|null} [receiverChains] SessionStructure receiverChains - * @property {proto.IPendingKeyExchange|null} [pendingKeyExchange] SessionStructure pendingKeyExchange - * @property {proto.IPendingPreKey|null} [pendingPreKey] SessionStructure pendingPreKey + * @property {proto.SessionStructure.IChain|null} [senderChain] SessionStructure senderChain + * @property {Array.|null} [receiverChains] SessionStructure receiverChains + * @property {proto.SessionStructure.IPendingKeyExchange|null} [pendingKeyExchange] SessionStructure pendingKeyExchange + * @property {proto.SessionStructure.IPendingPreKey|null} [pendingPreKey] SessionStructure pendingPreKey * @property {number|null} [remoteRegistrationId] SessionStructure remoteRegistrationId * @property {number|null} [localRegistrationId] SessionStructure localRegistrationId * @property {boolean|null} [needsRefresh] SessionStructure needsRefresh @@ -56789,7 +57709,7 @@ $root.proto = (function() { /** * SessionStructure senderChain. - * @member {proto.IChain|null|undefined} senderChain + * @member {proto.SessionStructure.IChain|null|undefined} senderChain * @memberof proto.SessionStructure * @instance */ @@ -56797,7 +57717,7 @@ $root.proto = (function() { /** * SessionStructure receiverChains. - * @member {Array.} receiverChains + * @member {Array.} receiverChains * @memberof proto.SessionStructure * @instance */ @@ -56805,7 +57725,7 @@ $root.proto = (function() { /** * SessionStructure pendingKeyExchange. - * @member {proto.IPendingKeyExchange|null|undefined} pendingKeyExchange + * @member {proto.SessionStructure.IPendingKeyExchange|null|undefined} pendingKeyExchange * @memberof proto.SessionStructure * @instance */ @@ -56813,7 +57733,7 @@ $root.proto = (function() { /** * SessionStructure pendingPreKey. - * @member {proto.IPendingPreKey|null|undefined} pendingPreKey + * @member {proto.SessionStructure.IPendingPreKey|null|undefined} pendingPreKey * @memberof proto.SessionStructure * @instance */ @@ -56886,14 +57806,14 @@ $root.proto = (function() { if (message.previousCounter != null && Object.hasOwnProperty.call(message, "previousCounter")) writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.previousCounter); if (message.senderChain != null && Object.hasOwnProperty.call(message, "senderChain")) - $root.proto.Chain.encode(message.senderChain, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.proto.SessionStructure.Chain.encode(message.senderChain, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); if (message.receiverChains != null && message.receiverChains.length) for (var i = 0; i < message.receiverChains.length; ++i) - $root.proto.Chain.encode(message.receiverChains[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.proto.SessionStructure.Chain.encode(message.receiverChains[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.pendingKeyExchange != null && Object.hasOwnProperty.call(message, "pendingKeyExchange")) - $root.proto.PendingKeyExchange.encode(message.pendingKeyExchange, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + $root.proto.SessionStructure.PendingKeyExchange.encode(message.pendingKeyExchange, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); if (message.pendingPreKey != null && Object.hasOwnProperty.call(message, "pendingPreKey")) - $root.proto.PendingPreKey.encode(message.pendingPreKey, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + $root.proto.SessionStructure.PendingPreKey.encode(message.pendingPreKey, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); if (message.remoteRegistrationId != null && Object.hasOwnProperty.call(message, "remoteRegistrationId")) writer.uint32(/* id 10, wireType 0 =*/80).uint32(message.remoteRegistrationId); if (message.localRegistrationId != null && Object.hasOwnProperty.call(message, "localRegistrationId")) @@ -56952,18 +57872,18 @@ $root.proto = (function() { message.previousCounter = reader.uint32(); break; case 6: - message.senderChain = $root.proto.Chain.decode(reader, reader.uint32()); + message.senderChain = $root.proto.SessionStructure.Chain.decode(reader, reader.uint32()); break; case 7: if (!(message.receiverChains && message.receiverChains.length)) message.receiverChains = []; - message.receiverChains.push($root.proto.Chain.decode(reader, reader.uint32())); + message.receiverChains.push($root.proto.SessionStructure.Chain.decode(reader, reader.uint32())); break; case 8: - message.pendingKeyExchange = $root.proto.PendingKeyExchange.decode(reader, reader.uint32()); + message.pendingKeyExchange = $root.proto.SessionStructure.PendingKeyExchange.decode(reader, reader.uint32()); break; case 9: - message.pendingPreKey = $root.proto.PendingPreKey.decode(reader, reader.uint32()); + message.pendingPreKey = $root.proto.SessionStructure.PendingPreKey.decode(reader, reader.uint32()); break; case 10: message.remoteRegistrationId = reader.uint32(); @@ -57028,7 +57948,7 @@ $root.proto = (function() { if (!$util.isInteger(message.previousCounter)) return "previousCounter: integer expected"; if (message.senderChain != null && message.hasOwnProperty("senderChain")) { - var error = $root.proto.Chain.verify(message.senderChain); + var error = $root.proto.SessionStructure.Chain.verify(message.senderChain); if (error) return "senderChain." + error; } @@ -57036,18 +57956,18 @@ $root.proto = (function() { if (!Array.isArray(message.receiverChains)) return "receiverChains: array expected"; for (var i = 0; i < message.receiverChains.length; ++i) { - var error = $root.proto.Chain.verify(message.receiverChains[i]); + var error = $root.proto.SessionStructure.Chain.verify(message.receiverChains[i]); if (error) return "receiverChains." + error; } } if (message.pendingKeyExchange != null && message.hasOwnProperty("pendingKeyExchange")) { - var error = $root.proto.PendingKeyExchange.verify(message.pendingKeyExchange); + var error = $root.proto.SessionStructure.PendingKeyExchange.verify(message.pendingKeyExchange); if (error) return "pendingKeyExchange." + error; } if (message.pendingPreKey != null && message.hasOwnProperty("pendingPreKey")) { - var error = $root.proto.PendingPreKey.verify(message.pendingPreKey); + var error = $root.proto.SessionStructure.PendingPreKey.verify(message.pendingPreKey); if (error) return "pendingPreKey." + error; } @@ -57100,7 +58020,7 @@ $root.proto = (function() { if (object.senderChain != null) { if (typeof object.senderChain !== "object") throw TypeError(".proto.SessionStructure.senderChain: object expected"); - message.senderChain = $root.proto.Chain.fromObject(object.senderChain); + message.senderChain = $root.proto.SessionStructure.Chain.fromObject(object.senderChain); } if (object.receiverChains) { if (!Array.isArray(object.receiverChains)) @@ -57109,18 +58029,18 @@ $root.proto = (function() { for (var i = 0; i < object.receiverChains.length; ++i) { if (typeof object.receiverChains[i] !== "object") throw TypeError(".proto.SessionStructure.receiverChains: object expected"); - message.receiverChains[i] = $root.proto.Chain.fromObject(object.receiverChains[i]); + message.receiverChains[i] = $root.proto.SessionStructure.Chain.fromObject(object.receiverChains[i]); } } if (object.pendingKeyExchange != null) { if (typeof object.pendingKeyExchange !== "object") throw TypeError(".proto.SessionStructure.pendingKeyExchange: object expected"); - message.pendingKeyExchange = $root.proto.PendingKeyExchange.fromObject(object.pendingKeyExchange); + message.pendingKeyExchange = $root.proto.SessionStructure.PendingKeyExchange.fromObject(object.pendingKeyExchange); } if (object.pendingPreKey != null) { if (typeof object.pendingPreKey !== "object") throw TypeError(".proto.SessionStructure.pendingPreKey: object expected"); - message.pendingPreKey = $root.proto.PendingPreKey.fromObject(object.pendingPreKey); + message.pendingPreKey = $root.proto.SessionStructure.PendingPreKey.fromObject(object.pendingPreKey); } if (object.remoteRegistrationId != null) message.remoteRegistrationId = object.remoteRegistrationId >>> 0; @@ -57200,16 +58120,16 @@ $root.proto = (function() { if (message.previousCounter != null && message.hasOwnProperty("previousCounter")) object.previousCounter = message.previousCounter; if (message.senderChain != null && message.hasOwnProperty("senderChain")) - object.senderChain = $root.proto.Chain.toObject(message.senderChain, options); + object.senderChain = $root.proto.SessionStructure.Chain.toObject(message.senderChain, options); if (message.receiverChains && message.receiverChains.length) { object.receiverChains = []; for (var j = 0; j < message.receiverChains.length; ++j) - object.receiverChains[j] = $root.proto.Chain.toObject(message.receiverChains[j], options); + object.receiverChains[j] = $root.proto.SessionStructure.Chain.toObject(message.receiverChains[j], options); } if (message.pendingKeyExchange != null && message.hasOwnProperty("pendingKeyExchange")) - object.pendingKeyExchange = $root.proto.PendingKeyExchange.toObject(message.pendingKeyExchange, options); + object.pendingKeyExchange = $root.proto.SessionStructure.PendingKeyExchange.toObject(message.pendingKeyExchange, options); if (message.pendingPreKey != null && message.hasOwnProperty("pendingPreKey")) - object.pendingPreKey = $root.proto.PendingPreKey.toObject(message.pendingPreKey, options); + object.pendingPreKey = $root.proto.SessionStructure.PendingPreKey.toObject(message.pendingPreKey, options); if (message.remoteRegistrationId != null && message.hasOwnProperty("remoteRegistrationId")) object.remoteRegistrationId = message.remoteRegistrationId; if (message.localRegistrationId != null && message.hasOwnProperty("localRegistrationId")) @@ -57232,6 +58152,1420 @@ $root.proto = (function() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + SessionStructure.Chain = (function() { + + /** + * Properties of a Chain. + * @memberof proto.SessionStructure + * @interface IChain + * @property {Uint8Array|null} [senderRatchetKey] Chain senderRatchetKey + * @property {Uint8Array|null} [senderRatchetKeyPrivate] Chain senderRatchetKeyPrivate + * @property {proto.SessionStructure.Chain.IChainKey|null} [chainKey] Chain chainKey + * @property {Array.|null} [messageKeys] Chain messageKeys + */ + + /** + * Constructs a new Chain. + * @memberof proto.SessionStructure + * @classdesc Represents a Chain. + * @implements IChain + * @constructor + * @param {proto.SessionStructure.IChain=} [properties] Properties to set + */ + function Chain(properties) { + this.messageKeys = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Chain senderRatchetKey. + * @member {Uint8Array} senderRatchetKey + * @memberof proto.SessionStructure.Chain + * @instance + */ + Chain.prototype.senderRatchetKey = $util.newBuffer([]); + + /** + * Chain senderRatchetKeyPrivate. + * @member {Uint8Array} senderRatchetKeyPrivate + * @memberof proto.SessionStructure.Chain + * @instance + */ + Chain.prototype.senderRatchetKeyPrivate = $util.newBuffer([]); + + /** + * Chain chainKey. + * @member {proto.SessionStructure.Chain.IChainKey|null|undefined} chainKey + * @memberof proto.SessionStructure.Chain + * @instance + */ + Chain.prototype.chainKey = null; + + /** + * Chain messageKeys. + * @member {Array.} messageKeys + * @memberof proto.SessionStructure.Chain + * @instance + */ + Chain.prototype.messageKeys = $util.emptyArray; + + /** + * Creates a new Chain instance using the specified properties. + * @function create + * @memberof proto.SessionStructure.Chain + * @static + * @param {proto.SessionStructure.IChain=} [properties] Properties to set + * @returns {proto.SessionStructure.Chain} Chain instance + */ + Chain.create = function create(properties) { + return new Chain(properties); + }; + + /** + * Encodes the specified Chain message. Does not implicitly {@link proto.SessionStructure.Chain.verify|verify} messages. + * @function encode + * @memberof proto.SessionStructure.Chain + * @static + * @param {proto.SessionStructure.IChain} message Chain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Chain.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.senderRatchetKey != null && Object.hasOwnProperty.call(message, "senderRatchetKey")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.senderRatchetKey); + if (message.senderRatchetKeyPrivate != null && Object.hasOwnProperty.call(message, "senderRatchetKeyPrivate")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.senderRatchetKeyPrivate); + if (message.chainKey != null && Object.hasOwnProperty.call(message, "chainKey")) + $root.proto.SessionStructure.Chain.ChainKey.encode(message.chainKey, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.messageKeys != null && message.messageKeys.length) + for (var i = 0; i < message.messageKeys.length; ++i) + $root.proto.SessionStructure.Chain.MessageKey.encode(message.messageKeys[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Chain message, length delimited. Does not implicitly {@link proto.SessionStructure.Chain.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.SessionStructure.Chain + * @static + * @param {proto.SessionStructure.IChain} message Chain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Chain.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Chain message from the specified reader or buffer. + * @function decode + * @memberof proto.SessionStructure.Chain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.SessionStructure.Chain} Chain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Chain.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SessionStructure.Chain(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.senderRatchetKey = reader.bytes(); + break; + case 2: + message.senderRatchetKeyPrivate = reader.bytes(); + break; + case 3: + message.chainKey = $root.proto.SessionStructure.Chain.ChainKey.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.messageKeys && message.messageKeys.length)) + message.messageKeys = []; + message.messageKeys.push($root.proto.SessionStructure.Chain.MessageKey.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Chain message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.SessionStructure.Chain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.SessionStructure.Chain} Chain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Chain.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Chain message. + * @function verify + * @memberof proto.SessionStructure.Chain + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Chain.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.senderRatchetKey != null && message.hasOwnProperty("senderRatchetKey")) + if (!(message.senderRatchetKey && typeof message.senderRatchetKey.length === "number" || $util.isString(message.senderRatchetKey))) + return "senderRatchetKey: buffer expected"; + if (message.senderRatchetKeyPrivate != null && message.hasOwnProperty("senderRatchetKeyPrivate")) + if (!(message.senderRatchetKeyPrivate && typeof message.senderRatchetKeyPrivate.length === "number" || $util.isString(message.senderRatchetKeyPrivate))) + return "senderRatchetKeyPrivate: buffer expected"; + if (message.chainKey != null && message.hasOwnProperty("chainKey")) { + var error = $root.proto.SessionStructure.Chain.ChainKey.verify(message.chainKey); + if (error) + return "chainKey." + error; + } + if (message.messageKeys != null && message.hasOwnProperty("messageKeys")) { + if (!Array.isArray(message.messageKeys)) + return "messageKeys: array expected"; + for (var i = 0; i < message.messageKeys.length; ++i) { + var error = $root.proto.SessionStructure.Chain.MessageKey.verify(message.messageKeys[i]); + if (error) + return "messageKeys." + error; + } + } + return null; + }; + + /** + * Creates a Chain message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.SessionStructure.Chain + * @static + * @param {Object.} object Plain object + * @returns {proto.SessionStructure.Chain} Chain + */ + Chain.fromObject = function fromObject(object) { + if (object instanceof $root.proto.SessionStructure.Chain) + return object; + var message = new $root.proto.SessionStructure.Chain(); + if (object.senderRatchetKey != null) + if (typeof object.senderRatchetKey === "string") + $util.base64.decode(object.senderRatchetKey, message.senderRatchetKey = $util.newBuffer($util.base64.length(object.senderRatchetKey)), 0); + else if (object.senderRatchetKey.length) + message.senderRatchetKey = object.senderRatchetKey; + if (object.senderRatchetKeyPrivate != null) + if (typeof object.senderRatchetKeyPrivate === "string") + $util.base64.decode(object.senderRatchetKeyPrivate, message.senderRatchetKeyPrivate = $util.newBuffer($util.base64.length(object.senderRatchetKeyPrivate)), 0); + else if (object.senderRatchetKeyPrivate.length) + message.senderRatchetKeyPrivate = object.senderRatchetKeyPrivate; + if (object.chainKey != null) { + if (typeof object.chainKey !== "object") + throw TypeError(".proto.SessionStructure.Chain.chainKey: object expected"); + message.chainKey = $root.proto.SessionStructure.Chain.ChainKey.fromObject(object.chainKey); + } + if (object.messageKeys) { + if (!Array.isArray(object.messageKeys)) + throw TypeError(".proto.SessionStructure.Chain.messageKeys: array expected"); + message.messageKeys = []; + for (var i = 0; i < object.messageKeys.length; ++i) { + if (typeof object.messageKeys[i] !== "object") + throw TypeError(".proto.SessionStructure.Chain.messageKeys: object expected"); + message.messageKeys[i] = $root.proto.SessionStructure.Chain.MessageKey.fromObject(object.messageKeys[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Chain message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.SessionStructure.Chain + * @static + * @param {proto.SessionStructure.Chain} message Chain + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Chain.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.messageKeys = []; + if (options.defaults) { + if (options.bytes === String) + object.senderRatchetKey = ""; + else { + object.senderRatchetKey = []; + if (options.bytes !== Array) + object.senderRatchetKey = $util.newBuffer(object.senderRatchetKey); + } + if (options.bytes === String) + object.senderRatchetKeyPrivate = ""; + else { + object.senderRatchetKeyPrivate = []; + if (options.bytes !== Array) + object.senderRatchetKeyPrivate = $util.newBuffer(object.senderRatchetKeyPrivate); + } + object.chainKey = null; + } + if (message.senderRatchetKey != null && message.hasOwnProperty("senderRatchetKey")) + object.senderRatchetKey = options.bytes === String ? $util.base64.encode(message.senderRatchetKey, 0, message.senderRatchetKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.senderRatchetKey) : message.senderRatchetKey; + if (message.senderRatchetKeyPrivate != null && message.hasOwnProperty("senderRatchetKeyPrivate")) + object.senderRatchetKeyPrivate = options.bytes === String ? $util.base64.encode(message.senderRatchetKeyPrivate, 0, message.senderRatchetKeyPrivate.length) : options.bytes === Array ? Array.prototype.slice.call(message.senderRatchetKeyPrivate) : message.senderRatchetKeyPrivate; + if (message.chainKey != null && message.hasOwnProperty("chainKey")) + object.chainKey = $root.proto.SessionStructure.Chain.ChainKey.toObject(message.chainKey, options); + if (message.messageKeys && message.messageKeys.length) { + object.messageKeys = []; + for (var j = 0; j < message.messageKeys.length; ++j) + object.messageKeys[j] = $root.proto.SessionStructure.Chain.MessageKey.toObject(message.messageKeys[j], options); + } + return object; + }; + + /** + * Converts this Chain to JSON. + * @function toJSON + * @memberof proto.SessionStructure.Chain + * @instance + * @returns {Object.} JSON object + */ + Chain.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Chain.ChainKey = (function() { + + /** + * Properties of a ChainKey. + * @memberof proto.SessionStructure.Chain + * @interface IChainKey + * @property {number|null} [index] ChainKey index + * @property {Uint8Array|null} [key] ChainKey key + */ + + /** + * Constructs a new ChainKey. + * @memberof proto.SessionStructure.Chain + * @classdesc Represents a ChainKey. + * @implements IChainKey + * @constructor + * @param {proto.SessionStructure.Chain.IChainKey=} [properties] Properties to set + */ + function ChainKey(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChainKey index. + * @member {number} index + * @memberof proto.SessionStructure.Chain.ChainKey + * @instance + */ + ChainKey.prototype.index = 0; + + /** + * ChainKey key. + * @member {Uint8Array} key + * @memberof proto.SessionStructure.Chain.ChainKey + * @instance + */ + ChainKey.prototype.key = $util.newBuffer([]); + + /** + * Creates a new ChainKey instance using the specified properties. + * @function create + * @memberof proto.SessionStructure.Chain.ChainKey + * @static + * @param {proto.SessionStructure.Chain.IChainKey=} [properties] Properties to set + * @returns {proto.SessionStructure.Chain.ChainKey} ChainKey instance + */ + ChainKey.create = function create(properties) { + return new ChainKey(properties); + }; + + /** + * Encodes the specified ChainKey message. Does not implicitly {@link proto.SessionStructure.Chain.ChainKey.verify|verify} messages. + * @function encode + * @memberof proto.SessionStructure.Chain.ChainKey + * @static + * @param {proto.SessionStructure.Chain.IChainKey} message ChainKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChainKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.index); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.key); + return writer; + }; + + /** + * Encodes the specified ChainKey message, length delimited. Does not implicitly {@link proto.SessionStructure.Chain.ChainKey.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.SessionStructure.Chain.ChainKey + * @static + * @param {proto.SessionStructure.Chain.IChainKey} message ChainKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChainKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChainKey message from the specified reader or buffer. + * @function decode + * @memberof proto.SessionStructure.Chain.ChainKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.SessionStructure.Chain.ChainKey} ChainKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChainKey.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SessionStructure.Chain.ChainKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.uint32(); + break; + case 2: + message.key = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChainKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.SessionStructure.Chain.ChainKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.SessionStructure.Chain.ChainKey} ChainKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChainKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChainKey message. + * @function verify + * @memberof proto.SessionStructure.Chain.ChainKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChainKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index)) + return "index: integer expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + return null; + }; + + /** + * Creates a ChainKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.SessionStructure.Chain.ChainKey + * @static + * @param {Object.} object Plain object + * @returns {proto.SessionStructure.Chain.ChainKey} ChainKey + */ + ChainKey.fromObject = function fromObject(object) { + if (object instanceof $root.proto.SessionStructure.Chain.ChainKey) + return object; + var message = new $root.proto.SessionStructure.Chain.ChainKey(); + if (object.index != null) + message.index = object.index >>> 0; + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length) + message.key = object.key; + return message; + }; + + /** + * Creates a plain object from a ChainKey message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.SessionStructure.Chain.ChainKey + * @static + * @param {proto.SessionStructure.Chain.ChainKey} message ChainKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChainKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.index = 0; + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + } + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + return object; + }; + + /** + * Converts this ChainKey to JSON. + * @function toJSON + * @memberof proto.SessionStructure.Chain.ChainKey + * @instance + * @returns {Object.} JSON object + */ + ChainKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ChainKey; + })(); + + Chain.MessageKey = (function() { + + /** + * Properties of a MessageKey. + * @memberof proto.SessionStructure.Chain + * @interface IMessageKey + * @property {number|null} [index] MessageKey index + * @property {Uint8Array|null} [cipherKey] MessageKey cipherKey + * @property {Uint8Array|null} [macKey] MessageKey macKey + * @property {Uint8Array|null} [iv] MessageKey iv + */ + + /** + * Constructs a new MessageKey. + * @memberof proto.SessionStructure.Chain + * @classdesc Represents a MessageKey. + * @implements IMessageKey + * @constructor + * @param {proto.SessionStructure.Chain.IMessageKey=} [properties] Properties to set + */ + function MessageKey(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageKey index. + * @member {number} index + * @memberof proto.SessionStructure.Chain.MessageKey + * @instance + */ + MessageKey.prototype.index = 0; + + /** + * MessageKey cipherKey. + * @member {Uint8Array} cipherKey + * @memberof proto.SessionStructure.Chain.MessageKey + * @instance + */ + MessageKey.prototype.cipherKey = $util.newBuffer([]); + + /** + * MessageKey macKey. + * @member {Uint8Array} macKey + * @memberof proto.SessionStructure.Chain.MessageKey + * @instance + */ + MessageKey.prototype.macKey = $util.newBuffer([]); + + /** + * MessageKey iv. + * @member {Uint8Array} iv + * @memberof proto.SessionStructure.Chain.MessageKey + * @instance + */ + MessageKey.prototype.iv = $util.newBuffer([]); + + /** + * Creates a new MessageKey instance using the specified properties. + * @function create + * @memberof proto.SessionStructure.Chain.MessageKey + * @static + * @param {proto.SessionStructure.Chain.IMessageKey=} [properties] Properties to set + * @returns {proto.SessionStructure.Chain.MessageKey} MessageKey instance + */ + MessageKey.create = function create(properties) { + return new MessageKey(properties); + }; + + /** + * Encodes the specified MessageKey message. Does not implicitly {@link proto.SessionStructure.Chain.MessageKey.verify|verify} messages. + * @function encode + * @memberof proto.SessionStructure.Chain.MessageKey + * @static + * @param {proto.SessionStructure.Chain.IMessageKey} message MessageKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.index); + if (message.cipherKey != null && Object.hasOwnProperty.call(message, "cipherKey")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.cipherKey); + if (message.macKey != null && Object.hasOwnProperty.call(message, "macKey")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.macKey); + if (message.iv != null && Object.hasOwnProperty.call(message, "iv")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.iv); + return writer; + }; + + /** + * Encodes the specified MessageKey message, length delimited. Does not implicitly {@link proto.SessionStructure.Chain.MessageKey.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.SessionStructure.Chain.MessageKey + * @static + * @param {proto.SessionStructure.Chain.IMessageKey} message MessageKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageKey message from the specified reader or buffer. + * @function decode + * @memberof proto.SessionStructure.Chain.MessageKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.SessionStructure.Chain.MessageKey} MessageKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageKey.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SessionStructure.Chain.MessageKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.uint32(); + break; + case 2: + message.cipherKey = reader.bytes(); + break; + case 3: + message.macKey = reader.bytes(); + break; + case 4: + message.iv = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.SessionStructure.Chain.MessageKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.SessionStructure.Chain.MessageKey} MessageKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageKey message. + * @function verify + * @memberof proto.SessionStructure.Chain.MessageKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index)) + return "index: integer expected"; + if (message.cipherKey != null && message.hasOwnProperty("cipherKey")) + if (!(message.cipherKey && typeof message.cipherKey.length === "number" || $util.isString(message.cipherKey))) + return "cipherKey: buffer expected"; + if (message.macKey != null && message.hasOwnProperty("macKey")) + if (!(message.macKey && typeof message.macKey.length === "number" || $util.isString(message.macKey))) + return "macKey: buffer expected"; + if (message.iv != null && message.hasOwnProperty("iv")) + if (!(message.iv && typeof message.iv.length === "number" || $util.isString(message.iv))) + return "iv: buffer expected"; + return null; + }; + + /** + * Creates a MessageKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.SessionStructure.Chain.MessageKey + * @static + * @param {Object.} object Plain object + * @returns {proto.SessionStructure.Chain.MessageKey} MessageKey + */ + MessageKey.fromObject = function fromObject(object) { + if (object instanceof $root.proto.SessionStructure.Chain.MessageKey) + return object; + var message = new $root.proto.SessionStructure.Chain.MessageKey(); + if (object.index != null) + message.index = object.index >>> 0; + if (object.cipherKey != null) + if (typeof object.cipherKey === "string") + $util.base64.decode(object.cipherKey, message.cipherKey = $util.newBuffer($util.base64.length(object.cipherKey)), 0); + else if (object.cipherKey.length) + message.cipherKey = object.cipherKey; + if (object.macKey != null) + if (typeof object.macKey === "string") + $util.base64.decode(object.macKey, message.macKey = $util.newBuffer($util.base64.length(object.macKey)), 0); + else if (object.macKey.length) + message.macKey = object.macKey; + if (object.iv != null) + if (typeof object.iv === "string") + $util.base64.decode(object.iv, message.iv = $util.newBuffer($util.base64.length(object.iv)), 0); + else if (object.iv.length) + message.iv = object.iv; + return message; + }; + + /** + * Creates a plain object from a MessageKey message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.SessionStructure.Chain.MessageKey + * @static + * @param {proto.SessionStructure.Chain.MessageKey} message MessageKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.index = 0; + if (options.bytes === String) + object.cipherKey = ""; + else { + object.cipherKey = []; + if (options.bytes !== Array) + object.cipherKey = $util.newBuffer(object.cipherKey); + } + if (options.bytes === String) + object.macKey = ""; + else { + object.macKey = []; + if (options.bytes !== Array) + object.macKey = $util.newBuffer(object.macKey); + } + if (options.bytes === String) + object.iv = ""; + else { + object.iv = []; + if (options.bytes !== Array) + object.iv = $util.newBuffer(object.iv); + } + } + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; + if (message.cipherKey != null && message.hasOwnProperty("cipherKey")) + object.cipherKey = options.bytes === String ? $util.base64.encode(message.cipherKey, 0, message.cipherKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.cipherKey) : message.cipherKey; + if (message.macKey != null && message.hasOwnProperty("macKey")) + object.macKey = options.bytes === String ? $util.base64.encode(message.macKey, 0, message.macKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.macKey) : message.macKey; + if (message.iv != null && message.hasOwnProperty("iv")) + object.iv = options.bytes === String ? $util.base64.encode(message.iv, 0, message.iv.length) : options.bytes === Array ? Array.prototype.slice.call(message.iv) : message.iv; + return object; + }; + + /** + * Converts this MessageKey to JSON. + * @function toJSON + * @memberof proto.SessionStructure.Chain.MessageKey + * @instance + * @returns {Object.} JSON object + */ + MessageKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MessageKey; + })(); + + return Chain; + })(); + + SessionStructure.PendingKeyExchange = (function() { + + /** + * Properties of a PendingKeyExchange. + * @memberof proto.SessionStructure + * @interface IPendingKeyExchange + * @property {number|null} [sequence] PendingKeyExchange sequence + * @property {Uint8Array|null} [localBaseKey] PendingKeyExchange localBaseKey + * @property {Uint8Array|null} [localBaseKeyPrivate] PendingKeyExchange localBaseKeyPrivate + * @property {Uint8Array|null} [localRatchetKey] PendingKeyExchange localRatchetKey + * @property {Uint8Array|null} [localRatchetKeyPrivate] PendingKeyExchange localRatchetKeyPrivate + * @property {Uint8Array|null} [localIdentityKey] PendingKeyExchange localIdentityKey + * @property {Uint8Array|null} [localIdentityKeyPrivate] PendingKeyExchange localIdentityKeyPrivate + */ + + /** + * Constructs a new PendingKeyExchange. + * @memberof proto.SessionStructure + * @classdesc Represents a PendingKeyExchange. + * @implements IPendingKeyExchange + * @constructor + * @param {proto.SessionStructure.IPendingKeyExchange=} [properties] Properties to set + */ + function PendingKeyExchange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PendingKeyExchange sequence. + * @member {number} sequence + * @memberof proto.SessionStructure.PendingKeyExchange + * @instance + */ + PendingKeyExchange.prototype.sequence = 0; + + /** + * PendingKeyExchange localBaseKey. + * @member {Uint8Array} localBaseKey + * @memberof proto.SessionStructure.PendingKeyExchange + * @instance + */ + PendingKeyExchange.prototype.localBaseKey = $util.newBuffer([]); + + /** + * PendingKeyExchange localBaseKeyPrivate. + * @member {Uint8Array} localBaseKeyPrivate + * @memberof proto.SessionStructure.PendingKeyExchange + * @instance + */ + PendingKeyExchange.prototype.localBaseKeyPrivate = $util.newBuffer([]); + + /** + * PendingKeyExchange localRatchetKey. + * @member {Uint8Array} localRatchetKey + * @memberof proto.SessionStructure.PendingKeyExchange + * @instance + */ + PendingKeyExchange.prototype.localRatchetKey = $util.newBuffer([]); + + /** + * PendingKeyExchange localRatchetKeyPrivate. + * @member {Uint8Array} localRatchetKeyPrivate + * @memberof proto.SessionStructure.PendingKeyExchange + * @instance + */ + PendingKeyExchange.prototype.localRatchetKeyPrivate = $util.newBuffer([]); + + /** + * PendingKeyExchange localIdentityKey. + * @member {Uint8Array} localIdentityKey + * @memberof proto.SessionStructure.PendingKeyExchange + * @instance + */ + PendingKeyExchange.prototype.localIdentityKey = $util.newBuffer([]); + + /** + * PendingKeyExchange localIdentityKeyPrivate. + * @member {Uint8Array} localIdentityKeyPrivate + * @memberof proto.SessionStructure.PendingKeyExchange + * @instance + */ + PendingKeyExchange.prototype.localIdentityKeyPrivate = $util.newBuffer([]); + + /** + * Creates a new PendingKeyExchange instance using the specified properties. + * @function create + * @memberof proto.SessionStructure.PendingKeyExchange + * @static + * @param {proto.SessionStructure.IPendingKeyExchange=} [properties] Properties to set + * @returns {proto.SessionStructure.PendingKeyExchange} PendingKeyExchange instance + */ + PendingKeyExchange.create = function create(properties) { + return new PendingKeyExchange(properties); + }; + + /** + * Encodes the specified PendingKeyExchange message. Does not implicitly {@link proto.SessionStructure.PendingKeyExchange.verify|verify} messages. + * @function encode + * @memberof proto.SessionStructure.PendingKeyExchange + * @static + * @param {proto.SessionStructure.IPendingKeyExchange} message PendingKeyExchange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingKeyExchange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.sequence); + if (message.localBaseKey != null && Object.hasOwnProperty.call(message, "localBaseKey")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.localBaseKey); + if (message.localBaseKeyPrivate != null && Object.hasOwnProperty.call(message, "localBaseKeyPrivate")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.localBaseKeyPrivate); + if (message.localRatchetKey != null && Object.hasOwnProperty.call(message, "localRatchetKey")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.localRatchetKey); + if (message.localRatchetKeyPrivate != null && Object.hasOwnProperty.call(message, "localRatchetKeyPrivate")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.localRatchetKeyPrivate); + if (message.localIdentityKey != null && Object.hasOwnProperty.call(message, "localIdentityKey")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.localIdentityKey); + if (message.localIdentityKeyPrivate != null && Object.hasOwnProperty.call(message, "localIdentityKeyPrivate")) + writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.localIdentityKeyPrivate); + return writer; + }; + + /** + * Encodes the specified PendingKeyExchange message, length delimited. Does not implicitly {@link proto.SessionStructure.PendingKeyExchange.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.SessionStructure.PendingKeyExchange + * @static + * @param {proto.SessionStructure.IPendingKeyExchange} message PendingKeyExchange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingKeyExchange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PendingKeyExchange message from the specified reader or buffer. + * @function decode + * @memberof proto.SessionStructure.PendingKeyExchange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.SessionStructure.PendingKeyExchange} PendingKeyExchange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingKeyExchange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SessionStructure.PendingKeyExchange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sequence = reader.uint32(); + break; + case 2: + message.localBaseKey = reader.bytes(); + break; + case 3: + message.localBaseKeyPrivate = reader.bytes(); + break; + case 4: + message.localRatchetKey = reader.bytes(); + break; + case 5: + message.localRatchetKeyPrivate = reader.bytes(); + break; + case 7: + message.localIdentityKey = reader.bytes(); + break; + case 8: + message.localIdentityKeyPrivate = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PendingKeyExchange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.SessionStructure.PendingKeyExchange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.SessionStructure.PendingKeyExchange} PendingKeyExchange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingKeyExchange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PendingKeyExchange message. + * @function verify + * @memberof proto.SessionStructure.PendingKeyExchange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PendingKeyExchange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sequence != null && message.hasOwnProperty("sequence")) + if (!$util.isInteger(message.sequence)) + return "sequence: integer expected"; + if (message.localBaseKey != null && message.hasOwnProperty("localBaseKey")) + if (!(message.localBaseKey && typeof message.localBaseKey.length === "number" || $util.isString(message.localBaseKey))) + return "localBaseKey: buffer expected"; + if (message.localBaseKeyPrivate != null && message.hasOwnProperty("localBaseKeyPrivate")) + if (!(message.localBaseKeyPrivate && typeof message.localBaseKeyPrivate.length === "number" || $util.isString(message.localBaseKeyPrivate))) + return "localBaseKeyPrivate: buffer expected"; + if (message.localRatchetKey != null && message.hasOwnProperty("localRatchetKey")) + if (!(message.localRatchetKey && typeof message.localRatchetKey.length === "number" || $util.isString(message.localRatchetKey))) + return "localRatchetKey: buffer expected"; + if (message.localRatchetKeyPrivate != null && message.hasOwnProperty("localRatchetKeyPrivate")) + if (!(message.localRatchetKeyPrivate && typeof message.localRatchetKeyPrivate.length === "number" || $util.isString(message.localRatchetKeyPrivate))) + return "localRatchetKeyPrivate: buffer expected"; + if (message.localIdentityKey != null && message.hasOwnProperty("localIdentityKey")) + if (!(message.localIdentityKey && typeof message.localIdentityKey.length === "number" || $util.isString(message.localIdentityKey))) + return "localIdentityKey: buffer expected"; + if (message.localIdentityKeyPrivate != null && message.hasOwnProperty("localIdentityKeyPrivate")) + if (!(message.localIdentityKeyPrivate && typeof message.localIdentityKeyPrivate.length === "number" || $util.isString(message.localIdentityKeyPrivate))) + return "localIdentityKeyPrivate: buffer expected"; + return null; + }; + + /** + * Creates a PendingKeyExchange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.SessionStructure.PendingKeyExchange + * @static + * @param {Object.} object Plain object + * @returns {proto.SessionStructure.PendingKeyExchange} PendingKeyExchange + */ + PendingKeyExchange.fromObject = function fromObject(object) { + if (object instanceof $root.proto.SessionStructure.PendingKeyExchange) + return object; + var message = new $root.proto.SessionStructure.PendingKeyExchange(); + if (object.sequence != null) + message.sequence = object.sequence >>> 0; + if (object.localBaseKey != null) + if (typeof object.localBaseKey === "string") + $util.base64.decode(object.localBaseKey, message.localBaseKey = $util.newBuffer($util.base64.length(object.localBaseKey)), 0); + else if (object.localBaseKey.length) + message.localBaseKey = object.localBaseKey; + if (object.localBaseKeyPrivate != null) + if (typeof object.localBaseKeyPrivate === "string") + $util.base64.decode(object.localBaseKeyPrivate, message.localBaseKeyPrivate = $util.newBuffer($util.base64.length(object.localBaseKeyPrivate)), 0); + else if (object.localBaseKeyPrivate.length) + message.localBaseKeyPrivate = object.localBaseKeyPrivate; + if (object.localRatchetKey != null) + if (typeof object.localRatchetKey === "string") + $util.base64.decode(object.localRatchetKey, message.localRatchetKey = $util.newBuffer($util.base64.length(object.localRatchetKey)), 0); + else if (object.localRatchetKey.length) + message.localRatchetKey = object.localRatchetKey; + if (object.localRatchetKeyPrivate != null) + if (typeof object.localRatchetKeyPrivate === "string") + $util.base64.decode(object.localRatchetKeyPrivate, message.localRatchetKeyPrivate = $util.newBuffer($util.base64.length(object.localRatchetKeyPrivate)), 0); + else if (object.localRatchetKeyPrivate.length) + message.localRatchetKeyPrivate = object.localRatchetKeyPrivate; + if (object.localIdentityKey != null) + if (typeof object.localIdentityKey === "string") + $util.base64.decode(object.localIdentityKey, message.localIdentityKey = $util.newBuffer($util.base64.length(object.localIdentityKey)), 0); + else if (object.localIdentityKey.length) + message.localIdentityKey = object.localIdentityKey; + if (object.localIdentityKeyPrivate != null) + if (typeof object.localIdentityKeyPrivate === "string") + $util.base64.decode(object.localIdentityKeyPrivate, message.localIdentityKeyPrivate = $util.newBuffer($util.base64.length(object.localIdentityKeyPrivate)), 0); + else if (object.localIdentityKeyPrivate.length) + message.localIdentityKeyPrivate = object.localIdentityKeyPrivate; + return message; + }; + + /** + * Creates a plain object from a PendingKeyExchange message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.SessionStructure.PendingKeyExchange + * @static + * @param {proto.SessionStructure.PendingKeyExchange} message PendingKeyExchange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PendingKeyExchange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sequence = 0; + if (options.bytes === String) + object.localBaseKey = ""; + else { + object.localBaseKey = []; + if (options.bytes !== Array) + object.localBaseKey = $util.newBuffer(object.localBaseKey); + } + if (options.bytes === String) + object.localBaseKeyPrivate = ""; + else { + object.localBaseKeyPrivate = []; + if (options.bytes !== Array) + object.localBaseKeyPrivate = $util.newBuffer(object.localBaseKeyPrivate); + } + if (options.bytes === String) + object.localRatchetKey = ""; + else { + object.localRatchetKey = []; + if (options.bytes !== Array) + object.localRatchetKey = $util.newBuffer(object.localRatchetKey); + } + if (options.bytes === String) + object.localRatchetKeyPrivate = ""; + else { + object.localRatchetKeyPrivate = []; + if (options.bytes !== Array) + object.localRatchetKeyPrivate = $util.newBuffer(object.localRatchetKeyPrivate); + } + if (options.bytes === String) + object.localIdentityKey = ""; + else { + object.localIdentityKey = []; + if (options.bytes !== Array) + object.localIdentityKey = $util.newBuffer(object.localIdentityKey); + } + if (options.bytes === String) + object.localIdentityKeyPrivate = ""; + else { + object.localIdentityKeyPrivate = []; + if (options.bytes !== Array) + object.localIdentityKeyPrivate = $util.newBuffer(object.localIdentityKeyPrivate); + } + } + if (message.sequence != null && message.hasOwnProperty("sequence")) + object.sequence = message.sequence; + if (message.localBaseKey != null && message.hasOwnProperty("localBaseKey")) + object.localBaseKey = options.bytes === String ? $util.base64.encode(message.localBaseKey, 0, message.localBaseKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.localBaseKey) : message.localBaseKey; + if (message.localBaseKeyPrivate != null && message.hasOwnProperty("localBaseKeyPrivate")) + object.localBaseKeyPrivate = options.bytes === String ? $util.base64.encode(message.localBaseKeyPrivate, 0, message.localBaseKeyPrivate.length) : options.bytes === Array ? Array.prototype.slice.call(message.localBaseKeyPrivate) : message.localBaseKeyPrivate; + if (message.localRatchetKey != null && message.hasOwnProperty("localRatchetKey")) + object.localRatchetKey = options.bytes === String ? $util.base64.encode(message.localRatchetKey, 0, message.localRatchetKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.localRatchetKey) : message.localRatchetKey; + if (message.localRatchetKeyPrivate != null && message.hasOwnProperty("localRatchetKeyPrivate")) + object.localRatchetKeyPrivate = options.bytes === String ? $util.base64.encode(message.localRatchetKeyPrivate, 0, message.localRatchetKeyPrivate.length) : options.bytes === Array ? Array.prototype.slice.call(message.localRatchetKeyPrivate) : message.localRatchetKeyPrivate; + if (message.localIdentityKey != null && message.hasOwnProperty("localIdentityKey")) + object.localIdentityKey = options.bytes === String ? $util.base64.encode(message.localIdentityKey, 0, message.localIdentityKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.localIdentityKey) : message.localIdentityKey; + if (message.localIdentityKeyPrivate != null && message.hasOwnProperty("localIdentityKeyPrivate")) + object.localIdentityKeyPrivate = options.bytes === String ? $util.base64.encode(message.localIdentityKeyPrivate, 0, message.localIdentityKeyPrivate.length) : options.bytes === Array ? Array.prototype.slice.call(message.localIdentityKeyPrivate) : message.localIdentityKeyPrivate; + return object; + }; + + /** + * Converts this PendingKeyExchange to JSON. + * @function toJSON + * @memberof proto.SessionStructure.PendingKeyExchange + * @instance + * @returns {Object.} JSON object + */ + PendingKeyExchange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PendingKeyExchange; + })(); + + SessionStructure.PendingPreKey = (function() { + + /** + * Properties of a PendingPreKey. + * @memberof proto.SessionStructure + * @interface IPendingPreKey + * @property {number|null} [preKeyId] PendingPreKey preKeyId + * @property {number|null} [signedPreKeyId] PendingPreKey signedPreKeyId + * @property {Uint8Array|null} [baseKey] PendingPreKey baseKey + */ + + /** + * Constructs a new PendingPreKey. + * @memberof proto.SessionStructure + * @classdesc Represents a PendingPreKey. + * @implements IPendingPreKey + * @constructor + * @param {proto.SessionStructure.IPendingPreKey=} [properties] Properties to set + */ + function PendingPreKey(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PendingPreKey preKeyId. + * @member {number} preKeyId + * @memberof proto.SessionStructure.PendingPreKey + * @instance + */ + PendingPreKey.prototype.preKeyId = 0; + + /** + * PendingPreKey signedPreKeyId. + * @member {number} signedPreKeyId + * @memberof proto.SessionStructure.PendingPreKey + * @instance + */ + PendingPreKey.prototype.signedPreKeyId = 0; + + /** + * PendingPreKey baseKey. + * @member {Uint8Array} baseKey + * @memberof proto.SessionStructure.PendingPreKey + * @instance + */ + PendingPreKey.prototype.baseKey = $util.newBuffer([]); + + /** + * Creates a new PendingPreKey instance using the specified properties. + * @function create + * @memberof proto.SessionStructure.PendingPreKey + * @static + * @param {proto.SessionStructure.IPendingPreKey=} [properties] Properties to set + * @returns {proto.SessionStructure.PendingPreKey} PendingPreKey instance + */ + PendingPreKey.create = function create(properties) { + return new PendingPreKey(properties); + }; + + /** + * Encodes the specified PendingPreKey message. Does not implicitly {@link proto.SessionStructure.PendingPreKey.verify|verify} messages. + * @function encode + * @memberof proto.SessionStructure.PendingPreKey + * @static + * @param {proto.SessionStructure.IPendingPreKey} message PendingPreKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingPreKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.preKeyId != null && Object.hasOwnProperty.call(message, "preKeyId")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.preKeyId); + if (message.baseKey != null && Object.hasOwnProperty.call(message, "baseKey")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.baseKey); + if (message.signedPreKeyId != null && Object.hasOwnProperty.call(message, "signedPreKeyId")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.signedPreKeyId); + return writer; + }; + + /** + * Encodes the specified PendingPreKey message, length delimited. Does not implicitly {@link proto.SessionStructure.PendingPreKey.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.SessionStructure.PendingPreKey + * @static + * @param {proto.SessionStructure.IPendingPreKey} message PendingPreKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingPreKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PendingPreKey message from the specified reader or buffer. + * @function decode + * @memberof proto.SessionStructure.PendingPreKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.SessionStructure.PendingPreKey} PendingPreKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingPreKey.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SessionStructure.PendingPreKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.preKeyId = reader.uint32(); + break; + case 3: + message.signedPreKeyId = reader.int32(); + break; + case 2: + message.baseKey = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PendingPreKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.SessionStructure.PendingPreKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.SessionStructure.PendingPreKey} PendingPreKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingPreKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PendingPreKey message. + * @function verify + * @memberof proto.SessionStructure.PendingPreKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PendingPreKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.preKeyId != null && message.hasOwnProperty("preKeyId")) + if (!$util.isInteger(message.preKeyId)) + return "preKeyId: integer expected"; + if (message.signedPreKeyId != null && message.hasOwnProperty("signedPreKeyId")) + if (!$util.isInteger(message.signedPreKeyId)) + return "signedPreKeyId: integer expected"; + if (message.baseKey != null && message.hasOwnProperty("baseKey")) + if (!(message.baseKey && typeof message.baseKey.length === "number" || $util.isString(message.baseKey))) + return "baseKey: buffer expected"; + return null; + }; + + /** + * Creates a PendingPreKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.SessionStructure.PendingPreKey + * @static + * @param {Object.} object Plain object + * @returns {proto.SessionStructure.PendingPreKey} PendingPreKey + */ + PendingPreKey.fromObject = function fromObject(object) { + if (object instanceof $root.proto.SessionStructure.PendingPreKey) + return object; + var message = new $root.proto.SessionStructure.PendingPreKey(); + if (object.preKeyId != null) + message.preKeyId = object.preKeyId >>> 0; + if (object.signedPreKeyId != null) + message.signedPreKeyId = object.signedPreKeyId | 0; + if (object.baseKey != null) + if (typeof object.baseKey === "string") + $util.base64.decode(object.baseKey, message.baseKey = $util.newBuffer($util.base64.length(object.baseKey)), 0); + else if (object.baseKey.length) + message.baseKey = object.baseKey; + return message; + }; + + /** + * Creates a plain object from a PendingPreKey message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.SessionStructure.PendingPreKey + * @static + * @param {proto.SessionStructure.PendingPreKey} message PendingPreKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PendingPreKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.preKeyId = 0; + if (options.bytes === String) + object.baseKey = ""; + else { + object.baseKey = []; + if (options.bytes !== Array) + object.baseKey = $util.newBuffer(object.baseKey); + } + object.signedPreKeyId = 0; + } + if (message.preKeyId != null && message.hasOwnProperty("preKeyId")) + object.preKeyId = message.preKeyId; + if (message.baseKey != null && message.hasOwnProperty("baseKey")) + object.baseKey = options.bytes === String ? $util.base64.encode(message.baseKey, 0, message.baseKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.baseKey) : message.baseKey; + if (message.signedPreKeyId != null && message.hasOwnProperty("signedPreKeyId")) + object.signedPreKeyId = message.signedPreKeyId; + return object; + }; + + /** + * Converts this PendingPreKey to JSON. + * @function toJSON + * @memberof proto.SessionStructure.PendingPreKey + * @instance + * @returns {Object.} JSON object + */ + PendingPreKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PendingPreKey; + })(); + return SessionStructure; })(); @@ -58567,6 +60901,7 @@ $root.proto = (function() { * @property {proto.SyncActionValue.IRemoveRecentStickerAction|null} [removeRecentStickerAction] SyncActionValue removeRecentStickerAction * @property {proto.SyncActionValue.IChatAssignmentAction|null} [chatAssignment] SyncActionValue chatAssignment * @property {proto.SyncActionValue.IChatAssignmentOpenedStatusAction|null} [chatAssignmentOpenedStatus] SyncActionValue chatAssignmentOpenedStatus + * @property {proto.SyncActionValue.IPnForLidChatAction|null} [pnForLidChatAction] SyncActionValue pnForLidChatAction */ /** @@ -58832,6 +61167,14 @@ $root.proto = (function() { */ SyncActionValue.prototype.chatAssignmentOpenedStatus = null; + /** + * SyncActionValue pnForLidChatAction. + * @member {proto.SyncActionValue.IPnForLidChatAction|null|undefined} pnForLidChatAction + * @memberof proto.SyncActionValue + * @instance + */ + SyncActionValue.prototype.pnForLidChatAction = null; + /** * Creates a new SyncActionValue instance using the specified properties. * @function create @@ -58918,6 +61261,8 @@ $root.proto = (function() { $root.proto.SyncActionValue.ChatAssignmentAction.encode(message.chatAssignment, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); if (message.chatAssignmentOpenedStatus != null && Object.hasOwnProperty.call(message, "chatAssignmentOpenedStatus")) $root.proto.SyncActionValue.ChatAssignmentOpenedStatusAction.encode(message.chatAssignmentOpenedStatus, writer.uint32(/* id 36, wireType 2 =*/290).fork()).ldelim(); + if (message.pnForLidChatAction != null && Object.hasOwnProperty.call(message, "pnForLidChatAction")) + $root.proto.SyncActionValue.PnForLidChatAction.encode(message.pnForLidChatAction, writer.uint32(/* id 37, wireType 2 =*/298).fork()).ldelim(); return writer; }; @@ -59045,6 +61390,9 @@ $root.proto = (function() { case 36: message.chatAssignmentOpenedStatus = $root.proto.SyncActionValue.ChatAssignmentOpenedStatusAction.decode(reader, reader.uint32()); break; + case 37: + message.pnForLidChatAction = $root.proto.SyncActionValue.PnForLidChatAction.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -59233,6 +61581,11 @@ $root.proto = (function() { if (error) return "chatAssignmentOpenedStatus." + error; } + if (message.pnForLidChatAction != null && message.hasOwnProperty("pnForLidChatAction")) { + var error = $root.proto.SyncActionValue.PnForLidChatAction.verify(message.pnForLidChatAction); + if (error) + return "pnForLidChatAction." + error; + } return null; }; @@ -59407,6 +61760,11 @@ $root.proto = (function() { throw TypeError(".proto.SyncActionValue.chatAssignmentOpenedStatus: object expected"); message.chatAssignmentOpenedStatus = $root.proto.SyncActionValue.ChatAssignmentOpenedStatusAction.fromObject(object.chatAssignmentOpenedStatus); } + if (object.pnForLidChatAction != null) { + if (typeof object.pnForLidChatAction !== "object") + throw TypeError(".proto.SyncActionValue.pnForLidChatAction: object expected"); + message.pnForLidChatAction = $root.proto.SyncActionValue.PnForLidChatAction.fromObject(object.pnForLidChatAction); + } return message; }; @@ -59459,6 +61817,7 @@ $root.proto = (function() { object.removeRecentStickerAction = null; object.chatAssignment = null; object.chatAssignmentOpenedStatus = null; + object.pnForLidChatAction = null; } if (message.timestamp != null && message.hasOwnProperty("timestamp")) if (typeof message.timestamp === "number") @@ -59525,6 +61884,8 @@ $root.proto = (function() { object.chatAssignment = $root.proto.SyncActionValue.ChatAssignmentAction.toObject(message.chatAssignment, options); if (message.chatAssignmentOpenedStatus != null && message.hasOwnProperty("chatAssignmentOpenedStatus")) object.chatAssignmentOpenedStatus = $root.proto.SyncActionValue.ChatAssignmentOpenedStatusAction.toObject(message.chatAssignmentOpenedStatus, options); + if (message.pnForLidChatAction != null && message.hasOwnProperty("pnForLidChatAction")) + object.pnForLidChatAction = $root.proto.SyncActionValue.PnForLidChatAction.toObject(message.pnForLidChatAction, options); return object; }; @@ -63037,6 +65398,193 @@ $root.proto = (function() { return PinAction; })(); + SyncActionValue.PnForLidChatAction = (function() { + + /** + * Properties of a PnForLidChatAction. + * @memberof proto.SyncActionValue + * @interface IPnForLidChatAction + * @property {string|null} [pnJid] PnForLidChatAction pnJid + */ + + /** + * Constructs a new PnForLidChatAction. + * @memberof proto.SyncActionValue + * @classdesc Represents a PnForLidChatAction. + * @implements IPnForLidChatAction + * @constructor + * @param {proto.SyncActionValue.IPnForLidChatAction=} [properties] Properties to set + */ + function PnForLidChatAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PnForLidChatAction pnJid. + * @member {string} pnJid + * @memberof proto.SyncActionValue.PnForLidChatAction + * @instance + */ + PnForLidChatAction.prototype.pnJid = ""; + + /** + * Creates a new PnForLidChatAction instance using the specified properties. + * @function create + * @memberof proto.SyncActionValue.PnForLidChatAction + * @static + * @param {proto.SyncActionValue.IPnForLidChatAction=} [properties] Properties to set + * @returns {proto.SyncActionValue.PnForLidChatAction} PnForLidChatAction instance + */ + PnForLidChatAction.create = function create(properties) { + return new PnForLidChatAction(properties); + }; + + /** + * Encodes the specified PnForLidChatAction message. Does not implicitly {@link proto.SyncActionValue.PnForLidChatAction.verify|verify} messages. + * @function encode + * @memberof proto.SyncActionValue.PnForLidChatAction + * @static + * @param {proto.SyncActionValue.IPnForLidChatAction} message PnForLidChatAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PnForLidChatAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pnJid != null && Object.hasOwnProperty.call(message, "pnJid")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pnJid); + return writer; + }; + + /** + * Encodes the specified PnForLidChatAction message, length delimited. Does not implicitly {@link proto.SyncActionValue.PnForLidChatAction.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.SyncActionValue.PnForLidChatAction + * @static + * @param {proto.SyncActionValue.IPnForLidChatAction} message PnForLidChatAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PnForLidChatAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PnForLidChatAction message from the specified reader or buffer. + * @function decode + * @memberof proto.SyncActionValue.PnForLidChatAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.SyncActionValue.PnForLidChatAction} PnForLidChatAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PnForLidChatAction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SyncActionValue.PnForLidChatAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pnJid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PnForLidChatAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.SyncActionValue.PnForLidChatAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.SyncActionValue.PnForLidChatAction} PnForLidChatAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PnForLidChatAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PnForLidChatAction message. + * @function verify + * @memberof proto.SyncActionValue.PnForLidChatAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PnForLidChatAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pnJid != null && message.hasOwnProperty("pnJid")) + if (!$util.isString(message.pnJid)) + return "pnJid: string expected"; + return null; + }; + + /** + * Creates a PnForLidChatAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.SyncActionValue.PnForLidChatAction + * @static + * @param {Object.} object Plain object + * @returns {proto.SyncActionValue.PnForLidChatAction} PnForLidChatAction + */ + PnForLidChatAction.fromObject = function fromObject(object) { + if (object instanceof $root.proto.SyncActionValue.PnForLidChatAction) + return object; + var message = new $root.proto.SyncActionValue.PnForLidChatAction(); + if (object.pnJid != null) + message.pnJid = String(object.pnJid); + return message; + }; + + /** + * Creates a plain object from a PnForLidChatAction message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.SyncActionValue.PnForLidChatAction + * @static + * @param {proto.SyncActionValue.PnForLidChatAction} message PnForLidChatAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PnForLidChatAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.pnJid = ""; + if (message.pnJid != null && message.hasOwnProperty("pnJid")) + object.pnJid = message.pnJid; + return object; + }; + + /** + * Converts this PnForLidChatAction to JSON. + * @function toJSON + * @memberof proto.SyncActionValue.PnForLidChatAction + * @instance + * @returns {Object.} JSON object + */ + PnForLidChatAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PnForLidChatAction; + })(); + SyncActionValue.PrimaryFeature = (function() { /** diff --git a/proto-extract/index.js b/proto-extract/index.js index 02dc143..e8b13c7 100644 --- a/proto-extract/index.js +++ b/proto-extract/index.js @@ -35,10 +35,10 @@ async function findAppModules() { } const baseURL = 'https://web.whatsapp.com' const index = await request.get(baseURL, ua) - const bootstrapQRID = index.match(/src="\/bootstrap_qr.([0-9a-z]{10,}).js"/)[1] - const bootstrapQRURL = baseURL + '/bootstrap_qr.' + bootstrapQRID + '.js' + const bootstrapQRID = index.match(/src="\/app.([0-9a-z]{10,}).js"/)[1] + const bootstrapQRURL = baseURL + '/app.' + bootstrapQRID + '.js' - console.error('Found bootstrap_qr.js URL:', bootstrapQRURL) + console.error('Found source JS URL:', bootstrapQRURL) const qrData = await request.get(bootstrapQRURL, ua) const waVersion = qrData.match(/appVersion:"(\d\.\d+\.\d+)"/)[1]