@hiroosy/baileys-lite 0.3.3 → 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.
Files changed (242) hide show
  1. package/WAProto/index.js +247 -113252
  2. package/WAProto/parts/ADVDeviceIdentity.part +201 -0
  3. package/WAProto/parts/ADVEncryptionType.part +6 -0
  4. package/WAProto/parts/ADVKeyIndexList.part +201 -0
  5. package/WAProto/parts/ADVSignedDeviceIdentity.part +150 -0
  6. package/WAProto/parts/ADVSignedDeviceIdentityHMAC.part +142 -0
  7. package/WAProto/parts/ADVSignedKeyIndexList.part +128 -0
  8. package/WAProto/parts/AIHomeState.part +405 -0
  9. package/WAProto/parts/AIMediaCollectionMessage.part +119 -0
  10. package/WAProto/parts/AIMediaCollectionMetadata.part +100 -0
  11. package/WAProto/parts/AIMetadataOperation.part +83 -0
  12. package/WAProto/parts/AIQueryFanout.part +133 -0
  13. package/WAProto/parts/AIRegenerateMetadata.part +112 -0
  14. package/WAProto/parts/AIRichResponseCodeMetadata.part +252 -0
  15. package/WAProto/parts/AIRichResponseContentItemsMetadata.part +354 -0
  16. package/WAProto/parts/AIRichResponseDynamicMetadata.part +172 -0
  17. package/WAProto/parts/AIRichResponseGridImageMetadata.part +114 -0
  18. package/WAProto/parts/AIRichResponseImageURL.part +119 -0
  19. package/WAProto/parts/AIRichResponseInlineImageMetadata.part +164 -0
  20. package/WAProto/parts/AIRichResponseLatexMetadata.part +346 -0
  21. package/WAProto/parts/AIRichResponseMapMetadata.part +346 -0
  22. package/WAProto/parts/AIRichResponseMessage.part +167 -0
  23. package/WAProto/parts/AIRichResponseMessageType.part +5 -0
  24. package/WAProto/parts/AIRichResponseSubMessage.part +313 -0
  25. package/WAProto/parts/AIRichResponseSubMessageType.part +13 -0
  26. package/WAProto/parts/AIRichResponseTableMetadata.part +223 -0
  27. package/WAProto/parts/AIRichResponseUnifiedResponse.part +84 -0
  28. package/WAProto/parts/AISubscriptionRequestType.part +7 -0
  29. package/WAProto/parts/AISubscriptionUpsellMetadata.part +102 -0
  30. package/WAProto/parts/AIThreadInfo.part +316 -0
  31. package/WAProto/parts/Account.part +138 -0
  32. package/WAProto/parts/ActionLink.part +100 -0
  33. package/WAProto/parts/AutoDownloadSettings.part +138 -0
  34. package/WAProto/parts/AvatarUserSettings.part +100 -0
  35. package/WAProto/parts/BizAccountLinkInfo.part +210 -0
  36. package/WAProto/parts/BizAccountPayload.part +105 -0
  37. package/WAProto/parts/BizIdentityInfo.part +298 -0
  38. package/WAProto/parts/BotAgeCollectionMetadata.part +138 -0
  39. package/WAProto/parts/BotAgentDeepLinkMetadata.part +81 -0
  40. package/WAProto/parts/BotAgentMetadata.part +83 -0
  41. package/WAProto/parts/BotCapabilityMetadata.part +437 -0
  42. package/WAProto/parts/BotCommandMetadata.part +119 -0
  43. package/WAProto/parts/BotDocumentMessageMetadata.part +100 -0
  44. package/WAProto/parts/BotFeedbackMessage.part +1366 -0
  45. package/WAProto/parts/BotGroupMetadata.part +92 -0
  46. package/WAProto/parts/BotGroupParticipantMetadata.part +81 -0
  47. package/WAProto/parts/BotImagineMetadata.part +134 -0
  48. package/WAProto/parts/BotInfrastructureDiagnostics.part +148 -0
  49. package/WAProto/parts/BotLinkedAccount.part +95 -0
  50. package/WAProto/parts/BotLinkedAccountsMetadata.part +134 -0
  51. package/WAProto/parts/BotMediaMetadata.part +229 -0
  52. package/WAProto/parts/BotMemoryFact.part +100 -0
  53. package/WAProto/parts/BotMemoryMetadata.part +141 -0
  54. package/WAProto/parts/BotMemuMetadata.part +92 -0
  55. package/WAProto/parts/BotMessageOrigin.part +95 -0
  56. package/WAProto/parts/BotMessageOriginMetadata.part +92 -0
  57. package/WAProto/parts/BotMessageSharingInfo.part +297 -0
  58. package/WAProto/parts/BotMetadata.part +934 -0
  59. package/WAProto/parts/BotMetricsEntryPoint.part +51 -0
  60. package/WAProto/parts/BotMetricsMetadata.part +341 -0
  61. package/WAProto/parts/BotMetricsThreadEntryPoint.part +8 -0
  62. package/WAProto/parts/BotModeSelectionMetadata.part +151 -0
  63. package/WAProto/parts/BotModelMetadata.part +167 -0
  64. package/WAProto/parts/BotPluginMetadata.part +379 -0
  65. package/WAProto/parts/BotProgressIndicatorMetadata.part +837 -0
  66. package/WAProto/parts/BotPromotionMessageMetadata.part +124 -0
  67. package/WAProto/parts/BotPromptSuggestion.part +100 -0
  68. package/WAProto/parts/BotPromptSuggestions.part +92 -0
  69. package/WAProto/parts/BotPttPromptMetadata.part +81 -0
  70. package/WAProto/parts/BotQuotaMetadata.part +241 -0
  71. package/WAProto/parts/BotReminderMetadata.part +232 -0
  72. package/WAProto/parts/BotRenderingConfigMetadata.part +100 -0
  73. package/WAProto/parts/BotRenderingMetadata.part +203 -0
  74. package/WAProto/parts/BotResolvedToolCallMetadata.part +100 -0
  75. package/WAProto/parts/BotSessionMetadata.part +137 -0
  76. package/WAProto/parts/BotSessionSource.part +11 -0
  77. package/WAProto/parts/BotSignatureVerificationMetadata.part +92 -0
  78. package/WAProto/parts/BotSignatureVerificationUseCaseProof.part +183 -0
  79. package/WAProto/parts/BotSourcesMetadata.part +322 -0
  80. package/WAProto/parts/BotSuggestedPromptMetadata.part +150 -0
  81. package/WAProto/parts/BotUnifiedResponseMutation.part +339 -0
  82. package/WAProto/parts/CallLogRecord.part +646 -0
  83. package/WAProto/parts/CertChain.part +392 -0
  84. package/WAProto/parts/ChatLockSettings.part +102 -0
  85. package/WAProto/parts/ChatRowOpaqueData.part +712 -0
  86. package/WAProto/parts/Citation.part +119 -0
  87. package/WAProto/parts/ClientPairingProps.part +160 -0
  88. package/WAProto/parts/ClientPayload.part +2892 -0
  89. package/WAProto/parts/CollectionName.part +9 -0
  90. package/WAProto/parts/CommentMetadata.part +102 -0
  91. package/WAProto/parts/CompanionCommitment.part +84 -0
  92. package/WAProto/parts/CompanionEphemeralIdentity.part +227 -0
  93. package/WAProto/parts/Config.part +136 -0
  94. package/WAProto/parts/ContextInfo.part +4137 -0
  95. package/WAProto/parts/Conversation.part +1472 -0
  96. package/WAProto/parts/DeviceCapabilities.part +670 -0
  97. package/WAProto/parts/DeviceConsistencyCodeMessage.part +103 -0
  98. package/WAProto/parts/DeviceListMetadata.part +306 -0
  99. package/WAProto/parts/DeviceProps.part +982 -0
  100. package/WAProto/parts/DisappearingMode.part +206 -0
  101. package/WAProto/parts/EmbeddedContent.part +100 -0
  102. package/WAProto/parts/EmbeddedMessage.part +102 -0
  103. package/WAProto/parts/EmbeddedMusic.part +370 -0
  104. package/WAProto/parts/EncryptedPairingRequest.part +106 -0
  105. package/WAProto/parts/EphemeralSetting.part +110 -0
  106. package/WAProto/parts/EventAdditionalMetadata.part +81 -0
  107. package/WAProto/parts/EventResponse.part +152 -0
  108. package/WAProto/parts/ExitCode.part +110 -0
  109. package/WAProto/parts/ExternalBlobReference.part +195 -0
  110. package/WAProto/parts/Field.part +193 -0
  111. package/WAProto/parts/ForwardedAIBotMessageInfo.part +119 -0
  112. package/WAProto/parts/GlobalSettings.part +497 -0
  113. package/WAProto/parts/GroupHistoryBundleInfo.part +141 -0
  114. package/WAProto/parts/GroupHistoryIndividualMessageInfo.part +102 -0
  115. package/WAProto/parts/GroupMention.part +100 -0
  116. package/WAProto/parts/GroupParticipant.part +142 -0
  117. package/WAProto/parts/GroupRootKeyShare.part +92 -0
  118. package/WAProto/parts/GroupRootKeyShareEntry.part +161 -0
  119. package/WAProto/parts/HandshakeMessage.part +815 -0
  120. package/WAProto/parts/HatchMetadataSync.part +132 -0
  121. package/WAProto/parts/HistorySync.part +605 -0
  122. package/WAProto/parts/HistorySyncMsg.part +112 -0
  123. package/WAProto/parts/HydratedTemplateButton.part +501 -0
  124. package/WAProto/parts/IdentityKeyPairStructure.part +106 -0
  125. package/WAProto/parts/InThreadSurveyMetadata.part +779 -0
  126. package/WAProto/parts/InlineContact.part +157 -0
  127. package/WAProto/parts/InteractiveAnnotation.part +246 -0
  128. package/WAProto/parts/InteractiveMessageAdditionalMetadata.part +81 -0
  129. package/WAProto/parts/KeepInChat.part +225 -0
  130. package/WAProto/parts/KeepType.part +6 -0
  131. package/WAProto/parts/KeyExchangeMessage.part +169 -0
  132. package/WAProto/parts/KeyId.part +84 -0
  133. package/WAProto/parts/LIDMigrationMapping.part +149 -0
  134. package/WAProto/parts/LIDMigrationMappingSyncMessage.part +84 -0
  135. package/WAProto/parts/LIDMigrationMappingSyncPayload.part +122 -0
  136. package/WAProto/parts/LegacyMessage.part +104 -0
  137. package/WAProto/parts/LimitSharing.part +177 -0
  138. package/WAProto/parts/LocalizedName.part +119 -0
  139. package/WAProto/parts/Location.part +119 -0
  140. package/WAProto/parts/MediaData.part +81 -0
  141. package/WAProto/parts/MediaDomainInfo.part +120 -0
  142. package/WAProto/parts/MediaKeyDomain.part +6 -0
  143. package/WAProto/parts/MediaNotifyMessage.part +132 -0
  144. package/WAProto/parts/MediaRetryNotification.part +170 -0
  145. package/WAProto/parts/MediaVisibility.part +6 -0
  146. package/WAProto/parts/MemberLabel.part +110 -0
  147. package/WAProto/parts/Message.part +32376 -0
  148. package/WAProto/parts/MessageAddOn.part +305 -0
  149. package/WAProto/parts/MessageAddOnContextInfo.part +113 -0
  150. package/WAProto/parts/MessageAssociation.part +235 -0
  151. package/WAProto/parts/MessageContextInfo.part +451 -0
  152. package/WAProto/parts/MessageKey.part +138 -0
  153. package/WAProto/parts/MessageSecretMessage.part +125 -0
  154. package/WAProto/parts/Money.part +129 -0
  155. package/WAProto/parts/MsgOpaqueData.part +1732 -0
  156. package/WAProto/parts/MsgRowOpaqueData.part +104 -0
  157. package/WAProto/parts/MutationProps.part +89 -0
  158. package/WAProto/parts/NoiseCertificate.part +277 -0
  159. package/WAProto/parts/NotificationMessageInfo.part +152 -0
  160. package/WAProto/parts/NotificationSettings.part +176 -0
  161. package/WAProto/parts/PairingRequest.part +128 -0
  162. package/WAProto/parts/PastParticipant.part +148 -0
  163. package/WAProto/parts/PastParticipants.part +112 -0
  164. package/WAProto/parts/PatchDebugData.part +358 -0
  165. package/WAProto/parts/PaymentBackground.part +460 -0
  166. package/WAProto/parts/PaymentInfo.part +602 -0
  167. package/WAProto/parts/PhoneNumberToLIDMapping.part +100 -0
  168. package/WAProto/parts/PhotoChange.part +125 -0
  169. package/WAProto/parts/PinInChat.part +205 -0
  170. package/WAProto/parts/Point.part +138 -0
  171. package/WAProto/parts/PollAdditionalMetadata.part +216 -0
  172. package/WAProto/parts/PollEncValue.part +106 -0
  173. package/WAProto/parts/PollUpdate.part +202 -0
  174. package/WAProto/parts/PreKeyRecordStructure.part +125 -0
  175. package/WAProto/parts/PreKeySignalMessage.part +185 -0
  176. package/WAProto/parts/PremiumMessageInfo.part +81 -0
  177. package/WAProto/parts/PrimaryEphemeralIdentity.part +106 -0
  178. package/WAProto/parts/PrivacySystemMessage.part +6 -0
  179. package/WAProto/parts/ProcessedVideo.part +266 -0
  180. package/WAProto/parts/ProloguePayload.part +105 -0
  181. package/WAProto/parts/Pushname.part +100 -0
  182. package/WAProto/parts/QuarantinedMessage.part +103 -0
  183. package/WAProto/parts/Reaction.part +169 -0
  184. package/WAProto/parts/RecentEmojiWeight.part +100 -0
  185. package/WAProto/parts/RecordStructure.part +114 -0
  186. package/WAProto/parts/Reportable.part +138 -0
  187. package/WAProto/parts/ReportingTokenInfo.part +84 -0
  188. package/WAProto/parts/ScheduledMessageMetadata.part +132 -0
  189. package/WAProto/parts/SenderKeyDistributionMessage.part +144 -0
  190. package/WAProto/parts/SenderKeyMessage.part +122 -0
  191. package/WAProto/parts/SenderKeyRecordStructure.part +92 -0
  192. package/WAProto/parts/SenderKeyStateStructure.part +469 -0
  193. package/WAProto/parts/ServerErrorReceipt.part +81 -0
  194. package/WAProto/parts/SessionStructure.part +1087 -0
  195. package/WAProto/parts/SessionTransparencyMetadata.part +132 -0
  196. package/WAProto/parts/SessionTransparencyType.part +5 -0
  197. package/WAProto/parts/SignalMessage.part +144 -0
  198. package/WAProto/parts/SignedPreKeyRecordStructure.part +176 -0
  199. package/WAProto/parts/StatusAttribution.part +1235 -0
  200. package/WAProto/parts/StatusMentionMessage.part +83 -0
  201. package/WAProto/parts/StatusPSA.part +121 -0
  202. package/WAProto/parts/StickerMetadata.part +357 -0
  203. package/WAProto/parts/SyncActionData.part +146 -0
  204. package/WAProto/parts/SyncActionValue.part +12959 -0
  205. package/WAProto/parts/SyncdIndex.part +84 -0
  206. package/WAProto/parts/SyncdMutation.part +121 -0
  207. package/WAProto/parts/SyncdMutations.part +92 -0
  208. package/WAProto/parts/SyncdPatch.part +262 -0
  209. package/WAProto/parts/SyncdRecord.part +125 -0
  210. package/WAProto/parts/SyncdSnapshot.part +157 -0
  211. package/WAProto/parts/SyncdValue.part +84 -0
  212. package/WAProto/parts/SyncdVersion.part +91 -0
  213. package/WAProto/parts/TapLinkAction.part +100 -0
  214. package/WAProto/parts/TemplateButton.part +449 -0
  215. package/WAProto/parts/ThreadID.part +126 -0
  216. package/WAProto/parts/UrlTrackingMap.part +231 -0
  217. package/WAProto/parts/UserPassword.part +399 -0
  218. package/WAProto/parts/UserReceipt.part +221 -0
  219. package/WAProto/parts/VerifiedNameCertificate.part +318 -0
  220. package/WAProto/parts/WallpaperSettings.part +119 -0
  221. package/WAProto/parts/WebFeatures.part +1870 -0
  222. package/WAProto/parts/WebLinkRenderConfig.part +5 -0
  223. package/WAProto/parts/WebMessageInfo.part +2851 -0
  224. package/WAProto/parts/WebNotificationsInfo.part +160 -0
  225. package/package.json +1 -1
  226. package/src/binary/wa-binary.js +4 -2
  227. package/src/defaults.js +2 -1
  228. package/src/foundation/cache.js +99 -24
  229. package/src/foundation/memory.js +103 -0
  230. package/src/signal/libsignal.js +1 -8
  231. package/src/signal/signal-repository.js +6 -4
  232. package/src/socket/chats.js +2 -0
  233. package/src/socket/messages-recv.js +5 -3
  234. package/src/socket/messages-send.js +2 -2
  235. package/src/socket/socket-core.js +3 -0
  236. package/src/utils/auth-state-core.js +2 -1
  237. package/src/utils/chat-sync.js +4 -0
  238. package/src/utils/media.js +13 -8
  239. package/src/utils/message-processing.js +22 -6
  240. package/src/utils/wa-protocol-core.js +6 -5
  241. package/src/wam/wam-constants.js +22 -22851
  242. package/src/wam/wam-data.json +1 -0
