@hiroosy/baileys-lite 0.3.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/WAProto/index.js +231 -113252
- package/WAProto/parts/ADVDeviceIdentity.part +201 -0
- package/WAProto/parts/ADVEncryptionType.part +6 -0
- package/WAProto/parts/ADVKeyIndexList.part +201 -0
- package/WAProto/parts/ADVSignedDeviceIdentity.part +150 -0
- package/WAProto/parts/ADVSignedDeviceIdentityHMAC.part +142 -0
- package/WAProto/parts/ADVSignedKeyIndexList.part +128 -0
- package/WAProto/parts/AIHomeState.part +405 -0
- package/WAProto/parts/AIMediaCollectionMessage.part +119 -0
- package/WAProto/parts/AIMediaCollectionMetadata.part +100 -0
- package/WAProto/parts/AIMetadataOperation.part +83 -0
- package/WAProto/parts/AIQueryFanout.part +133 -0
- package/WAProto/parts/AIRegenerateMetadata.part +112 -0
- package/WAProto/parts/AIRichResponseCodeMetadata.part +252 -0
- package/WAProto/parts/AIRichResponseContentItemsMetadata.part +354 -0
- package/WAProto/parts/AIRichResponseDynamicMetadata.part +172 -0
- package/WAProto/parts/AIRichResponseGridImageMetadata.part +114 -0
- package/WAProto/parts/AIRichResponseImageURL.part +119 -0
- package/WAProto/parts/AIRichResponseInlineImageMetadata.part +164 -0
- package/WAProto/parts/AIRichResponseLatexMetadata.part +346 -0
- package/WAProto/parts/AIRichResponseMapMetadata.part +346 -0
- package/WAProto/parts/AIRichResponseMessage.part +167 -0
- package/WAProto/parts/AIRichResponseMessageType.part +5 -0
- package/WAProto/parts/AIRichResponseSubMessage.part +313 -0
- package/WAProto/parts/AIRichResponseSubMessageType.part +13 -0
- package/WAProto/parts/AIRichResponseTableMetadata.part +223 -0
- package/WAProto/parts/AIRichResponseUnifiedResponse.part +84 -0
- package/WAProto/parts/AISubscriptionRequestType.part +7 -0
- package/WAProto/parts/AISubscriptionUpsellMetadata.part +102 -0
- package/WAProto/parts/AIThreadInfo.part +316 -0
- package/WAProto/parts/Account.part +138 -0
- package/WAProto/parts/ActionLink.part +100 -0
- package/WAProto/parts/AutoDownloadSettings.part +138 -0
- package/WAProto/parts/AvatarUserSettings.part +100 -0
- package/WAProto/parts/BizAccountLinkInfo.part +210 -0
- package/WAProto/parts/BizAccountPayload.part +105 -0
- package/WAProto/parts/BizIdentityInfo.part +298 -0
- package/WAProto/parts/BotAgeCollectionMetadata.part +138 -0
- package/WAProto/parts/BotAgentDeepLinkMetadata.part +81 -0
- package/WAProto/parts/BotAgentMetadata.part +83 -0
- package/WAProto/parts/BotCapabilityMetadata.part +437 -0
- package/WAProto/parts/BotCommandMetadata.part +119 -0
- package/WAProto/parts/BotDocumentMessageMetadata.part +100 -0
- package/WAProto/parts/BotFeedbackMessage.part +1366 -0
- package/WAProto/parts/BotGroupMetadata.part +92 -0
- package/WAProto/parts/BotGroupParticipantMetadata.part +81 -0
- package/WAProto/parts/BotImagineMetadata.part +134 -0
- package/WAProto/parts/BotInfrastructureDiagnostics.part +148 -0
- package/WAProto/parts/BotLinkedAccount.part +95 -0
- package/WAProto/parts/BotLinkedAccountsMetadata.part +134 -0
- package/WAProto/parts/BotMediaMetadata.part +229 -0
- package/WAProto/parts/BotMemoryFact.part +100 -0
- package/WAProto/parts/BotMemoryMetadata.part +141 -0
- package/WAProto/parts/BotMemuMetadata.part +92 -0
- package/WAProto/parts/BotMessageOrigin.part +95 -0
- package/WAProto/parts/BotMessageOriginMetadata.part +92 -0
- package/WAProto/parts/BotMessageSharingInfo.part +297 -0
- package/WAProto/parts/BotMetadata.part +934 -0
- package/WAProto/parts/BotMetricsEntryPoint.part +51 -0
- package/WAProto/parts/BotMetricsMetadata.part +341 -0
- package/WAProto/parts/BotMetricsThreadEntryPoint.part +8 -0
- package/WAProto/parts/BotModeSelectionMetadata.part +151 -0
- package/WAProto/parts/BotModelMetadata.part +167 -0
- package/WAProto/parts/BotPluginMetadata.part +379 -0
- package/WAProto/parts/BotProgressIndicatorMetadata.part +837 -0
- package/WAProto/parts/BotPromotionMessageMetadata.part +124 -0
- package/WAProto/parts/BotPromptSuggestion.part +100 -0
- package/WAProto/parts/BotPromptSuggestions.part +92 -0
- package/WAProto/parts/BotPttPromptMetadata.part +81 -0
- package/WAProto/parts/BotQuotaMetadata.part +241 -0
- package/WAProto/parts/BotReminderMetadata.part +232 -0
- package/WAProto/parts/BotRenderingConfigMetadata.part +100 -0
- package/WAProto/parts/BotRenderingMetadata.part +203 -0
- package/WAProto/parts/BotResolvedToolCallMetadata.part +100 -0
- package/WAProto/parts/BotSessionMetadata.part +137 -0
- package/WAProto/parts/BotSessionSource.part +11 -0
- package/WAProto/parts/BotSignatureVerificationMetadata.part +92 -0
- package/WAProto/parts/BotSignatureVerificationUseCaseProof.part +183 -0
- package/WAProto/parts/BotSourcesMetadata.part +322 -0
- package/WAProto/parts/BotSuggestedPromptMetadata.part +150 -0
- package/WAProto/parts/BotUnifiedResponseMutation.part +339 -0
- package/WAProto/parts/CallLogRecord.part +646 -0
- package/WAProto/parts/CertChain.part +392 -0
- package/WAProto/parts/ChatLockSettings.part +102 -0
- package/WAProto/parts/ChatRowOpaqueData.part +712 -0
- package/WAProto/parts/Citation.part +119 -0
- package/WAProto/parts/ClientPairingProps.part +160 -0
- package/WAProto/parts/ClientPayload.part +2892 -0
- package/WAProto/parts/CollectionName.part +9 -0
- package/WAProto/parts/CommentMetadata.part +102 -0
- package/WAProto/parts/CompanionCommitment.part +84 -0
- package/WAProto/parts/CompanionEphemeralIdentity.part +227 -0
- package/WAProto/parts/Config.part +136 -0
- package/WAProto/parts/ContextInfo.part +4137 -0
- package/WAProto/parts/Conversation.part +1472 -0
- package/WAProto/parts/DeviceCapabilities.part +670 -0
- package/WAProto/parts/DeviceConsistencyCodeMessage.part +103 -0
- package/WAProto/parts/DeviceListMetadata.part +306 -0
- package/WAProto/parts/DeviceProps.part +982 -0
- package/WAProto/parts/DisappearingMode.part +206 -0
- package/WAProto/parts/EmbeddedContent.part +100 -0
- package/WAProto/parts/EmbeddedMessage.part +102 -0
- package/WAProto/parts/EmbeddedMusic.part +370 -0
- package/WAProto/parts/EncryptedPairingRequest.part +106 -0
- package/WAProto/parts/EphemeralSetting.part +110 -0
- package/WAProto/parts/EventAdditionalMetadata.part +81 -0
- package/WAProto/parts/EventResponse.part +152 -0
- package/WAProto/parts/ExitCode.part +110 -0
- package/WAProto/parts/ExternalBlobReference.part +195 -0
- package/WAProto/parts/Field.part +193 -0
- package/WAProto/parts/ForwardedAIBotMessageInfo.part +119 -0
- package/WAProto/parts/GlobalSettings.part +497 -0
- package/WAProto/parts/GroupHistoryBundleInfo.part +141 -0
- package/WAProto/parts/GroupHistoryIndividualMessageInfo.part +102 -0
- package/WAProto/parts/GroupMention.part +100 -0
- package/WAProto/parts/GroupParticipant.part +142 -0
- package/WAProto/parts/GroupRootKeyShare.part +92 -0
- package/WAProto/parts/GroupRootKeyShareEntry.part +161 -0
- package/WAProto/parts/HandshakeMessage.part +815 -0
- package/WAProto/parts/HatchMetadataSync.part +132 -0
- package/WAProto/parts/HistorySync.part +605 -0
- package/WAProto/parts/HistorySyncMsg.part +112 -0
- package/WAProto/parts/HydratedTemplateButton.part +501 -0
- package/WAProto/parts/IdentityKeyPairStructure.part +106 -0
- package/WAProto/parts/InThreadSurveyMetadata.part +779 -0
- package/WAProto/parts/InlineContact.part +157 -0
- package/WAProto/parts/InteractiveAnnotation.part +246 -0
- package/WAProto/parts/InteractiveMessageAdditionalMetadata.part +81 -0
- package/WAProto/parts/KeepInChat.part +225 -0
- package/WAProto/parts/KeepType.part +6 -0
- package/WAProto/parts/KeyExchangeMessage.part +169 -0
- package/WAProto/parts/KeyId.part +84 -0
- package/WAProto/parts/LIDMigrationMapping.part +149 -0
- package/WAProto/parts/LIDMigrationMappingSyncMessage.part +84 -0
- package/WAProto/parts/LIDMigrationMappingSyncPayload.part +122 -0
- package/WAProto/parts/LegacyMessage.part +104 -0
- package/WAProto/parts/LimitSharing.part +177 -0
- package/WAProto/parts/LocalizedName.part +119 -0
- package/WAProto/parts/Location.part +119 -0
- package/WAProto/parts/MediaData.part +81 -0
- package/WAProto/parts/MediaDomainInfo.part +120 -0
- package/WAProto/parts/MediaKeyDomain.part +6 -0
- package/WAProto/parts/MediaNotifyMessage.part +132 -0
- package/WAProto/parts/MediaRetryNotification.part +170 -0
- package/WAProto/parts/MediaVisibility.part +6 -0
- package/WAProto/parts/MemberLabel.part +110 -0
- package/WAProto/parts/Message.part +32376 -0
- package/WAProto/parts/MessageAddOn.part +305 -0
- package/WAProto/parts/MessageAddOnContextInfo.part +113 -0
- package/WAProto/parts/MessageAssociation.part +235 -0
- package/WAProto/parts/MessageContextInfo.part +451 -0
- package/WAProto/parts/MessageKey.part +138 -0
- package/WAProto/parts/MessageSecretMessage.part +125 -0
- package/WAProto/parts/Money.part +129 -0
- package/WAProto/parts/MsgOpaqueData.part +1732 -0
- package/WAProto/parts/MsgRowOpaqueData.part +104 -0
- package/WAProto/parts/MutationProps.part +89 -0
- package/WAProto/parts/NoiseCertificate.part +277 -0
- package/WAProto/parts/NotificationMessageInfo.part +152 -0
- package/WAProto/parts/NotificationSettings.part +176 -0
- package/WAProto/parts/PairingRequest.part +128 -0
- package/WAProto/parts/PastParticipant.part +148 -0
- package/WAProto/parts/PastParticipants.part +112 -0
- package/WAProto/parts/PatchDebugData.part +358 -0
- package/WAProto/parts/PaymentBackground.part +460 -0
- package/WAProto/parts/PaymentInfo.part +602 -0
- package/WAProto/parts/PhoneNumberToLIDMapping.part +100 -0
- package/WAProto/parts/PhotoChange.part +125 -0
- package/WAProto/parts/PinInChat.part +205 -0
- package/WAProto/parts/Point.part +138 -0
- package/WAProto/parts/PollAdditionalMetadata.part +216 -0
- package/WAProto/parts/PollEncValue.part +106 -0
- package/WAProto/parts/PollUpdate.part +202 -0
- package/WAProto/parts/PreKeyRecordStructure.part +125 -0
- package/WAProto/parts/PreKeySignalMessage.part +185 -0
- package/WAProto/parts/PremiumMessageInfo.part +81 -0
- package/WAProto/parts/PrimaryEphemeralIdentity.part +106 -0
- package/WAProto/parts/PrivacySystemMessage.part +6 -0
- package/WAProto/parts/ProcessedVideo.part +266 -0
- package/WAProto/parts/ProloguePayload.part +105 -0
- package/WAProto/parts/Pushname.part +100 -0
- package/WAProto/parts/QuarantinedMessage.part +103 -0
- package/WAProto/parts/Reaction.part +169 -0
- package/WAProto/parts/RecentEmojiWeight.part +100 -0
- package/WAProto/parts/RecordStructure.part +114 -0
- package/WAProto/parts/Reportable.part +138 -0
- package/WAProto/parts/ReportingTokenInfo.part +84 -0
- package/WAProto/parts/ScheduledMessageMetadata.part +132 -0
- package/WAProto/parts/SenderKeyDistributionMessage.part +144 -0
- package/WAProto/parts/SenderKeyMessage.part +122 -0
- package/WAProto/parts/SenderKeyRecordStructure.part +92 -0
- package/WAProto/parts/SenderKeyStateStructure.part +469 -0
- package/WAProto/parts/ServerErrorReceipt.part +81 -0
- package/WAProto/parts/SessionStructure.part +1087 -0
- package/WAProto/parts/SessionTransparencyMetadata.part +132 -0
- package/WAProto/parts/SessionTransparencyType.part +5 -0
- package/WAProto/parts/SignalMessage.part +144 -0
- package/WAProto/parts/SignedPreKeyRecordStructure.part +176 -0
- package/WAProto/parts/StatusAttribution.part +1235 -0
- package/WAProto/parts/StatusMentionMessage.part +83 -0
- package/WAProto/parts/StatusPSA.part +121 -0
- package/WAProto/parts/StickerMetadata.part +357 -0
- package/WAProto/parts/SyncActionData.part +146 -0
- package/WAProto/parts/SyncActionValue.part +12959 -0
- package/WAProto/parts/SyncdIndex.part +84 -0
- package/WAProto/parts/SyncdMutation.part +121 -0
- package/WAProto/parts/SyncdMutations.part +92 -0
- package/WAProto/parts/SyncdPatch.part +262 -0
- package/WAProto/parts/SyncdRecord.part +125 -0
- package/WAProto/parts/SyncdSnapshot.part +157 -0
- package/WAProto/parts/SyncdValue.part +84 -0
- package/WAProto/parts/SyncdVersion.part +91 -0
- package/WAProto/parts/TapLinkAction.part +100 -0
- package/WAProto/parts/TemplateButton.part +449 -0
- package/WAProto/parts/ThreadID.part +126 -0
- package/WAProto/parts/UrlTrackingMap.part +231 -0
- package/WAProto/parts/UserPassword.part +399 -0
- package/WAProto/parts/UserReceipt.part +221 -0
- package/WAProto/parts/VerifiedNameCertificate.part +318 -0
- package/WAProto/parts/WallpaperSettings.part +119 -0
- package/WAProto/parts/WebFeatures.part +1870 -0
- package/WAProto/parts/WebLinkRenderConfig.part +5 -0
- package/WAProto/parts/WebMessageInfo.part +2851 -0
- package/WAProto/parts/WebNotificationsInfo.part +160 -0
- package/package.json +1 -1
|
@@ -0,0 +1,1087 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
function SessionStructure(p) {
|
|
3
|
+
this.receiverChains = [];
|
|
4
|
+
if (p)
|
|
5
|
+
for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
|
|
6
|
+
if (p[ks[i]] != null && ks[i] !== "__proto__")
|
|
7
|
+
this[ks[i]] = p[ks[i]];
|
|
8
|
+
}
|
|
9
|
+
SessionStructure.prototype.sessionVersion = null;
|
|
10
|
+
SessionStructure.prototype.localIdentityPublic = null;
|
|
11
|
+
SessionStructure.prototype.remoteIdentityPublic = null;
|
|
12
|
+
SessionStructure.prototype.rootKey = null;
|
|
13
|
+
SessionStructure.prototype.previousCounter = null;
|
|
14
|
+
SessionStructure.prototype.senderChain = null;
|
|
15
|
+
SessionStructure.prototype.receiverChains = $util.emptyArray;
|
|
16
|
+
SessionStructure.prototype.pendingKeyExchange = null;
|
|
17
|
+
SessionStructure.prototype.pendingPreKey = null;
|
|
18
|
+
SessionStructure.prototype.remoteRegistrationId = null;
|
|
19
|
+
SessionStructure.prototype.localRegistrationId = null;
|
|
20
|
+
SessionStructure.prototype.needsRefresh = null;
|
|
21
|
+
SessionStructure.prototype.aliceBaseKey = null;
|
|
22
|
+
let $oneOfFields;
|
|
23
|
+
Object.defineProperty(SessionStructure.prototype, "_sessionVersion", {
|
|
24
|
+
get: $util.oneOfGetter($oneOfFields = ["sessionVersion"]),
|
|
25
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
26
|
+
});
|
|
27
|
+
Object.defineProperty(SessionStructure.prototype, "_localIdentityPublic", {
|
|
28
|
+
get: $util.oneOfGetter($oneOfFields = ["localIdentityPublic"]),
|
|
29
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(SessionStructure.prototype, "_remoteIdentityPublic", {
|
|
32
|
+
get: $util.oneOfGetter($oneOfFields = ["remoteIdentityPublic"]),
|
|
33
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
34
|
+
});
|
|
35
|
+
Object.defineProperty(SessionStructure.prototype, "_rootKey", {
|
|
36
|
+
get: $util.oneOfGetter($oneOfFields = ["rootKey"]),
|
|
37
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
38
|
+
});
|
|
39
|
+
Object.defineProperty(SessionStructure.prototype, "_previousCounter", {
|
|
40
|
+
get: $util.oneOfGetter($oneOfFields = ["previousCounter"]),
|
|
41
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
42
|
+
});
|
|
43
|
+
Object.defineProperty(SessionStructure.prototype, "_senderChain", {
|
|
44
|
+
get: $util.oneOfGetter($oneOfFields = ["senderChain"]),
|
|
45
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
46
|
+
});
|
|
47
|
+
Object.defineProperty(SessionStructure.prototype, "_pendingKeyExchange", {
|
|
48
|
+
get: $util.oneOfGetter($oneOfFields = ["pendingKeyExchange"]),
|
|
49
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
50
|
+
});
|
|
51
|
+
Object.defineProperty(SessionStructure.prototype, "_pendingPreKey", {
|
|
52
|
+
get: $util.oneOfGetter($oneOfFields = ["pendingPreKey"]),
|
|
53
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
54
|
+
});
|
|
55
|
+
Object.defineProperty(SessionStructure.prototype, "_remoteRegistrationId", {
|
|
56
|
+
get: $util.oneOfGetter($oneOfFields = ["remoteRegistrationId"]),
|
|
57
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
58
|
+
});
|
|
59
|
+
Object.defineProperty(SessionStructure.prototype, "_localRegistrationId", {
|
|
60
|
+
get: $util.oneOfGetter($oneOfFields = ["localRegistrationId"]),
|
|
61
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
62
|
+
});
|
|
63
|
+
Object.defineProperty(SessionStructure.prototype, "_needsRefresh", {
|
|
64
|
+
get: $util.oneOfGetter($oneOfFields = ["needsRefresh"]),
|
|
65
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
66
|
+
});
|
|
67
|
+
Object.defineProperty(SessionStructure.prototype, "_aliceBaseKey", {
|
|
68
|
+
get: $util.oneOfGetter($oneOfFields = ["aliceBaseKey"]),
|
|
69
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
70
|
+
});
|
|
71
|
+
SessionStructure.create = function create(properties) {
|
|
72
|
+
return new SessionStructure(properties);
|
|
73
|
+
};
|
|
74
|
+
SessionStructure.encode = function encode(m, w) {
|
|
75
|
+
if (!w)
|
|
76
|
+
w = $Writer.create();
|
|
77
|
+
if (m.sessionVersion != null && Object.hasOwnProperty.call(m, "sessionVersion"))
|
|
78
|
+
w.uint32(8).uint32(m.sessionVersion);
|
|
79
|
+
if (m.localIdentityPublic != null && Object.hasOwnProperty.call(m, "localIdentityPublic"))
|
|
80
|
+
w.uint32(18).bytes(m.localIdentityPublic);
|
|
81
|
+
if (m.remoteIdentityPublic != null && Object.hasOwnProperty.call(m, "remoteIdentityPublic"))
|
|
82
|
+
w.uint32(26).bytes(m.remoteIdentityPublic);
|
|
83
|
+
if (m.rootKey != null && Object.hasOwnProperty.call(m, "rootKey"))
|
|
84
|
+
w.uint32(34).bytes(m.rootKey);
|
|
85
|
+
if (m.previousCounter != null && Object.hasOwnProperty.call(m, "previousCounter"))
|
|
86
|
+
w.uint32(40).uint32(m.previousCounter);
|
|
87
|
+
if (m.senderChain != null && Object.hasOwnProperty.call(m, "senderChain"))
|
|
88
|
+
$root.proto.SessionStructure.Chain.encode(m.senderChain, w.uint32(50).fork()).ldelim();
|
|
89
|
+
if (m.receiverChains != null && m.receiverChains.length) {
|
|
90
|
+
for (var i = 0; i < m.receiverChains.length; ++i)
|
|
91
|
+
$root.proto.SessionStructure.Chain.encode(m.receiverChains[i], w.uint32(58).fork()).ldelim();
|
|
92
|
+
}
|
|
93
|
+
if (m.pendingKeyExchange != null && Object.hasOwnProperty.call(m, "pendingKeyExchange"))
|
|
94
|
+
$root.proto.SessionStructure.PendingKeyExchange.encode(m.pendingKeyExchange, w.uint32(66).fork()).ldelim();
|
|
95
|
+
if (m.pendingPreKey != null && Object.hasOwnProperty.call(m, "pendingPreKey"))
|
|
96
|
+
$root.proto.SessionStructure.PendingPreKey.encode(m.pendingPreKey, w.uint32(74).fork()).ldelim();
|
|
97
|
+
if (m.remoteRegistrationId != null && Object.hasOwnProperty.call(m, "remoteRegistrationId"))
|
|
98
|
+
w.uint32(80).uint32(m.remoteRegistrationId);
|
|
99
|
+
if (m.localRegistrationId != null && Object.hasOwnProperty.call(m, "localRegistrationId"))
|
|
100
|
+
w.uint32(88).uint32(m.localRegistrationId);
|
|
101
|
+
if (m.needsRefresh != null && Object.hasOwnProperty.call(m, "needsRefresh"))
|
|
102
|
+
w.uint32(96).bool(m.needsRefresh);
|
|
103
|
+
if (m.aliceBaseKey != null && Object.hasOwnProperty.call(m, "aliceBaseKey"))
|
|
104
|
+
w.uint32(106).bytes(m.aliceBaseKey);
|
|
105
|
+
return w;
|
|
106
|
+
};
|
|
107
|
+
SessionStructure.decode = function decode(r, l, e, n) {
|
|
108
|
+
if (!(r instanceof $Reader))
|
|
109
|
+
r = $Reader.create(r);
|
|
110
|
+
if (n === undefined)
|
|
111
|
+
n = 0;
|
|
112
|
+
if (n > $Reader.recursionLimit)
|
|
113
|
+
throw Error("maximum nesting depth exceeded");
|
|
114
|
+
var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SessionStructure();
|
|
115
|
+
while (r.pos < c) {
|
|
116
|
+
var t = r.uint32();
|
|
117
|
+
if (t === e)
|
|
118
|
+
break;
|
|
119
|
+
switch (t >>> 3) {
|
|
120
|
+
case 1: {
|
|
121
|
+
m.sessionVersion = r.uint32();
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
case 2: {
|
|
125
|
+
m.localIdentityPublic = r.bytes();
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
case 3: {
|
|
129
|
+
m.remoteIdentityPublic = r.bytes();
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
case 4: {
|
|
133
|
+
m.rootKey = r.bytes();
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
case 5: {
|
|
137
|
+
m.previousCounter = r.uint32();
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
case 6: {
|
|
141
|
+
m.senderChain = $root.proto.SessionStructure.Chain.decode(r, r.uint32(), undefined, n + 1);
|
|
142
|
+
break;
|
|
143
|
+
}
|
|
144
|
+
case 7: {
|
|
145
|
+
if (!(m.receiverChains && m.receiverChains.length))
|
|
146
|
+
m.receiverChains = [];
|
|
147
|
+
m.receiverChains.push($root.proto.SessionStructure.Chain.decode(r, r.uint32(), undefined, n + 1));
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
case 8: {
|
|
151
|
+
m.pendingKeyExchange = $root.proto.SessionStructure.PendingKeyExchange.decode(r, r.uint32(), undefined, n + 1);
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
case 9: {
|
|
155
|
+
m.pendingPreKey = $root.proto.SessionStructure.PendingPreKey.decode(r, r.uint32(), undefined, n + 1);
|
|
156
|
+
break;
|
|
157
|
+
}
|
|
158
|
+
case 10: {
|
|
159
|
+
m.remoteRegistrationId = r.uint32();
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
case 11: {
|
|
163
|
+
m.localRegistrationId = r.uint32();
|
|
164
|
+
break;
|
|
165
|
+
}
|
|
166
|
+
case 12: {
|
|
167
|
+
m.needsRefresh = r.bool();
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
case 13: {
|
|
171
|
+
m.aliceBaseKey = r.bytes();
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
default:
|
|
175
|
+
r.skipType(t & 7, n);
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return m;
|
|
180
|
+
};
|
|
181
|
+
SessionStructure.fromObject = function fromObject(d, n) {
|
|
182
|
+
if (d instanceof $root.proto.SessionStructure)
|
|
183
|
+
return d;
|
|
184
|
+
if (n === undefined)
|
|
185
|
+
n = 0;
|
|
186
|
+
if (n > $util.recursionLimit)
|
|
187
|
+
throw Error("maximum nesting depth exceeded");
|
|
188
|
+
var m = new $root.proto.SessionStructure();
|
|
189
|
+
if (d.sessionVersion != null) {
|
|
190
|
+
m.sessionVersion = d.sessionVersion >>> 0;
|
|
191
|
+
}
|
|
192
|
+
if (d.localIdentityPublic != null) {
|
|
193
|
+
if (typeof d.localIdentityPublic === "string")
|
|
194
|
+
$util.base64.decode(d.localIdentityPublic, m.localIdentityPublic = $util.newBuffer($util.base64.length(d.localIdentityPublic)), 0);
|
|
195
|
+
else if (d.localIdentityPublic.length >= 0)
|
|
196
|
+
m.localIdentityPublic = d.localIdentityPublic;
|
|
197
|
+
}
|
|
198
|
+
if (d.remoteIdentityPublic != null) {
|
|
199
|
+
if (typeof d.remoteIdentityPublic === "string")
|
|
200
|
+
$util.base64.decode(d.remoteIdentityPublic, m.remoteIdentityPublic = $util.newBuffer($util.base64.length(d.remoteIdentityPublic)), 0);
|
|
201
|
+
else if (d.remoteIdentityPublic.length >= 0)
|
|
202
|
+
m.remoteIdentityPublic = d.remoteIdentityPublic;
|
|
203
|
+
}
|
|
204
|
+
if (d.rootKey != null) {
|
|
205
|
+
if (typeof d.rootKey === "string")
|
|
206
|
+
$util.base64.decode(d.rootKey, m.rootKey = $util.newBuffer($util.base64.length(d.rootKey)), 0);
|
|
207
|
+
else if (d.rootKey.length >= 0)
|
|
208
|
+
m.rootKey = d.rootKey;
|
|
209
|
+
}
|
|
210
|
+
if (d.previousCounter != null) {
|
|
211
|
+
m.previousCounter = d.previousCounter >>> 0;
|
|
212
|
+
}
|
|
213
|
+
if (d.senderChain != null) {
|
|
214
|
+
if (typeof d.senderChain !== "object")
|
|
215
|
+
throw TypeError(".proto.SessionStructure.senderChain: object expected");
|
|
216
|
+
m.senderChain = $root.proto.SessionStructure.Chain.fromObject(d.senderChain, n + 1);
|
|
217
|
+
}
|
|
218
|
+
if (d.receiverChains) {
|
|
219
|
+
if (!Array.isArray(d.receiverChains))
|
|
220
|
+
throw TypeError(".proto.SessionStructure.receiverChains: array expected");
|
|
221
|
+
m.receiverChains = [];
|
|
222
|
+
for (var i = 0; i < d.receiverChains.length; ++i) {
|
|
223
|
+
if (typeof d.receiverChains[i] !== "object")
|
|
224
|
+
throw TypeError(".proto.SessionStructure.receiverChains: object expected");
|
|
225
|
+
m.receiverChains[i] = $root.proto.SessionStructure.Chain.fromObject(d.receiverChains[i], n + 1);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
if (d.pendingKeyExchange != null) {
|
|
229
|
+
if (typeof d.pendingKeyExchange !== "object")
|
|
230
|
+
throw TypeError(".proto.SessionStructure.pendingKeyExchange: object expected");
|
|
231
|
+
m.pendingKeyExchange = $root.proto.SessionStructure.PendingKeyExchange.fromObject(d.pendingKeyExchange, n + 1);
|
|
232
|
+
}
|
|
233
|
+
if (d.pendingPreKey != null) {
|
|
234
|
+
if (typeof d.pendingPreKey !== "object")
|
|
235
|
+
throw TypeError(".proto.SessionStructure.pendingPreKey: object expected");
|
|
236
|
+
m.pendingPreKey = $root.proto.SessionStructure.PendingPreKey.fromObject(d.pendingPreKey, n + 1);
|
|
237
|
+
}
|
|
238
|
+
if (d.remoteRegistrationId != null) {
|
|
239
|
+
m.remoteRegistrationId = d.remoteRegistrationId >>> 0;
|
|
240
|
+
}
|
|
241
|
+
if (d.localRegistrationId != null) {
|
|
242
|
+
m.localRegistrationId = d.localRegistrationId >>> 0;
|
|
243
|
+
}
|
|
244
|
+
if (d.needsRefresh != null) {
|
|
245
|
+
m.needsRefresh = Boolean(d.needsRefresh);
|
|
246
|
+
}
|
|
247
|
+
if (d.aliceBaseKey != null) {
|
|
248
|
+
if (typeof d.aliceBaseKey === "string")
|
|
249
|
+
$util.base64.decode(d.aliceBaseKey, m.aliceBaseKey = $util.newBuffer($util.base64.length(d.aliceBaseKey)), 0);
|
|
250
|
+
else if (d.aliceBaseKey.length >= 0)
|
|
251
|
+
m.aliceBaseKey = d.aliceBaseKey;
|
|
252
|
+
}
|
|
253
|
+
return m;
|
|
254
|
+
};
|
|
255
|
+
SessionStructure.toObject = function toObject(m, o) {
|
|
256
|
+
if (!o)
|
|
257
|
+
o = {};
|
|
258
|
+
var d = {};
|
|
259
|
+
if (o.arrays || o.defaults) {
|
|
260
|
+
d.receiverChains = [];
|
|
261
|
+
}
|
|
262
|
+
if (m.sessionVersion != null && m.hasOwnProperty("sessionVersion")) {
|
|
263
|
+
d.sessionVersion = m.sessionVersion;
|
|
264
|
+
if (o.oneofs)
|
|
265
|
+
d._sessionVersion = "sessionVersion";
|
|
266
|
+
}
|
|
267
|
+
if (m.localIdentityPublic != null && m.hasOwnProperty("localIdentityPublic")) {
|
|
268
|
+
d.localIdentityPublic = o.bytes === String ? $util.base64.encode(m.localIdentityPublic, 0, m.localIdentityPublic.length) : o.bytes === Array ? Array.prototype.slice.call(m.localIdentityPublic) : m.localIdentityPublic;
|
|
269
|
+
if (o.oneofs)
|
|
270
|
+
d._localIdentityPublic = "localIdentityPublic";
|
|
271
|
+
}
|
|
272
|
+
if (m.remoteIdentityPublic != null && m.hasOwnProperty("remoteIdentityPublic")) {
|
|
273
|
+
d.remoteIdentityPublic = o.bytes === String ? $util.base64.encode(m.remoteIdentityPublic, 0, m.remoteIdentityPublic.length) : o.bytes === Array ? Array.prototype.slice.call(m.remoteIdentityPublic) : m.remoteIdentityPublic;
|
|
274
|
+
if (o.oneofs)
|
|
275
|
+
d._remoteIdentityPublic = "remoteIdentityPublic";
|
|
276
|
+
}
|
|
277
|
+
if (m.rootKey != null && m.hasOwnProperty("rootKey")) {
|
|
278
|
+
d.rootKey = o.bytes === String ? $util.base64.encode(m.rootKey, 0, m.rootKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.rootKey) : m.rootKey;
|
|
279
|
+
if (o.oneofs)
|
|
280
|
+
d._rootKey = "rootKey";
|
|
281
|
+
}
|
|
282
|
+
if (m.previousCounter != null && m.hasOwnProperty("previousCounter")) {
|
|
283
|
+
d.previousCounter = m.previousCounter;
|
|
284
|
+
if (o.oneofs)
|
|
285
|
+
d._previousCounter = "previousCounter";
|
|
286
|
+
}
|
|
287
|
+
if (m.senderChain != null && m.hasOwnProperty("senderChain")) {
|
|
288
|
+
d.senderChain = $root.proto.SessionStructure.Chain.toObject(m.senderChain, o);
|
|
289
|
+
if (o.oneofs)
|
|
290
|
+
d._senderChain = "senderChain";
|
|
291
|
+
}
|
|
292
|
+
if (m.receiverChains && m.receiverChains.length) {
|
|
293
|
+
d.receiverChains = [];
|
|
294
|
+
for (var j = 0; j < m.receiverChains.length; ++j) {
|
|
295
|
+
d.receiverChains[j] = $root.proto.SessionStructure.Chain.toObject(m.receiverChains[j], o);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
if (m.pendingKeyExchange != null && m.hasOwnProperty("pendingKeyExchange")) {
|
|
299
|
+
d.pendingKeyExchange = $root.proto.SessionStructure.PendingKeyExchange.toObject(m.pendingKeyExchange, o);
|
|
300
|
+
if (o.oneofs)
|
|
301
|
+
d._pendingKeyExchange = "pendingKeyExchange";
|
|
302
|
+
}
|
|
303
|
+
if (m.pendingPreKey != null && m.hasOwnProperty("pendingPreKey")) {
|
|
304
|
+
d.pendingPreKey = $root.proto.SessionStructure.PendingPreKey.toObject(m.pendingPreKey, o);
|
|
305
|
+
if (o.oneofs)
|
|
306
|
+
d._pendingPreKey = "pendingPreKey";
|
|
307
|
+
}
|
|
308
|
+
if (m.remoteRegistrationId != null && m.hasOwnProperty("remoteRegistrationId")) {
|
|
309
|
+
d.remoteRegistrationId = m.remoteRegistrationId;
|
|
310
|
+
if (o.oneofs)
|
|
311
|
+
d._remoteRegistrationId = "remoteRegistrationId";
|
|
312
|
+
}
|
|
313
|
+
if (m.localRegistrationId != null && m.hasOwnProperty("localRegistrationId")) {
|
|
314
|
+
d.localRegistrationId = m.localRegistrationId;
|
|
315
|
+
if (o.oneofs)
|
|
316
|
+
d._localRegistrationId = "localRegistrationId";
|
|
317
|
+
}
|
|
318
|
+
if (m.needsRefresh != null && m.hasOwnProperty("needsRefresh")) {
|
|
319
|
+
d.needsRefresh = m.needsRefresh;
|
|
320
|
+
if (o.oneofs)
|
|
321
|
+
d._needsRefresh = "needsRefresh";
|
|
322
|
+
}
|
|
323
|
+
if (m.aliceBaseKey != null && m.hasOwnProperty("aliceBaseKey")) {
|
|
324
|
+
d.aliceBaseKey = o.bytes === String ? $util.base64.encode(m.aliceBaseKey, 0, m.aliceBaseKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.aliceBaseKey) : m.aliceBaseKey;
|
|
325
|
+
if (o.oneofs)
|
|
326
|
+
d._aliceBaseKey = "aliceBaseKey";
|
|
327
|
+
}
|
|
328
|
+
return d;
|
|
329
|
+
};
|
|
330
|
+
SessionStructure.prototype.toJSON = function toJSON() {
|
|
331
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
332
|
+
};
|
|
333
|
+
SessionStructure.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
334
|
+
if (typeUrlPrefix === undefined) {
|
|
335
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
336
|
+
}
|
|
337
|
+
return typeUrlPrefix + "/proto.SessionStructure";
|
|
338
|
+
};
|
|
339
|
+
$lazy(SessionStructure, "Chain", function() {
|
|
340
|
+
function Chain(p) {
|
|
341
|
+
this.messageKeys = [];
|
|
342
|
+
if (p)
|
|
343
|
+
for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
|
|
344
|
+
if (p[ks[i]] != null && ks[i] !== "__proto__")
|
|
345
|
+
this[ks[i]] = p[ks[i]];
|
|
346
|
+
}
|
|
347
|
+
Chain.prototype.senderRatchetKey = null;
|
|
348
|
+
Chain.prototype.senderRatchetKeyPrivate = null;
|
|
349
|
+
Chain.prototype.chainKey = null;
|
|
350
|
+
Chain.prototype.messageKeys = $util.emptyArray;
|
|
351
|
+
let $oneOfFields;
|
|
352
|
+
Object.defineProperty(Chain.prototype, "_senderRatchetKey", {
|
|
353
|
+
get: $util.oneOfGetter($oneOfFields = ["senderRatchetKey"]),
|
|
354
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
355
|
+
});
|
|
356
|
+
Object.defineProperty(Chain.prototype, "_senderRatchetKeyPrivate", {
|
|
357
|
+
get: $util.oneOfGetter($oneOfFields = ["senderRatchetKeyPrivate"]),
|
|
358
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
359
|
+
});
|
|
360
|
+
Object.defineProperty(Chain.prototype, "_chainKey", {
|
|
361
|
+
get: $util.oneOfGetter($oneOfFields = ["chainKey"]),
|
|
362
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
363
|
+
});
|
|
364
|
+
Chain.create = function create(properties) {
|
|
365
|
+
return new Chain(properties);
|
|
366
|
+
};
|
|
367
|
+
Chain.encode = function encode(m, w) {
|
|
368
|
+
if (!w)
|
|
369
|
+
w = $Writer.create();
|
|
370
|
+
if (m.senderRatchetKey != null && Object.hasOwnProperty.call(m, "senderRatchetKey"))
|
|
371
|
+
w.uint32(10).bytes(m.senderRatchetKey);
|
|
372
|
+
if (m.senderRatchetKeyPrivate != null && Object.hasOwnProperty.call(m, "senderRatchetKeyPrivate"))
|
|
373
|
+
w.uint32(18).bytes(m.senderRatchetKeyPrivate);
|
|
374
|
+
if (m.chainKey != null && Object.hasOwnProperty.call(m, "chainKey"))
|
|
375
|
+
$root.proto.SessionStructure.Chain.ChainKey.encode(m.chainKey, w.uint32(26).fork()).ldelim();
|
|
376
|
+
if (m.messageKeys != null && m.messageKeys.length) {
|
|
377
|
+
for (var i = 0; i < m.messageKeys.length; ++i)
|
|
378
|
+
$root.proto.SessionStructure.Chain.MessageKey.encode(m.messageKeys[i], w.uint32(34).fork()).ldelim();
|
|
379
|
+
}
|
|
380
|
+
return w;
|
|
381
|
+
};
|
|
382
|
+
Chain.decode = function decode(r, l, e, n) {
|
|
383
|
+
if (!(r instanceof $Reader))
|
|
384
|
+
r = $Reader.create(r);
|
|
385
|
+
if (n === undefined)
|
|
386
|
+
n = 0;
|
|
387
|
+
if (n > $Reader.recursionLimit)
|
|
388
|
+
throw Error("maximum nesting depth exceeded");
|
|
389
|
+
var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SessionStructure.Chain();
|
|
390
|
+
while (r.pos < c) {
|
|
391
|
+
var t = r.uint32();
|
|
392
|
+
if (t === e)
|
|
393
|
+
break;
|
|
394
|
+
switch (t >>> 3) {
|
|
395
|
+
case 1: {
|
|
396
|
+
m.senderRatchetKey = r.bytes();
|
|
397
|
+
break;
|
|
398
|
+
}
|
|
399
|
+
case 2: {
|
|
400
|
+
m.senderRatchetKeyPrivate = r.bytes();
|
|
401
|
+
break;
|
|
402
|
+
}
|
|
403
|
+
case 3: {
|
|
404
|
+
m.chainKey = $root.proto.SessionStructure.Chain.ChainKey.decode(r, r.uint32(), undefined, n + 1);
|
|
405
|
+
break;
|
|
406
|
+
}
|
|
407
|
+
case 4: {
|
|
408
|
+
if (!(m.messageKeys && m.messageKeys.length))
|
|
409
|
+
m.messageKeys = [];
|
|
410
|
+
m.messageKeys.push($root.proto.SessionStructure.Chain.MessageKey.decode(r, r.uint32(), undefined, n + 1));
|
|
411
|
+
break;
|
|
412
|
+
}
|
|
413
|
+
default:
|
|
414
|
+
r.skipType(t & 7, n);
|
|
415
|
+
break;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
return m;
|
|
419
|
+
};
|
|
420
|
+
Chain.fromObject = function fromObject(d, n) {
|
|
421
|
+
if (d instanceof $root.proto.SessionStructure.Chain)
|
|
422
|
+
return d;
|
|
423
|
+
if (n === undefined)
|
|
424
|
+
n = 0;
|
|
425
|
+
if (n > $util.recursionLimit)
|
|
426
|
+
throw Error("maximum nesting depth exceeded");
|
|
427
|
+
var m = new $root.proto.SessionStructure.Chain();
|
|
428
|
+
if (d.senderRatchetKey != null) {
|
|
429
|
+
if (typeof d.senderRatchetKey === "string")
|
|
430
|
+
$util.base64.decode(d.senderRatchetKey, m.senderRatchetKey = $util.newBuffer($util.base64.length(d.senderRatchetKey)), 0);
|
|
431
|
+
else if (d.senderRatchetKey.length >= 0)
|
|
432
|
+
m.senderRatchetKey = d.senderRatchetKey;
|
|
433
|
+
}
|
|
434
|
+
if (d.senderRatchetKeyPrivate != null) {
|
|
435
|
+
if (typeof d.senderRatchetKeyPrivate === "string")
|
|
436
|
+
$util.base64.decode(d.senderRatchetKeyPrivate, m.senderRatchetKeyPrivate = $util.newBuffer($util.base64.length(d.senderRatchetKeyPrivate)), 0);
|
|
437
|
+
else if (d.senderRatchetKeyPrivate.length >= 0)
|
|
438
|
+
m.senderRatchetKeyPrivate = d.senderRatchetKeyPrivate;
|
|
439
|
+
}
|
|
440
|
+
if (d.chainKey != null) {
|
|
441
|
+
if (typeof d.chainKey !== "object")
|
|
442
|
+
throw TypeError(".proto.SessionStructure.Chain.chainKey: object expected");
|
|
443
|
+
m.chainKey = $root.proto.SessionStructure.Chain.ChainKey.fromObject(d.chainKey, n + 1);
|
|
444
|
+
}
|
|
445
|
+
if (d.messageKeys) {
|
|
446
|
+
if (!Array.isArray(d.messageKeys))
|
|
447
|
+
throw TypeError(".proto.SessionStructure.Chain.messageKeys: array expected");
|
|
448
|
+
m.messageKeys = [];
|
|
449
|
+
for (var i = 0; i < d.messageKeys.length; ++i) {
|
|
450
|
+
if (typeof d.messageKeys[i] !== "object")
|
|
451
|
+
throw TypeError(".proto.SessionStructure.Chain.messageKeys: object expected");
|
|
452
|
+
m.messageKeys[i] = $root.proto.SessionStructure.Chain.MessageKey.fromObject(d.messageKeys[i], n + 1);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
return m;
|
|
456
|
+
};
|
|
457
|
+
Chain.toObject = function toObject(m, o) {
|
|
458
|
+
if (!o)
|
|
459
|
+
o = {};
|
|
460
|
+
var d = {};
|
|
461
|
+
if (o.arrays || o.defaults) {
|
|
462
|
+
d.messageKeys = [];
|
|
463
|
+
}
|
|
464
|
+
if (m.senderRatchetKey != null && m.hasOwnProperty("senderRatchetKey")) {
|
|
465
|
+
d.senderRatchetKey = o.bytes === String ? $util.base64.encode(m.senderRatchetKey, 0, m.senderRatchetKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.senderRatchetKey) : m.senderRatchetKey;
|
|
466
|
+
if (o.oneofs)
|
|
467
|
+
d._senderRatchetKey = "senderRatchetKey";
|
|
468
|
+
}
|
|
469
|
+
if (m.senderRatchetKeyPrivate != null && m.hasOwnProperty("senderRatchetKeyPrivate")) {
|
|
470
|
+
d.senderRatchetKeyPrivate = o.bytes === String ? $util.base64.encode(m.senderRatchetKeyPrivate, 0, m.senderRatchetKeyPrivate.length) : o.bytes === Array ? Array.prototype.slice.call(m.senderRatchetKeyPrivate) : m.senderRatchetKeyPrivate;
|
|
471
|
+
if (o.oneofs)
|
|
472
|
+
d._senderRatchetKeyPrivate = "senderRatchetKeyPrivate";
|
|
473
|
+
}
|
|
474
|
+
if (m.chainKey != null && m.hasOwnProperty("chainKey")) {
|
|
475
|
+
d.chainKey = $root.proto.SessionStructure.Chain.ChainKey.toObject(m.chainKey, o);
|
|
476
|
+
if (o.oneofs)
|
|
477
|
+
d._chainKey = "chainKey";
|
|
478
|
+
}
|
|
479
|
+
if (m.messageKeys && m.messageKeys.length) {
|
|
480
|
+
d.messageKeys = [];
|
|
481
|
+
for (var j = 0; j < m.messageKeys.length; ++j) {
|
|
482
|
+
d.messageKeys[j] = $root.proto.SessionStructure.Chain.MessageKey.toObject(m.messageKeys[j], o);
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
return d;
|
|
486
|
+
};
|
|
487
|
+
Chain.prototype.toJSON = function toJSON() {
|
|
488
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
489
|
+
};
|
|
490
|
+
Chain.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
491
|
+
if (typeUrlPrefix === undefined) {
|
|
492
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
493
|
+
}
|
|
494
|
+
return typeUrlPrefix + "/proto.SessionStructure.Chain";
|
|
495
|
+
};
|
|
496
|
+
$lazy(Chain, "ChainKey", function() {
|
|
497
|
+
function ChainKey(p) {
|
|
498
|
+
if (p)
|
|
499
|
+
for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
|
|
500
|
+
if (p[ks[i]] != null && ks[i] !== "__proto__")
|
|
501
|
+
this[ks[i]] = p[ks[i]];
|
|
502
|
+
}
|
|
503
|
+
ChainKey.prototype.index = null;
|
|
504
|
+
ChainKey.prototype.key = null;
|
|
505
|
+
let $oneOfFields;
|
|
506
|
+
Object.defineProperty(ChainKey.prototype, "_index", {
|
|
507
|
+
get: $util.oneOfGetter($oneOfFields = ["index"]),
|
|
508
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
509
|
+
});
|
|
510
|
+
Object.defineProperty(ChainKey.prototype, "_key", {
|
|
511
|
+
get: $util.oneOfGetter($oneOfFields = ["key"]),
|
|
512
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
513
|
+
});
|
|
514
|
+
ChainKey.create = function create(properties) {
|
|
515
|
+
return new ChainKey(properties);
|
|
516
|
+
};
|
|
517
|
+
ChainKey.encode = function encode(m, w) {
|
|
518
|
+
if (!w)
|
|
519
|
+
w = $Writer.create();
|
|
520
|
+
if (m.index != null && Object.hasOwnProperty.call(m, "index"))
|
|
521
|
+
w.uint32(8).uint32(m.index);
|
|
522
|
+
if (m.key != null && Object.hasOwnProperty.call(m, "key"))
|
|
523
|
+
w.uint32(18).bytes(m.key);
|
|
524
|
+
return w;
|
|
525
|
+
};
|
|
526
|
+
ChainKey.decode = function decode(r, l, e, n) {
|
|
527
|
+
if (!(r instanceof $Reader))
|
|
528
|
+
r = $Reader.create(r);
|
|
529
|
+
if (n === undefined)
|
|
530
|
+
n = 0;
|
|
531
|
+
if (n > $Reader.recursionLimit)
|
|
532
|
+
throw Error("maximum nesting depth exceeded");
|
|
533
|
+
var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SessionStructure.Chain.ChainKey();
|
|
534
|
+
while (r.pos < c) {
|
|
535
|
+
var t = r.uint32();
|
|
536
|
+
if (t === e)
|
|
537
|
+
break;
|
|
538
|
+
switch (t >>> 3) {
|
|
539
|
+
case 1: {
|
|
540
|
+
m.index = r.uint32();
|
|
541
|
+
break;
|
|
542
|
+
}
|
|
543
|
+
case 2: {
|
|
544
|
+
m.key = r.bytes();
|
|
545
|
+
break;
|
|
546
|
+
}
|
|
547
|
+
default:
|
|
548
|
+
r.skipType(t & 7, n);
|
|
549
|
+
break;
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
return m;
|
|
553
|
+
};
|
|
554
|
+
ChainKey.fromObject = function fromObject(d, n) {
|
|
555
|
+
if (d instanceof $root.proto.SessionStructure.Chain.ChainKey)
|
|
556
|
+
return d;
|
|
557
|
+
if (n === undefined)
|
|
558
|
+
n = 0;
|
|
559
|
+
if (n > $util.recursionLimit)
|
|
560
|
+
throw Error("maximum nesting depth exceeded");
|
|
561
|
+
var m = new $root.proto.SessionStructure.Chain.ChainKey();
|
|
562
|
+
if (d.index != null) {
|
|
563
|
+
m.index = d.index >>> 0;
|
|
564
|
+
}
|
|
565
|
+
if (d.key != null) {
|
|
566
|
+
if (typeof d.key === "string")
|
|
567
|
+
$util.base64.decode(d.key, m.key = $util.newBuffer($util.base64.length(d.key)), 0);
|
|
568
|
+
else if (d.key.length >= 0)
|
|
569
|
+
m.key = d.key;
|
|
570
|
+
}
|
|
571
|
+
return m;
|
|
572
|
+
};
|
|
573
|
+
ChainKey.toObject = function toObject(m, o) {
|
|
574
|
+
if (!o)
|
|
575
|
+
o = {};
|
|
576
|
+
var d = {};
|
|
577
|
+
if (m.index != null && m.hasOwnProperty("index")) {
|
|
578
|
+
d.index = m.index;
|
|
579
|
+
if (o.oneofs)
|
|
580
|
+
d._index = "index";
|
|
581
|
+
}
|
|
582
|
+
if (m.key != null && m.hasOwnProperty("key")) {
|
|
583
|
+
d.key = o.bytes === String ? $util.base64.encode(m.key, 0, m.key.length) : o.bytes === Array ? Array.prototype.slice.call(m.key) : m.key;
|
|
584
|
+
if (o.oneofs)
|
|
585
|
+
d._key = "key";
|
|
586
|
+
}
|
|
587
|
+
return d;
|
|
588
|
+
};
|
|
589
|
+
ChainKey.prototype.toJSON = function toJSON() {
|
|
590
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
591
|
+
};
|
|
592
|
+
ChainKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
593
|
+
if (typeUrlPrefix === undefined) {
|
|
594
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
595
|
+
}
|
|
596
|
+
return typeUrlPrefix + "/proto.SessionStructure.Chain.ChainKey";
|
|
597
|
+
};
|
|
598
|
+
return ChainKey;
|
|
599
|
+
});
|
|
600
|
+
$lazy(Chain, "MessageKey", function() {
|
|
601
|
+
function MessageKey(p) {
|
|
602
|
+
if (p)
|
|
603
|
+
for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
|
|
604
|
+
if (p[ks[i]] != null && ks[i] !== "__proto__")
|
|
605
|
+
this[ks[i]] = p[ks[i]];
|
|
606
|
+
}
|
|
607
|
+
MessageKey.prototype.index = null;
|
|
608
|
+
MessageKey.prototype.cipherKey = null;
|
|
609
|
+
MessageKey.prototype.macKey = null;
|
|
610
|
+
MessageKey.prototype.iv = null;
|
|
611
|
+
let $oneOfFields;
|
|
612
|
+
Object.defineProperty(MessageKey.prototype, "_index", {
|
|
613
|
+
get: $util.oneOfGetter($oneOfFields = ["index"]),
|
|
614
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
615
|
+
});
|
|
616
|
+
Object.defineProperty(MessageKey.prototype, "_cipherKey", {
|
|
617
|
+
get: $util.oneOfGetter($oneOfFields = ["cipherKey"]),
|
|
618
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
619
|
+
});
|
|
620
|
+
Object.defineProperty(MessageKey.prototype, "_macKey", {
|
|
621
|
+
get: $util.oneOfGetter($oneOfFields = ["macKey"]),
|
|
622
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
623
|
+
});
|
|
624
|
+
Object.defineProperty(MessageKey.prototype, "_iv", {
|
|
625
|
+
get: $util.oneOfGetter($oneOfFields = ["iv"]),
|
|
626
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
627
|
+
});
|
|
628
|
+
MessageKey.create = function create(properties) {
|
|
629
|
+
return new MessageKey(properties);
|
|
630
|
+
};
|
|
631
|
+
MessageKey.encode = function encode(m, w) {
|
|
632
|
+
if (!w)
|
|
633
|
+
w = $Writer.create();
|
|
634
|
+
if (m.index != null && Object.hasOwnProperty.call(m, "index"))
|
|
635
|
+
w.uint32(8).uint32(m.index);
|
|
636
|
+
if (m.cipherKey != null && Object.hasOwnProperty.call(m, "cipherKey"))
|
|
637
|
+
w.uint32(18).bytes(m.cipherKey);
|
|
638
|
+
if (m.macKey != null && Object.hasOwnProperty.call(m, "macKey"))
|
|
639
|
+
w.uint32(26).bytes(m.macKey);
|
|
640
|
+
if (m.iv != null && Object.hasOwnProperty.call(m, "iv"))
|
|
641
|
+
w.uint32(34).bytes(m.iv);
|
|
642
|
+
return w;
|
|
643
|
+
};
|
|
644
|
+
MessageKey.decode = function decode(r, l, e, n) {
|
|
645
|
+
if (!(r instanceof $Reader))
|
|
646
|
+
r = $Reader.create(r);
|
|
647
|
+
if (n === undefined)
|
|
648
|
+
n = 0;
|
|
649
|
+
if (n > $Reader.recursionLimit)
|
|
650
|
+
throw Error("maximum nesting depth exceeded");
|
|
651
|
+
var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SessionStructure.Chain.MessageKey();
|
|
652
|
+
while (r.pos < c) {
|
|
653
|
+
var t = r.uint32();
|
|
654
|
+
if (t === e)
|
|
655
|
+
break;
|
|
656
|
+
switch (t >>> 3) {
|
|
657
|
+
case 1: {
|
|
658
|
+
m.index = r.uint32();
|
|
659
|
+
break;
|
|
660
|
+
}
|
|
661
|
+
case 2: {
|
|
662
|
+
m.cipherKey = r.bytes();
|
|
663
|
+
break;
|
|
664
|
+
}
|
|
665
|
+
case 3: {
|
|
666
|
+
m.macKey = r.bytes();
|
|
667
|
+
break;
|
|
668
|
+
}
|
|
669
|
+
case 4: {
|
|
670
|
+
m.iv = r.bytes();
|
|
671
|
+
break;
|
|
672
|
+
}
|
|
673
|
+
default:
|
|
674
|
+
r.skipType(t & 7, n);
|
|
675
|
+
break;
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
return m;
|
|
679
|
+
};
|
|
680
|
+
MessageKey.fromObject = function fromObject(d, n) {
|
|
681
|
+
if (d instanceof $root.proto.SessionStructure.Chain.MessageKey)
|
|
682
|
+
return d;
|
|
683
|
+
if (n === undefined)
|
|
684
|
+
n = 0;
|
|
685
|
+
if (n > $util.recursionLimit)
|
|
686
|
+
throw Error("maximum nesting depth exceeded");
|
|
687
|
+
var m = new $root.proto.SessionStructure.Chain.MessageKey();
|
|
688
|
+
if (d.index != null) {
|
|
689
|
+
m.index = d.index >>> 0;
|
|
690
|
+
}
|
|
691
|
+
if (d.cipherKey != null) {
|
|
692
|
+
if (typeof d.cipherKey === "string")
|
|
693
|
+
$util.base64.decode(d.cipherKey, m.cipherKey = $util.newBuffer($util.base64.length(d.cipherKey)), 0);
|
|
694
|
+
else if (d.cipherKey.length >= 0)
|
|
695
|
+
m.cipherKey = d.cipherKey;
|
|
696
|
+
}
|
|
697
|
+
if (d.macKey != null) {
|
|
698
|
+
if (typeof d.macKey === "string")
|
|
699
|
+
$util.base64.decode(d.macKey, m.macKey = $util.newBuffer($util.base64.length(d.macKey)), 0);
|
|
700
|
+
else if (d.macKey.length >= 0)
|
|
701
|
+
m.macKey = d.macKey;
|
|
702
|
+
}
|
|
703
|
+
if (d.iv != null) {
|
|
704
|
+
if (typeof d.iv === "string")
|
|
705
|
+
$util.base64.decode(d.iv, m.iv = $util.newBuffer($util.base64.length(d.iv)), 0);
|
|
706
|
+
else if (d.iv.length >= 0)
|
|
707
|
+
m.iv = d.iv;
|
|
708
|
+
}
|
|
709
|
+
return m;
|
|
710
|
+
};
|
|
711
|
+
MessageKey.toObject = function toObject(m, o) {
|
|
712
|
+
if (!o)
|
|
713
|
+
o = {};
|
|
714
|
+
var d = {};
|
|
715
|
+
if (m.index != null && m.hasOwnProperty("index")) {
|
|
716
|
+
d.index = m.index;
|
|
717
|
+
if (o.oneofs)
|
|
718
|
+
d._index = "index";
|
|
719
|
+
}
|
|
720
|
+
if (m.cipherKey != null && m.hasOwnProperty("cipherKey")) {
|
|
721
|
+
d.cipherKey = o.bytes === String ? $util.base64.encode(m.cipherKey, 0, m.cipherKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.cipherKey) : m.cipherKey;
|
|
722
|
+
if (o.oneofs)
|
|
723
|
+
d._cipherKey = "cipherKey";
|
|
724
|
+
}
|
|
725
|
+
if (m.macKey != null && m.hasOwnProperty("macKey")) {
|
|
726
|
+
d.macKey = o.bytes === String ? $util.base64.encode(m.macKey, 0, m.macKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.macKey) : m.macKey;
|
|
727
|
+
if (o.oneofs)
|
|
728
|
+
d._macKey = "macKey";
|
|
729
|
+
}
|
|
730
|
+
if (m.iv != null && m.hasOwnProperty("iv")) {
|
|
731
|
+
d.iv = o.bytes === String ? $util.base64.encode(m.iv, 0, m.iv.length) : o.bytes === Array ? Array.prototype.slice.call(m.iv) : m.iv;
|
|
732
|
+
if (o.oneofs)
|
|
733
|
+
d._iv = "iv";
|
|
734
|
+
}
|
|
735
|
+
return d;
|
|
736
|
+
};
|
|
737
|
+
MessageKey.prototype.toJSON = function toJSON() {
|
|
738
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
739
|
+
};
|
|
740
|
+
MessageKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
741
|
+
if (typeUrlPrefix === undefined) {
|
|
742
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
743
|
+
}
|
|
744
|
+
return typeUrlPrefix + "/proto.SessionStructure.Chain.MessageKey";
|
|
745
|
+
};
|
|
746
|
+
return MessageKey;
|
|
747
|
+
});
|
|
748
|
+
return Chain;
|
|
749
|
+
});
|
|
750
|
+
$lazy(SessionStructure, "PendingKeyExchange", function() {
|
|
751
|
+
function PendingKeyExchange(p) {
|
|
752
|
+
if (p)
|
|
753
|
+
for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
|
|
754
|
+
if (p[ks[i]] != null && ks[i] !== "__proto__")
|
|
755
|
+
this[ks[i]] = p[ks[i]];
|
|
756
|
+
}
|
|
757
|
+
PendingKeyExchange.prototype.sequence = null;
|
|
758
|
+
PendingKeyExchange.prototype.localBaseKey = null;
|
|
759
|
+
PendingKeyExchange.prototype.localBaseKeyPrivate = null;
|
|
760
|
+
PendingKeyExchange.prototype.localRatchetKey = null;
|
|
761
|
+
PendingKeyExchange.prototype.localRatchetKeyPrivate = null;
|
|
762
|
+
PendingKeyExchange.prototype.localIdentityKey = null;
|
|
763
|
+
PendingKeyExchange.prototype.localIdentityKeyPrivate = null;
|
|
764
|
+
let $oneOfFields;
|
|
765
|
+
Object.defineProperty(PendingKeyExchange.prototype, "_sequence", {
|
|
766
|
+
get: $util.oneOfGetter($oneOfFields = ["sequence"]),
|
|
767
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
768
|
+
});
|
|
769
|
+
Object.defineProperty(PendingKeyExchange.prototype, "_localBaseKey", {
|
|
770
|
+
get: $util.oneOfGetter($oneOfFields = ["localBaseKey"]),
|
|
771
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
772
|
+
});
|
|
773
|
+
Object.defineProperty(PendingKeyExchange.prototype, "_localBaseKeyPrivate", {
|
|
774
|
+
get: $util.oneOfGetter($oneOfFields = ["localBaseKeyPrivate"]),
|
|
775
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
776
|
+
});
|
|
777
|
+
Object.defineProperty(PendingKeyExchange.prototype, "_localRatchetKey", {
|
|
778
|
+
get: $util.oneOfGetter($oneOfFields = ["localRatchetKey"]),
|
|
779
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
780
|
+
});
|
|
781
|
+
Object.defineProperty(PendingKeyExchange.prototype, "_localRatchetKeyPrivate", {
|
|
782
|
+
get: $util.oneOfGetter($oneOfFields = ["localRatchetKeyPrivate"]),
|
|
783
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
784
|
+
});
|
|
785
|
+
Object.defineProperty(PendingKeyExchange.prototype, "_localIdentityKey", {
|
|
786
|
+
get: $util.oneOfGetter($oneOfFields = ["localIdentityKey"]),
|
|
787
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
788
|
+
});
|
|
789
|
+
Object.defineProperty(PendingKeyExchange.prototype, "_localIdentityKeyPrivate", {
|
|
790
|
+
get: $util.oneOfGetter($oneOfFields = ["localIdentityKeyPrivate"]),
|
|
791
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
792
|
+
});
|
|
793
|
+
PendingKeyExchange.create = function create(properties) {
|
|
794
|
+
return new PendingKeyExchange(properties);
|
|
795
|
+
};
|
|
796
|
+
PendingKeyExchange.encode = function encode(m, w) {
|
|
797
|
+
if (!w)
|
|
798
|
+
w = $Writer.create();
|
|
799
|
+
if (m.sequence != null && Object.hasOwnProperty.call(m, "sequence"))
|
|
800
|
+
w.uint32(8).uint32(m.sequence);
|
|
801
|
+
if (m.localBaseKey != null && Object.hasOwnProperty.call(m, "localBaseKey"))
|
|
802
|
+
w.uint32(18).bytes(m.localBaseKey);
|
|
803
|
+
if (m.localBaseKeyPrivate != null && Object.hasOwnProperty.call(m, "localBaseKeyPrivate"))
|
|
804
|
+
w.uint32(26).bytes(m.localBaseKeyPrivate);
|
|
805
|
+
if (m.localRatchetKey != null && Object.hasOwnProperty.call(m, "localRatchetKey"))
|
|
806
|
+
w.uint32(34).bytes(m.localRatchetKey);
|
|
807
|
+
if (m.localRatchetKeyPrivate != null && Object.hasOwnProperty.call(m, "localRatchetKeyPrivate"))
|
|
808
|
+
w.uint32(42).bytes(m.localRatchetKeyPrivate);
|
|
809
|
+
if (m.localIdentityKey != null && Object.hasOwnProperty.call(m, "localIdentityKey"))
|
|
810
|
+
w.uint32(58).bytes(m.localIdentityKey);
|
|
811
|
+
if (m.localIdentityKeyPrivate != null && Object.hasOwnProperty.call(m, "localIdentityKeyPrivate"))
|
|
812
|
+
w.uint32(66).bytes(m.localIdentityKeyPrivate);
|
|
813
|
+
return w;
|
|
814
|
+
};
|
|
815
|
+
PendingKeyExchange.decode = function decode(r, l, e, n) {
|
|
816
|
+
if (!(r instanceof $Reader))
|
|
817
|
+
r = $Reader.create(r);
|
|
818
|
+
if (n === undefined)
|
|
819
|
+
n = 0;
|
|
820
|
+
if (n > $Reader.recursionLimit)
|
|
821
|
+
throw Error("maximum nesting depth exceeded");
|
|
822
|
+
var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SessionStructure.PendingKeyExchange();
|
|
823
|
+
while (r.pos < c) {
|
|
824
|
+
var t = r.uint32();
|
|
825
|
+
if (t === e)
|
|
826
|
+
break;
|
|
827
|
+
switch (t >>> 3) {
|
|
828
|
+
case 1: {
|
|
829
|
+
m.sequence = r.uint32();
|
|
830
|
+
break;
|
|
831
|
+
}
|
|
832
|
+
case 2: {
|
|
833
|
+
m.localBaseKey = r.bytes();
|
|
834
|
+
break;
|
|
835
|
+
}
|
|
836
|
+
case 3: {
|
|
837
|
+
m.localBaseKeyPrivate = r.bytes();
|
|
838
|
+
break;
|
|
839
|
+
}
|
|
840
|
+
case 4: {
|
|
841
|
+
m.localRatchetKey = r.bytes();
|
|
842
|
+
break;
|
|
843
|
+
}
|
|
844
|
+
case 5: {
|
|
845
|
+
m.localRatchetKeyPrivate = r.bytes();
|
|
846
|
+
break;
|
|
847
|
+
}
|
|
848
|
+
case 7: {
|
|
849
|
+
m.localIdentityKey = r.bytes();
|
|
850
|
+
break;
|
|
851
|
+
}
|
|
852
|
+
case 8: {
|
|
853
|
+
m.localIdentityKeyPrivate = r.bytes();
|
|
854
|
+
break;
|
|
855
|
+
}
|
|
856
|
+
default:
|
|
857
|
+
r.skipType(t & 7, n);
|
|
858
|
+
break;
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
return m;
|
|
862
|
+
};
|
|
863
|
+
PendingKeyExchange.fromObject = function fromObject(d, n) {
|
|
864
|
+
if (d instanceof $root.proto.SessionStructure.PendingKeyExchange)
|
|
865
|
+
return d;
|
|
866
|
+
if (n === undefined)
|
|
867
|
+
n = 0;
|
|
868
|
+
if (n > $util.recursionLimit)
|
|
869
|
+
throw Error("maximum nesting depth exceeded");
|
|
870
|
+
var m = new $root.proto.SessionStructure.PendingKeyExchange();
|
|
871
|
+
if (d.sequence != null) {
|
|
872
|
+
m.sequence = d.sequence >>> 0;
|
|
873
|
+
}
|
|
874
|
+
if (d.localBaseKey != null) {
|
|
875
|
+
if (typeof d.localBaseKey === "string")
|
|
876
|
+
$util.base64.decode(d.localBaseKey, m.localBaseKey = $util.newBuffer($util.base64.length(d.localBaseKey)), 0);
|
|
877
|
+
else if (d.localBaseKey.length >= 0)
|
|
878
|
+
m.localBaseKey = d.localBaseKey;
|
|
879
|
+
}
|
|
880
|
+
if (d.localBaseKeyPrivate != null) {
|
|
881
|
+
if (typeof d.localBaseKeyPrivate === "string")
|
|
882
|
+
$util.base64.decode(d.localBaseKeyPrivate, m.localBaseKeyPrivate = $util.newBuffer($util.base64.length(d.localBaseKeyPrivate)), 0);
|
|
883
|
+
else if (d.localBaseKeyPrivate.length >= 0)
|
|
884
|
+
m.localBaseKeyPrivate = d.localBaseKeyPrivate;
|
|
885
|
+
}
|
|
886
|
+
if (d.localRatchetKey != null) {
|
|
887
|
+
if (typeof d.localRatchetKey === "string")
|
|
888
|
+
$util.base64.decode(d.localRatchetKey, m.localRatchetKey = $util.newBuffer($util.base64.length(d.localRatchetKey)), 0);
|
|
889
|
+
else if (d.localRatchetKey.length >= 0)
|
|
890
|
+
m.localRatchetKey = d.localRatchetKey;
|
|
891
|
+
}
|
|
892
|
+
if (d.localRatchetKeyPrivate != null) {
|
|
893
|
+
if (typeof d.localRatchetKeyPrivate === "string")
|
|
894
|
+
$util.base64.decode(d.localRatchetKeyPrivate, m.localRatchetKeyPrivate = $util.newBuffer($util.base64.length(d.localRatchetKeyPrivate)), 0);
|
|
895
|
+
else if (d.localRatchetKeyPrivate.length >= 0)
|
|
896
|
+
m.localRatchetKeyPrivate = d.localRatchetKeyPrivate;
|
|
897
|
+
}
|
|
898
|
+
if (d.localIdentityKey != null) {
|
|
899
|
+
if (typeof d.localIdentityKey === "string")
|
|
900
|
+
$util.base64.decode(d.localIdentityKey, m.localIdentityKey = $util.newBuffer($util.base64.length(d.localIdentityKey)), 0);
|
|
901
|
+
else if (d.localIdentityKey.length >= 0)
|
|
902
|
+
m.localIdentityKey = d.localIdentityKey;
|
|
903
|
+
}
|
|
904
|
+
if (d.localIdentityKeyPrivate != null) {
|
|
905
|
+
if (typeof d.localIdentityKeyPrivate === "string")
|
|
906
|
+
$util.base64.decode(d.localIdentityKeyPrivate, m.localIdentityKeyPrivate = $util.newBuffer($util.base64.length(d.localIdentityKeyPrivate)), 0);
|
|
907
|
+
else if (d.localIdentityKeyPrivate.length >= 0)
|
|
908
|
+
m.localIdentityKeyPrivate = d.localIdentityKeyPrivate;
|
|
909
|
+
}
|
|
910
|
+
return m;
|
|
911
|
+
};
|
|
912
|
+
PendingKeyExchange.toObject = function toObject(m, o) {
|
|
913
|
+
if (!o)
|
|
914
|
+
o = {};
|
|
915
|
+
var d = {};
|
|
916
|
+
if (m.sequence != null && m.hasOwnProperty("sequence")) {
|
|
917
|
+
d.sequence = m.sequence;
|
|
918
|
+
if (o.oneofs)
|
|
919
|
+
d._sequence = "sequence";
|
|
920
|
+
}
|
|
921
|
+
if (m.localBaseKey != null && m.hasOwnProperty("localBaseKey")) {
|
|
922
|
+
d.localBaseKey = o.bytes === String ? $util.base64.encode(m.localBaseKey, 0, m.localBaseKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.localBaseKey) : m.localBaseKey;
|
|
923
|
+
if (o.oneofs)
|
|
924
|
+
d._localBaseKey = "localBaseKey";
|
|
925
|
+
}
|
|
926
|
+
if (m.localBaseKeyPrivate != null && m.hasOwnProperty("localBaseKeyPrivate")) {
|
|
927
|
+
d.localBaseKeyPrivate = o.bytes === String ? $util.base64.encode(m.localBaseKeyPrivate, 0, m.localBaseKeyPrivate.length) : o.bytes === Array ? Array.prototype.slice.call(m.localBaseKeyPrivate) : m.localBaseKeyPrivate;
|
|
928
|
+
if (o.oneofs)
|
|
929
|
+
d._localBaseKeyPrivate = "localBaseKeyPrivate";
|
|
930
|
+
}
|
|
931
|
+
if (m.localRatchetKey != null && m.hasOwnProperty("localRatchetKey")) {
|
|
932
|
+
d.localRatchetKey = o.bytes === String ? $util.base64.encode(m.localRatchetKey, 0, m.localRatchetKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.localRatchetKey) : m.localRatchetKey;
|
|
933
|
+
if (o.oneofs)
|
|
934
|
+
d._localRatchetKey = "localRatchetKey";
|
|
935
|
+
}
|
|
936
|
+
if (m.localRatchetKeyPrivate != null && m.hasOwnProperty("localRatchetKeyPrivate")) {
|
|
937
|
+
d.localRatchetKeyPrivate = o.bytes === String ? $util.base64.encode(m.localRatchetKeyPrivate, 0, m.localRatchetKeyPrivate.length) : o.bytes === Array ? Array.prototype.slice.call(m.localRatchetKeyPrivate) : m.localRatchetKeyPrivate;
|
|
938
|
+
if (o.oneofs)
|
|
939
|
+
d._localRatchetKeyPrivate = "localRatchetKeyPrivate";
|
|
940
|
+
}
|
|
941
|
+
if (m.localIdentityKey != null && m.hasOwnProperty("localIdentityKey")) {
|
|
942
|
+
d.localIdentityKey = o.bytes === String ? $util.base64.encode(m.localIdentityKey, 0, m.localIdentityKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.localIdentityKey) : m.localIdentityKey;
|
|
943
|
+
if (o.oneofs)
|
|
944
|
+
d._localIdentityKey = "localIdentityKey";
|
|
945
|
+
}
|
|
946
|
+
if (m.localIdentityKeyPrivate != null && m.hasOwnProperty("localIdentityKeyPrivate")) {
|
|
947
|
+
d.localIdentityKeyPrivate = o.bytes === String ? $util.base64.encode(m.localIdentityKeyPrivate, 0, m.localIdentityKeyPrivate.length) : o.bytes === Array ? Array.prototype.slice.call(m.localIdentityKeyPrivate) : m.localIdentityKeyPrivate;
|
|
948
|
+
if (o.oneofs)
|
|
949
|
+
d._localIdentityKeyPrivate = "localIdentityKeyPrivate";
|
|
950
|
+
}
|
|
951
|
+
return d;
|
|
952
|
+
};
|
|
953
|
+
PendingKeyExchange.prototype.toJSON = function toJSON() {
|
|
954
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
955
|
+
};
|
|
956
|
+
PendingKeyExchange.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
957
|
+
if (typeUrlPrefix === undefined) {
|
|
958
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
959
|
+
}
|
|
960
|
+
return typeUrlPrefix + "/proto.SessionStructure.PendingKeyExchange";
|
|
961
|
+
};
|
|
962
|
+
return PendingKeyExchange;
|
|
963
|
+
});
|
|
964
|
+
$lazy(SessionStructure, "PendingPreKey", function() {
|
|
965
|
+
function PendingPreKey(p) {
|
|
966
|
+
if (p)
|
|
967
|
+
for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
|
|
968
|
+
if (p[ks[i]] != null && ks[i] !== "__proto__")
|
|
969
|
+
this[ks[i]] = p[ks[i]];
|
|
970
|
+
}
|
|
971
|
+
PendingPreKey.prototype.preKeyId = null;
|
|
972
|
+
PendingPreKey.prototype.signedPreKeyId = null;
|
|
973
|
+
PendingPreKey.prototype.baseKey = null;
|
|
974
|
+
let $oneOfFields;
|
|
975
|
+
Object.defineProperty(PendingPreKey.prototype, "_preKeyId", {
|
|
976
|
+
get: $util.oneOfGetter($oneOfFields = ["preKeyId"]),
|
|
977
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
978
|
+
});
|
|
979
|
+
Object.defineProperty(PendingPreKey.prototype, "_signedPreKeyId", {
|
|
980
|
+
get: $util.oneOfGetter($oneOfFields = ["signedPreKeyId"]),
|
|
981
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
982
|
+
});
|
|
983
|
+
Object.defineProperty(PendingPreKey.prototype, "_baseKey", {
|
|
984
|
+
get: $util.oneOfGetter($oneOfFields = ["baseKey"]),
|
|
985
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
986
|
+
});
|
|
987
|
+
PendingPreKey.create = function create(properties) {
|
|
988
|
+
return new PendingPreKey(properties);
|
|
989
|
+
};
|
|
990
|
+
PendingPreKey.encode = function encode(m, w) {
|
|
991
|
+
if (!w)
|
|
992
|
+
w = $Writer.create();
|
|
993
|
+
if (m.preKeyId != null && Object.hasOwnProperty.call(m, "preKeyId"))
|
|
994
|
+
w.uint32(8).uint32(m.preKeyId);
|
|
995
|
+
if (m.baseKey != null && Object.hasOwnProperty.call(m, "baseKey"))
|
|
996
|
+
w.uint32(18).bytes(m.baseKey);
|
|
997
|
+
if (m.signedPreKeyId != null && Object.hasOwnProperty.call(m, "signedPreKeyId"))
|
|
998
|
+
w.uint32(24).int32(m.signedPreKeyId);
|
|
999
|
+
return w;
|
|
1000
|
+
};
|
|
1001
|
+
PendingPreKey.decode = function decode(r, l, e, n) {
|
|
1002
|
+
if (!(r instanceof $Reader))
|
|
1003
|
+
r = $Reader.create(r);
|
|
1004
|
+
if (n === undefined)
|
|
1005
|
+
n = 0;
|
|
1006
|
+
if (n > $Reader.recursionLimit)
|
|
1007
|
+
throw Error("maximum nesting depth exceeded");
|
|
1008
|
+
var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SessionStructure.PendingPreKey();
|
|
1009
|
+
while (r.pos < c) {
|
|
1010
|
+
var t = r.uint32();
|
|
1011
|
+
if (t === e)
|
|
1012
|
+
break;
|
|
1013
|
+
switch (t >>> 3) {
|
|
1014
|
+
case 1: {
|
|
1015
|
+
m.preKeyId = r.uint32();
|
|
1016
|
+
break;
|
|
1017
|
+
}
|
|
1018
|
+
case 3: {
|
|
1019
|
+
m.signedPreKeyId = r.int32();
|
|
1020
|
+
break;
|
|
1021
|
+
}
|
|
1022
|
+
case 2: {
|
|
1023
|
+
m.baseKey = r.bytes();
|
|
1024
|
+
break;
|
|
1025
|
+
}
|
|
1026
|
+
default:
|
|
1027
|
+
r.skipType(t & 7, n);
|
|
1028
|
+
break;
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
return m;
|
|
1032
|
+
};
|
|
1033
|
+
PendingPreKey.fromObject = function fromObject(d, n) {
|
|
1034
|
+
if (d instanceof $root.proto.SessionStructure.PendingPreKey)
|
|
1035
|
+
return d;
|
|
1036
|
+
if (n === undefined)
|
|
1037
|
+
n = 0;
|
|
1038
|
+
if (n > $util.recursionLimit)
|
|
1039
|
+
throw Error("maximum nesting depth exceeded");
|
|
1040
|
+
var m = new $root.proto.SessionStructure.PendingPreKey();
|
|
1041
|
+
if (d.preKeyId != null) {
|
|
1042
|
+
m.preKeyId = d.preKeyId >>> 0;
|
|
1043
|
+
}
|
|
1044
|
+
if (d.signedPreKeyId != null) {
|
|
1045
|
+
m.signedPreKeyId = d.signedPreKeyId | 0;
|
|
1046
|
+
}
|
|
1047
|
+
if (d.baseKey != null) {
|
|
1048
|
+
if (typeof d.baseKey === "string")
|
|
1049
|
+
$util.base64.decode(d.baseKey, m.baseKey = $util.newBuffer($util.base64.length(d.baseKey)), 0);
|
|
1050
|
+
else if (d.baseKey.length >= 0)
|
|
1051
|
+
m.baseKey = d.baseKey;
|
|
1052
|
+
}
|
|
1053
|
+
return m;
|
|
1054
|
+
};
|
|
1055
|
+
PendingPreKey.toObject = function toObject(m, o) {
|
|
1056
|
+
if (!o)
|
|
1057
|
+
o = {};
|
|
1058
|
+
var d = {};
|
|
1059
|
+
if (m.preKeyId != null && m.hasOwnProperty("preKeyId")) {
|
|
1060
|
+
d.preKeyId = m.preKeyId;
|
|
1061
|
+
if (o.oneofs)
|
|
1062
|
+
d._preKeyId = "preKeyId";
|
|
1063
|
+
}
|
|
1064
|
+
if (m.baseKey != null && m.hasOwnProperty("baseKey")) {
|
|
1065
|
+
d.baseKey = o.bytes === String ? $util.base64.encode(m.baseKey, 0, m.baseKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.baseKey) : m.baseKey;
|
|
1066
|
+
if (o.oneofs)
|
|
1067
|
+
d._baseKey = "baseKey";
|
|
1068
|
+
}
|
|
1069
|
+
if (m.signedPreKeyId != null && m.hasOwnProperty("signedPreKeyId")) {
|
|
1070
|
+
d.signedPreKeyId = m.signedPreKeyId;
|
|
1071
|
+
if (o.oneofs)
|
|
1072
|
+
d._signedPreKeyId = "signedPreKeyId";
|
|
1073
|
+
}
|
|
1074
|
+
return d;
|
|
1075
|
+
};
|
|
1076
|
+
PendingPreKey.prototype.toJSON = function toJSON() {
|
|
1077
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
1078
|
+
};
|
|
1079
|
+
PendingPreKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
1080
|
+
if (typeUrlPrefix === undefined) {
|
|
1081
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
1082
|
+
}
|
|
1083
|
+
return typeUrlPrefix + "/proto.SessionStructure.PendingPreKey";
|
|
1084
|
+
};
|
|
1085
|
+
return PendingPreKey;
|
|
1086
|
+
});
|
|
1087
|
+
return SessionStructure;
|