@@ -0,0 +1,670 @@
1
+ "use strict";
2
+ function DeviceCapabilities(p) {
3
+ if (p)
4
+ for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
5
+ if (p[ks[i]] != null && ks[i] !== "__proto__")
6
+ this[ks[i]] = p[ks[i]];
7
+ }
8
+ DeviceCapabilities.prototype.chatLockSupportLevel = null;
9
+ DeviceCapabilities.prototype.lidMigration = null;
10
+ DeviceCapabilities.prototype.businessBroadcast = null;
11
+ DeviceCapabilities.prototype.userHasAvatar = null;
12
+ DeviceCapabilities.prototype.memberNameTagPrimarySupport = null;
13
+ DeviceCapabilities.prototype.aiThread = null;
14
+ let $oneOfFields;
15
+ Object.defineProperty(DeviceCapabilities.prototype, "_chatLockSupportLevel", {
16
+ get: $util.oneOfGetter($oneOfFields = ["chatLockSupportLevel"]),
17
+ set: $util.oneOfSetter($oneOfFields)
18
+ });
19
+ Object.defineProperty(DeviceCapabilities.prototype, "_lidMigration", {
20
+ get: $util.oneOfGetter($oneOfFields = ["lidMigration"]),
21
+ set: $util.oneOfSetter($oneOfFields)
22
+ });
23
+ Object.defineProperty(DeviceCapabilities.prototype, "_businessBroadcast", {
24
+ get: $util.oneOfGetter($oneOfFields = ["businessBroadcast"]),
25
+ set: $util.oneOfSetter($oneOfFields)
26
+ });
27
+ Object.defineProperty(DeviceCapabilities.prototype, "_userHasAvatar", {
28
+ get: $util.oneOfGetter($oneOfFields = ["userHasAvatar"]),
29
+ set: $util.oneOfSetter($oneOfFields)
30
+ });
31
+ Object.defineProperty(DeviceCapabilities.prototype, "_memberNameTagPrimarySupport", {
32
+ get: $util.oneOfGetter($oneOfFields = ["memberNameTagPrimarySupport"]),
33
+ set: $util.oneOfSetter($oneOfFields)
34
+ });
35
+ Object.defineProperty(DeviceCapabilities.prototype, "_aiThread", {
36
+ get: $util.oneOfGetter($oneOfFields = ["aiThread"]),
37
+ set: $util.oneOfSetter($oneOfFields)
38
+ });
39
+ DeviceCapabilities.create = function create(properties) {
40
+ return new DeviceCapabilities(properties);
41
+ };
42
+ DeviceCapabilities.encode = function encode(m, w) {
43
+ if (!w)
44
+ w = $Writer.create();
45
+ if (m.chatLockSupportLevel != null && Object.hasOwnProperty.call(m, "chatLockSupportLevel"))
46
+ w.uint32(8).int32(m.chatLockSupportLevel);
47
+ if (m.lidMigration != null && Object.hasOwnProperty.call(m, "lidMigration"))
48
+ $root.proto.DeviceCapabilities.LIDMigration.encode(m.lidMigration, w.uint32(18).fork()).ldelim();
49
+ if (m.businessBroadcast != null && Object.hasOwnProperty.call(m, "businessBroadcast"))
50
+ $root.proto.DeviceCapabilities.BusinessBroadcast.encode(m.businessBroadcast, w.uint32(26).fork()).ldelim();
51
+ if (m.userHasAvatar != null && Object.hasOwnProperty.call(m, "userHasAvatar"))
52
+ $root.proto.DeviceCapabilities.UserHasAvatar.encode(m.userHasAvatar, w.uint32(34).fork()).ldelim();
53
+ if (m.memberNameTagPrimarySupport != null && Object.hasOwnProperty.call(m, "memberNameTagPrimarySupport"))
54
+ w.uint32(40).int32(m.memberNameTagPrimarySupport);
55
+ if (m.aiThread != null && Object.hasOwnProperty.call(m, "aiThread"))
56
+ $root.proto.DeviceCapabilities.AiThread.encode(m.aiThread, w.uint32(50).fork()).ldelim();
57
+ return w;
58
+ };
59
+ DeviceCapabilities.decode = function decode(r, l, e, n) {
60
+ if (!(r instanceof $Reader))
61
+ r = $Reader.create(r);
62
+ if (n === undefined)
63
+ n = 0;
64
+ if (n > $Reader.recursionLimit)
65
+ throw Error("maximum nesting depth exceeded");
66
+ var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.DeviceCapabilities();
67
+ while (r.pos < c) {
68
+ var t = r.uint32();
69
+ if (t === e)
70
+ break;
71
+ switch (t >>> 3) {
72
+ case 1: {
73
+ m.chatLockSupportLevel = r.int32();
74
+ break;
75
+ }
76
+ case 2: {
77
+ m.lidMigration = $root.proto.DeviceCapabilities.LIDMigration.decode(r, r.uint32(), undefined, n + 1);
78
+ break;
79
+ }
80
+ case 3: {
81
+ m.businessBroadcast = $root.proto.DeviceCapabilities.BusinessBroadcast.decode(r, r.uint32(), undefined, n + 1);
82
+ break;
83
+ }
84
+ case 4: {
85
+ m.userHasAvatar = $root.proto.DeviceCapabilities.UserHasAvatar.decode(r, r.uint32(), undefined, n + 1);
86
+ break;
87
+ }
88
+ case 5: {
89
+ m.memberNameTagPrimarySupport = r.int32();
90
+ break;
91
+ }
92
+ case 6: {
93
+ m.aiThread = $root.proto.DeviceCapabilities.AiThread.decode(r, r.uint32(), undefined, n + 1);
94
+ break;
95
+ }
96
+ default:
97
+ r.skipType(t & 7, n);
98
+ break;
99
+ }
100
+ }
101
+ return m;
102
+ };
103
+ DeviceCapabilities.fromObject = function fromObject(d, n) {
104
+ if (d instanceof $root.proto.DeviceCapabilities)
105
+ return d;
106
+ if (n === undefined)
107
+ n = 0;
108
+ if (n > $util.recursionLimit)
109
+ throw Error("maximum nesting depth exceeded");
110
+ var m = new $root.proto.DeviceCapabilities();
111
+ switch (d.chatLockSupportLevel) {
112
+ default:
113
+ if (typeof d.chatLockSupportLevel === "number") {
114
+ m.chatLockSupportLevel = d.chatLockSupportLevel;
115
+ break;
116
+ }
117
+ break;
118
+ case "NONE":
119
+ case 0:
120
+ m.chatLockSupportLevel = 0;
121
+ break;
122
+ case "MINIMAL":
123
+ case 1:
124
+ m.chatLockSupportLevel = 1;
125
+ break;
126
+ case "FULL":
127
+ case 2:
128
+ m.chatLockSupportLevel = 2;
129
+ break;
130
+ }
131
+ if (d.lidMigration != null) {
132
+ if (typeof d.lidMigration !== "object")
133
+ throw TypeError(".proto.DeviceCapabilities.lidMigration: object expected");
134
+ m.lidMigration = $root.proto.DeviceCapabilities.LIDMigration.fromObject(d.lidMigration, n + 1);
135
+ }
136
+ if (d.businessBroadcast != null) {
137
+ if (typeof d.businessBroadcast !== "object")
138
+ throw TypeError(".proto.DeviceCapabilities.businessBroadcast: object expected");
139
+ m.businessBroadcast = $root.proto.DeviceCapabilities.BusinessBroadcast.fromObject(d.businessBroadcast, n + 1);
140
+ }
141
+ if (d.userHasAvatar != null) {
142
+ if (typeof d.userHasAvatar !== "object")
143
+ throw TypeError(".proto.DeviceCapabilities.userHasAvatar: object expected");
144
+ m.userHasAvatar = $root.proto.DeviceCapabilities.UserHasAvatar.fromObject(d.userHasAvatar, n + 1);
145
+ }
146
+ switch (d.memberNameTagPrimarySupport) {
147
+ default:
148
+ if (typeof d.memberNameTagPrimarySupport === "number") {
149
+ m.memberNameTagPrimarySupport = d.memberNameTagPrimarySupport;
150
+ break;
151
+ }
152
+ break;
153
+ case "DISABLED":
154
+ case 0:
155
+ m.memberNameTagPrimarySupport = 0;
156
+ break;
157
+ case "RECEIVER_ENABLED":
158
+ case 1:
159
+ m.memberNameTagPrimarySupport = 1;
160
+ break;
161
+ case "SENDER_ENABLED":
162
+ case 2:
163
+ m.memberNameTagPrimarySupport = 2;
164
+ break;
165
+ }
166
+ if (d.aiThread != null) {
167
+ if (typeof d.aiThread !== "object")
168
+ throw TypeError(".proto.DeviceCapabilities.aiThread: object expected");
169
+ m.aiThread = $root.proto.DeviceCapabilities.AiThread.fromObject(d.aiThread, n + 1);
170
+ }
171
+ return m;
172
+ };
173
+ DeviceCapabilities.toObject = function toObject(m, o) {
174
+ if (!o)
175
+ o = {};
176
+ var d = {};
177
+ if (m.chatLockSupportLevel != null && m.hasOwnProperty("chatLockSupportLevel")) {
178
+ d.chatLockSupportLevel = o.enums === String ? $root.proto.DeviceCapabilities.ChatLockSupportLevel[m.chatLockSupportLevel] === undefined ? m.chatLockSupportLevel : $root.proto.DeviceCapabilities.ChatLockSupportLevel[m.chatLockSupportLevel] : m.chatLockSupportLevel;
179
+ if (o.oneofs)
180
+ d._chatLockSupportLevel = "chatLockSupportLevel";
181
+ }
182
+ if (m.lidMigration != null && m.hasOwnProperty("lidMigration")) {
183
+ d.lidMigration = $root.proto.DeviceCapabilities.LIDMigration.toObject(m.lidMigration, o);
184
+ if (o.oneofs)
185
+ d._lidMigration = "lidMigration";
186
+ }
187
+ if (m.businessBroadcast != null && m.hasOwnProperty("businessBroadcast")) {
188
+ d.businessBroadcast = $root.proto.DeviceCapabilities.BusinessBroadcast.toObject(m.businessBroadcast, o);
189
+ if (o.oneofs)
190
+ d._businessBroadcast = "businessBroadcast";
191
+ }
192
+ if (m.userHasAvatar != null && m.hasOwnProperty("userHasAvatar")) {
193
+ d.userHasAvatar = $root.proto.DeviceCapabilities.UserHasAvatar.toObject(m.userHasAvatar, o);
194
+ if (o.oneofs)
195
+ d._userHasAvatar = "userHasAvatar";
196
+ }
197
+ if (m.memberNameTagPrimarySupport != null && m.hasOwnProperty("memberNameTagPrimarySupport")) {
198
+ d.memberNameTagPrimarySupport = o.enums === String ? $root.proto.DeviceCapabilities.MemberNameTagPrimarySupport[m.memberNameTagPrimarySupport] === undefined ? m.memberNameTagPrimarySupport : $root.proto.DeviceCapabilities.MemberNameTagPrimarySupport[m.memberNameTagPrimarySupport] : m.memberNameTagPrimarySupport;
199
+ if (o.oneofs)
200
+ d._memberNameTagPrimarySupport = "memberNameTagPrimarySupport";
201
+ }
202
+ if (m.aiThread != null && m.hasOwnProperty("aiThread")) {
203
+ d.aiThread = $root.proto.DeviceCapabilities.AiThread.toObject(m.aiThread, o);
204
+ if (o.oneofs)
205
+ d._aiThread = "aiThread";
206
+ }
207
+ return d;
208
+ };
209
+ DeviceCapabilities.prototype.toJSON = function toJSON() {
210
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
211
+ };
212
+ DeviceCapabilities.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
213
+ if (typeUrlPrefix === undefined) {
214
+ typeUrlPrefix = "type.googleapis.com";
215
+ }
216
+ return typeUrlPrefix + "/proto.DeviceCapabilities";
217
+ };
218
+ $lazy(DeviceCapabilities, "AiThread", function() {
219
+ function AiThread(p) {
220
+ if (p)
221
+ for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
222
+ if (p[ks[i]] != null && ks[i] !== "__proto__")
223
+ this[ks[i]] = p[ks[i]];
224
+ }
225
+ AiThread.prototype.supportLevel = null;
226
+ let $oneOfFields;
227
+ Object.defineProperty(AiThread.prototype, "_supportLevel", {
228
+ get: $util.oneOfGetter($oneOfFields = ["supportLevel"]),
229
+ set: $util.oneOfSetter($oneOfFields)
230
+ });
231
+ AiThread.create = function create(properties) {
232
+ return new AiThread(properties);
233
+ };
234
+ AiThread.encode = function encode(m, w) {
235
+ if (!w)
236
+ w = $Writer.create();
237
+ if (m.supportLevel != null && Object.hasOwnProperty.call(m, "supportLevel"))
238
+ w.uint32(8).int32(m.supportLevel);
239
+ return w;
240
+ };
241
+ AiThread.decode = function decode(r, l, e, n) {
242
+ if (!(r instanceof $Reader))
243
+ r = $Reader.create(r);
244
+ if (n === undefined)
245
+ n = 0;
246
+ if (n > $Reader.recursionLimit)
247
+ throw Error("maximum nesting depth exceeded");
248
+ var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.DeviceCapabilities.AiThread();
249
+ while (r.pos < c) {
250
+ var t = r.uint32();
251
+ if (t === e)
252
+ break;
253
+ switch (t >>> 3) {
254
+ case 1: {
255
+ m.supportLevel = r.int32();
256
+ break;
257
+ }
258
+ default:
259
+ r.skipType(t & 7, n);
260
+ break;
261
+ }
262
+ }
263
+ return m;
264
+ };
265
+ AiThread.fromObject = function fromObject(d, n) {
266
+ if (d instanceof $root.proto.DeviceCapabilities.AiThread)
267
+ return d;
268
+ if (n === undefined)
269
+ n = 0;
270
+ if (n > $util.recursionLimit)
271
+ throw Error("maximum nesting depth exceeded");
272
+ var m = new $root.proto.DeviceCapabilities.AiThread();
273
+ switch (d.supportLevel) {
274
+ default:
275
+ if (typeof d.supportLevel === "number") {
276
+ m.supportLevel = d.supportLevel;
277
+ break;
278
+ }
279
+ break;
280
+ case "NONE":
281
+ case 0:
282
+ m.supportLevel = 0;
283
+ break;
284
+ case "INFRA":
285
+ case 1:
286
+ m.supportLevel = 1;
287
+ break;
288
+ case "FULL":
289
+ case 2:
290
+ m.supportLevel = 2;
291
+ break;
292
+ }
293
+ return m;
294
+ };
295
+ AiThread.toObject = function toObject(m, o) {
296
+ if (!o)
297
+ o = {};
298
+ var d = {};
299
+ if (m.supportLevel != null && m.hasOwnProperty("supportLevel")) {
300
+ d.supportLevel = o.enums === String ? $root.proto.DeviceCapabilities.AiThread.SupportLevel[m.supportLevel] === undefined ? m.supportLevel : $root.proto.DeviceCapabilities.AiThread.SupportLevel[m.supportLevel] : m.supportLevel;
301
+ if (o.oneofs)
302
+ d._supportLevel = "supportLevel";
303
+ }
304
+ return d;
305
+ };
306
+ AiThread.prototype.toJSON = function toJSON() {
307
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
308
+ };
309
+ AiThread.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
310
+ if (typeUrlPrefix === undefined) {
311
+ typeUrlPrefix = "type.googleapis.com";
312
+ }
313
+ return typeUrlPrefix + "/proto.DeviceCapabilities.AiThread";
314
+ };
315
+ $lazy(AiThread, "SupportLevel", function() {
316
+ const valuesById = {}, values = Object.create(valuesById);
317
+ values[valuesById[0] = "NONE"] = 0;
318
+ values[valuesById[1] = "INFRA"] = 1;
319
+ values[valuesById[2] = "FULL"] = 2;
320
+ return values;
321
+ });
322
+ return AiThread;
323
+ });
324
+ $lazy(DeviceCapabilities, "BusinessBroadcast", function() {
325
+ function BusinessBroadcast(p) {
326
+ if (p)
327
+ for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
328
+ if (p[ks[i]] != null && ks[i] !== "__proto__")
329
+ this[ks[i]] = p[ks[i]];
330
+ }
331
+ BusinessBroadcast.prototype.importListEnabled = null;
332
+ BusinessBroadcast.prototype.companionSupportEnabled = null;
333
+ BusinessBroadcast.prototype.campaignSyncEnabled = null;
334
+ BusinessBroadcast.prototype.insightsSyncEnabled = null;
335
+ BusinessBroadcast.prototype.recipientLimit = null;
336
+ let $oneOfFields;
337
+ Object.defineProperty(BusinessBroadcast.prototype, "_importListEnabled", {
338
+ get: $util.oneOfGetter($oneOfFields = ["importListEnabled"]),
339
+ set: $util.oneOfSetter($oneOfFields)
340
+ });
341
+ Object.defineProperty(BusinessBroadcast.prototype, "_companionSupportEnabled", {
342
+ get: $util.oneOfGetter($oneOfFields = ["companionSupportEnabled"]),
343
+ set: $util.oneOfSetter($oneOfFields)
344
+ });
345
+ Object.defineProperty(BusinessBroadcast.prototype, "_campaignSyncEnabled", {
346
+ get: $util.oneOfGetter($oneOfFields = ["campaignSyncEnabled"]),
347
+ set: $util.oneOfSetter($oneOfFields)
348
+ });
349
+ Object.defineProperty(BusinessBroadcast.prototype, "_insightsSyncEnabled", {
350
+ get: $util.oneOfGetter($oneOfFields = ["insightsSyncEnabled"]),
351
+ set: $util.oneOfSetter($oneOfFields)
352
+ });
353
+ Object.defineProperty(BusinessBroadcast.prototype, "_recipientLimit", {
354
+ get: $util.oneOfGetter($oneOfFields = ["recipientLimit"]),
355
+ set: $util.oneOfSetter($oneOfFields)
356
+ });
357
+ BusinessBroadcast.create = function create(properties) {
358
+ return new BusinessBroadcast(properties);
359
+ };
360
+ BusinessBroadcast.encode = function encode(m, w) {
361
+ if (!w)
362
+ w = $Writer.create();
363
+ if (m.importListEnabled != null && Object.hasOwnProperty.call(m, "importListEnabled"))
364
+ w.uint32(8).bool(m.importListEnabled);
365
+ if (m.companionSupportEnabled != null && Object.hasOwnProperty.call(m, "companionSupportEnabled"))
366
+ w.uint32(16).bool(m.companionSupportEnabled);
367
+ if (m.campaignSyncEnabled != null && Object.hasOwnProperty.call(m, "campaignSyncEnabled"))
368
+ w.uint32(24).bool(m.campaignSyncEnabled);
369
+ if (m.insightsSyncEnabled != null && Object.hasOwnProperty.call(m, "insightsSyncEnabled"))
370
+ w.uint32(32).bool(m.insightsSyncEnabled);
371
+ if (m.recipientLimit != null && Object.hasOwnProperty.call(m, "recipientLimit"))
372
+ w.uint32(40).int32(m.recipientLimit);
373
+ return w;
374
+ };
375
+ BusinessBroadcast.decode = function decode(r, l, e, n) {
376
+ if (!(r instanceof $Reader))
377
+ r = $Reader.create(r);
378
+ if (n === undefined)
379
+ n = 0;
380
+ if (n > $Reader.recursionLimit)
381
+ throw Error("maximum nesting depth exceeded");
382
+ var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.DeviceCapabilities.BusinessBroadcast();
383
+ while (r.pos < c) {
384
+ var t = r.uint32();
385
+ if (t === e)
386
+ break;
387
+ switch (t >>> 3) {
388
+ case 1: {
389
+ m.importListEnabled = r.bool();
390
+ break;
391
+ }
392
+ case 2: {
393
+ m.companionSupportEnabled = r.bool();
394
+ break;
395
+ }
396
+ case 3: {
397
+ m.campaignSyncEnabled = r.bool();
398
+ break;
399
+ }
400
+ case 4: {
401
+ m.insightsSyncEnabled = r.bool();
402
+ break;
403
+ }
404
+ case 5: {
405
+ m.recipientLimit = r.int32();
406
+ break;
407
+ }
408
+ default:
409
+ r.skipType(t & 7, n);
410
+ break;
411
+ }
412
+ }
413
+ return m;
414
+ };
415
+ BusinessBroadcast.fromObject = function fromObject(d, n) {
416
+ if (d instanceof $root.proto.DeviceCapabilities.BusinessBroadcast)
417
+ return d;
418
+ if (n === undefined)
419
+ n = 0;
420
+ if (n > $util.recursionLimit)
421
+ throw Error("maximum nesting depth exceeded");
422
+ var m = new $root.proto.DeviceCapabilities.BusinessBroadcast();
423
+ if (d.importListEnabled != null) {
424
+ m.importListEnabled = Boolean(d.importListEnabled);
425
+ }
426
+ if (d.companionSupportEnabled != null) {
427
+ m.companionSupportEnabled = Boolean(d.companionSupportEnabled);
428
+ }
429
+ if (d.campaignSyncEnabled != null) {
430
+ m.campaignSyncEnabled = Boolean(d.campaignSyncEnabled);
431
+ }
432
+ if (d.insightsSyncEnabled != null) {
433
+ m.insightsSyncEnabled = Boolean(d.insightsSyncEnabled);
434
+ }
435
+ if (d.recipientLimit != null) {
436
+ m.recipientLimit = d.recipientLimit | 0;
437
+ }
438
+ return m;
439
+ };
440
+ BusinessBroadcast.toObject = function toObject(m, o) {
441
+ if (!o)
442
+ o = {};
443
+ var d = {};
444
+ if (m.importListEnabled != null && m.hasOwnProperty("importListEnabled")) {
445
+ d.importListEnabled = m.importListEnabled;
446
+ if (o.oneofs)
447
+ d._importListEnabled = "importListEnabled";
448
+ }
449
+ if (m.companionSupportEnabled != null && m.hasOwnProperty("companionSupportEnabled")) {
450
+ d.companionSupportEnabled = m.companionSupportEnabled;
451
+ if (o.oneofs)
452
+ d._companionSupportEnabled = "companionSupportEnabled";
453
+ }
454
+ if (m.campaignSyncEnabled != null && m.hasOwnProperty("campaignSyncEnabled")) {
455
+ d.campaignSyncEnabled = m.campaignSyncEnabled;
456
+ if (o.oneofs)
457
+ d._campaignSyncEnabled = "campaignSyncEnabled";
458
+ }
459
+ if (m.insightsSyncEnabled != null && m.hasOwnProperty("insightsSyncEnabled")) {
460
+ d.insightsSyncEnabled = m.insightsSyncEnabled;
461
+ if (o.oneofs)
462
+ d._insightsSyncEnabled = "insightsSyncEnabled";
463
+ }
464
+ if (m.recipientLimit != null && m.hasOwnProperty("recipientLimit")) {
465
+ d.recipientLimit = m.recipientLimit;
466
+ if (o.oneofs)
467
+ d._recipientLimit = "recipientLimit";
468
+ }
469
+ return d;
470
+ };
471
+ BusinessBroadcast.prototype.toJSON = function toJSON() {
472
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
473
+ };
474
+ BusinessBroadcast.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
475
+ if (typeUrlPrefix === undefined) {
476
+ typeUrlPrefix = "type.googleapis.com";
477
+ }
478
+ return typeUrlPrefix + "/proto.DeviceCapabilities.BusinessBroadcast";
479
+ };
480
+ return BusinessBroadcast;
481
+ });
482
+ $lazy(DeviceCapabilities, "ChatLockSupportLevel", function() {
483
+ const valuesById = {}, values = Object.create(valuesById);
484
+ values[valuesById[0] = "NONE"] = 0;
485
+ values[valuesById[1] = "MINIMAL"] = 1;
486
+ values[valuesById[2] = "FULL"] = 2;
487
+ return values;
488
+ });
489
+ $lazy(DeviceCapabilities, "LIDMigration", function() {
490
+ function LIDMigration(p) {
491
+ if (p)
492
+ for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
493
+ if (p[ks[i]] != null && ks[i] !== "__proto__")
494
+ this[ks[i]] = p[ks[i]];
495
+ }
496
+ LIDMigration.prototype.chatDbMigrationTimestamp = null;
497
+ let $oneOfFields;
498
+ Object.defineProperty(LIDMigration.prototype, "_chatDbMigrationTimestamp", {
499
+ get: $util.oneOfGetter($oneOfFields = ["chatDbMigrationTimestamp"]),
500
+ set: $util.oneOfSetter($oneOfFields)
501
+ });
502
+ LIDMigration.create = function create(properties) {
503
+ return new LIDMigration(properties);
504
+ };
505
+ LIDMigration.encode = function encode(m, w) {
506
+ if (!w)
507
+ w = $Writer.create();
508
+ if (m.chatDbMigrationTimestamp != null && Object.hasOwnProperty.call(m, "chatDbMigrationTimestamp"))
509
+ w.uint32(8).uint64(m.chatDbMigrationTimestamp);
510
+ return w;
511
+ };
512
+ LIDMigration.decode = function decode(r, l, e, n) {
513
+ if (!(r instanceof $Reader))
514
+ r = $Reader.create(r);
515
+ if (n === undefined)
516
+ n = 0;
517
+ if (n > $Reader.recursionLimit)
518
+ throw Error("maximum nesting depth exceeded");
519
+ var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.DeviceCapabilities.LIDMigration();
520
+ while (r.pos < c) {
521
+ var t = r.uint32();
522
+ if (t === e)
523
+ break;
524
+ switch (t >>> 3) {
525
+ case 1: {
526
+ m.chatDbMigrationTimestamp = r.uint64();
527
+ break;
528
+ }
529
+ default:
530
+ r.skipType(t & 7, n);
531
+ break;
532
+ }
533
+ }
534
+ return m;
535
+ };
536
+ LIDMigration.fromObject = function fromObject(d, n) {
537
+ if (d instanceof $root.proto.DeviceCapabilities.LIDMigration)
538
+ return d;
539
+ if (n === undefined)
540
+ n = 0;
541
+ if (n > $util.recursionLimit)
542
+ throw Error("maximum nesting depth exceeded");
543
+ var m = new $root.proto.DeviceCapabilities.LIDMigration();
544
+ if (d.chatDbMigrationTimestamp != null) {
545
+ if ($util.Long)
546
+ (m.chatDbMigrationTimestamp = $util.Long.fromValue(d.chatDbMigrationTimestamp)).unsigned = true;
547
+ else if (typeof d.chatDbMigrationTimestamp === "string")
548
+ m.chatDbMigrationTimestamp = parseInt(d.chatDbMigrationTimestamp, 10);
549
+ else if (typeof d.chatDbMigrationTimestamp === "number")
550
+ m.chatDbMigrationTimestamp = d.chatDbMigrationTimestamp;
551
+ else if (typeof d.chatDbMigrationTimestamp === "object")
552
+ m.chatDbMigrationTimestamp = new $util.LongBits(d.chatDbMigrationTimestamp.low >>> 0, d.chatDbMigrationTimestamp.high >>> 0).toNumber(true);
553
+ }
554
+ return m;
555
+ };
556
+ LIDMigration.toObject = function toObject(m, o) {
557
+ if (!o)
558
+ o = {};
559
+ var d = {};
560
+ if (m.chatDbMigrationTimestamp != null && m.hasOwnProperty("chatDbMigrationTimestamp")) {
561
+ if (typeof m.chatDbMigrationTimestamp === "number")
562
+ d.chatDbMigrationTimestamp = o.longs === String ? String(m.chatDbMigrationTimestamp) : m.chatDbMigrationTimestamp;
563
+ else
564
+ d.chatDbMigrationTimestamp = o.longs === String ? longToString(m.chatDbMigrationTimestamp, true) : o.longs === Number ? longToNumber(m.chatDbMigrationTimestamp, true) : m.chatDbMigrationTimestamp;
565
+ if (o.oneofs)
566
+ d._chatDbMigrationTimestamp = "chatDbMigrationTimestamp";
567
+ }
568
+ return d;
569
+ };
570
+ LIDMigration.prototype.toJSON = function toJSON() {
571
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
572
+ };
573
+ LIDMigration.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
574
+ if (typeUrlPrefix === undefined) {
575
+ typeUrlPrefix = "type.googleapis.com";
576
+ }
577
+ return typeUrlPrefix + "/proto.DeviceCapabilities.LIDMigration";
578
+ };
579
+ return LIDMigration;
580
+ });
581
+ $lazy(DeviceCapabilities, "MemberNameTagPrimarySupport", function() {
582
+ const valuesById = {}, values = Object.create(valuesById);
583
+ values[valuesById[0] = "DISABLED"] = 0;
584
+ values[valuesById[1] = "RECEIVER_ENABLED"] = 1;
585
+ values[valuesById[2] = "SENDER_ENABLED"] = 2;
586
+ return values;
587
+ });
588
+ $lazy(DeviceCapabilities, "UserHasAvatar", function() {
589
+ function UserHasAvatar(p) {
590
+ if (p)
591
+ for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
592
+ if (p[ks[i]] != null && ks[i] !== "__proto__")
593
+ this[ks[i]] = p[ks[i]];
594
+ }
595
+ UserHasAvatar.prototype.userHasAvatar = null;
596
+ let $oneOfFields;
597
+ Object.defineProperty(UserHasAvatar.prototype, "_userHasAvatar", {
598
+ get: $util.oneOfGetter($oneOfFields = ["userHasAvatar"]),
599
+ set: $util.oneOfSetter($oneOfFields)
600
+ });
601
+ UserHasAvatar.create = function create(properties) {
602
+ return new UserHasAvatar(properties);
603
+ };
604
+ UserHasAvatar.encode = function encode(m, w) {
605
+ if (!w)
606
+ w = $Writer.create();
607
+ if (m.userHasAvatar != null && Object.hasOwnProperty.call(m, "userHasAvatar"))
608
+ w.uint32(8).bool(m.userHasAvatar);
609
+ return w;
610
+ };
611
+ UserHasAvatar.decode = function decode(r, l, e, n) {
612
+ if (!(r instanceof $Reader))
613
+ r = $Reader.create(r);
614
+ if (n === undefined)
615
+ n = 0;
616
+ if (n > $Reader.recursionLimit)
617
+ throw Error("maximum nesting depth exceeded");
618
+ var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.DeviceCapabilities.UserHasAvatar();
619
+ while (r.pos < c) {
620
+ var t = r.uint32();
621
+ if (t === e)
622
+ break;
623
+ switch (t >>> 3) {
624
+ case 1: {
625
+ m.userHasAvatar = r.bool();
626
+ break;
627
+ }
628
+ default:
629
+ r.skipType(t & 7, n);
630
+ break;
631
+ }
632
+ }
633
+ return m;
634
+ };
635
+ UserHasAvatar.fromObject = function fromObject(d, n) {
636
+ if (d instanceof $root.proto.DeviceCapabilities.UserHasAvatar)
637
+ return d;
638
+ if (n === undefined)
639
+ n = 0;
640
+ if (n > $util.recursionLimit)
641
+ throw Error("maximum nesting depth exceeded");
642
+ var m = new $root.proto.DeviceCapabilities.UserHasAvatar();
643
+ if (d.userHasAvatar != null) {
644
+ m.userHasAvatar = Boolean(d.userHasAvatar);
645
+ }
646
+ return m;
647
+ };
648
+ UserHasAvatar.toObject = function toObject(m, o) {
649
+ if (!o)
650
+ o = {};
651
+ var d = {};
652
+ if (m.userHasAvatar != null && m.hasOwnProperty("userHasAvatar")) {
653
+ d.userHasAvatar = m.userHasAvatar;
654
+ if (o.oneofs)
655
+ d._userHasAvatar = "userHasAvatar";
656
+ }
657
+ return d;
658
+ };
659
+ UserHasAvatar.prototype.toJSON = function toJSON() {
660
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
661
+ };
662
+ UserHasAvatar.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
663
+ if (typeUrlPrefix === undefined) {
664
+ typeUrlPrefix = "type.googleapis.com";
665
+ }
666
+ return typeUrlPrefix + "/proto.DeviceCapabilities.UserHasAvatar";
667
+ };
668
+ return UserHasAvatar;
669
+ });
670
+ return DeviceCapabilities;