@aseppxyzz12/baileys 1.1.8

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 (185) hide show
  1. package/LICENSE +25 -0
  2. package/README.md +2579 -0
  3. package/WAProto/AICommon/AICommon.js +19396 -0
  4. package/WAProto/AICommon/AICommon.proto +820 -0
  5. package/WAProto/Adv/Adv.js +1137 -0
  6. package/WAProto/Adv/Adv.proto +42 -0
  7. package/WAProto/BotMetadata/BotMetadata.js +8975 -0
  8. package/WAProto/BotMetadata/BotMetadata.proto +484 -0
  9. package/WAProto/Cert/Cert.js +893 -0
  10. package/WAProto/Cert/Cert.proto +30 -0
  11. package/WAProto/ChatLockSettings/ChatLockSettings.js +673 -0
  12. package/WAProto/ChatLockSettings/ChatLockSettings.proto +9 -0
  13. package/WAProto/CompanionReg/CompanionReg.js +2457 -0
  14. package/WAProto/CompanionReg/CompanionReg.proto +103 -0
  15. package/WAProto/DeviceCapabilities/DeviceCapabilities.js +846 -0
  16. package/WAProto/DeviceCapabilities/DeviceCapabilities.proto +38 -0
  17. package/WAProto/E2E/E2E.js +78728 -0
  18. package/WAProto/E2E/E2E.proto +1970 -0
  19. package/WAProto/Ephemeral/Ephemeral.js +143 -0
  20. package/WAProto/Ephemeral/Ephemeral.proto +7 -0
  21. package/WAProto/HistorySync/HistorySync.js +95931 -0
  22. package/WAProto/HistorySync/HistorySync.proto +229 -0
  23. package/WAProto/LidMigrationSyncPayload/LidMigrationSyncPayload.js +414 -0
  24. package/WAProto/LidMigrationSyncPayload/LidMigrationSyncPayload.proto +13 -0
  25. package/WAProto/MdStorageChatRowOpaqueData/MdStorageChatRowOpaqueData.js +980 -0
  26. package/WAProto/MdStorageChatRowOpaqueData/MdStorageChatRowOpaqueData.proto +38 -0
  27. package/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.js +81185 -0
  28. package/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.proto +88 -0
  29. package/WAProto/MmsRetry/MmsRetry.js +310 -0
  30. package/WAProto/MmsRetry/MmsRetry.proto +19 -0
  31. package/WAProto/Protocol/Protocol.js +399 -0
  32. package/WAProto/Protocol/Protocol.proto +22 -0
  33. package/WAProto/Reporting/Reporting.js +535 -0
  34. package/WAProto/Reporting/Reporting.proto +22 -0
  35. package/WAProto/ServerSync/ServerSync.js +1830 -0
  36. package/WAProto/ServerSync/ServerSync.proto +70 -0
  37. package/WAProto/SignalLocalStorageProtocol/SignalLocalStorageProtocol.js +3267 -0
  38. package/WAProto/SignalLocalStorageProtocol/SignalLocalStorageProtocol.proto +95 -0
  39. package/WAProto/SignalWhisperTextProtocol/SignalWhisperTextProtocol.js +1140 -0
  40. package/WAProto/SignalWhisperTextProtocol/SignalWhisperTextProtocol.proto +44 -0
  41. package/WAProto/StatusAttributions/StatusAttributions.js +1604 -0
  42. package/WAProto/StatusAttributions/StatusAttributions.proto +89 -0
  43. package/WAProto/SyncAction/SyncAction.js +17424 -0
  44. package/WAProto/SyncAction/SyncAction.proto +663 -0
  45. package/WAProto/UserPassword/UserPassword.js +544 -0
  46. package/WAProto/UserPassword/UserPassword.proto +28 -0
  47. package/WAProto/VnameCert/VnameCert.js +1466 -0
  48. package/WAProto/VnameCert/VnameCert.proto +65 -0
  49. package/WAProto/Wa6/Wa6.js +4601 -0
  50. package/WAProto/Wa6/Wa6.proto +241 -0
  51. package/WAProto/Web/Web.js +90819 -0
  52. package/WAProto/Web/Web.proto +605 -0
  53. package/WAProto/index.js +30 -0
  54. package/engine-requirements.js +9 -0
  55. package/lib/Defaults/baileys-version.json +3 -0
  56. package/lib/Defaults/connection.js +39 -0
  57. package/lib/Defaults/constants.js +50 -0
  58. package/lib/Defaults/history.js +13 -0
  59. package/lib/Defaults/index.js +36 -0
  60. package/lib/Defaults/media.js +43 -0
  61. package/lib/Defaults/phonenumber-mcc.json +223 -0
  62. package/lib/Defaults/prefix.js +12 -0
  63. package/lib/Function/Download/tiktok.js +19 -0
  64. package/lib/Function/Tools/bypass.js +19 -0
  65. package/lib/Function/index.js +13 -0
  66. package/lib/Signal/Group/ciphertext-message.js +14 -0
  67. package/lib/Signal/Group/group-session-builder.js +46 -0
  68. package/lib/Signal/Group/group_cipher.js +104 -0
  69. package/lib/Signal/Group/index.js +42 -0
  70. package/lib/Signal/Group/keyhelper.js +21 -0
  71. package/lib/Signal/Group/queue-job.js +57 -0
  72. package/lib/Signal/Group/sender-chain-key.js +34 -0
  73. package/lib/Signal/Group/sender-key-distribution-message.js +66 -0
  74. package/lib/Signal/Group/sender-key-message.js +78 -0
  75. package/lib/Signal/Group/sender-key-name.js +49 -0
  76. package/lib/Signal/Group/sender-key-record.js +45 -0
  77. package/lib/Signal/Group/sender-key-state.js +100 -0
  78. package/lib/Signal/Group/sender-message-key.js +28 -0
  79. package/lib/Signal/libsignal.js +364 -0
  80. package/lib/Signal/lid-mapping.js +164 -0
  81. package/lib/Socket/Client/abstract-socket-client.js +13 -0
  82. package/lib/Socket/Client/index.js +31 -0
  83. package/lib/Socket/Client/mobile-socket-client.js +65 -0
  84. package/lib/Socket/Client/types.js +12 -0
  85. package/lib/Socket/Client/web-socket-client.js +62 -0
  86. package/lib/Socket/Client/websocket.js +67 -0
  87. package/lib/Socket/business.js +291 -0
  88. package/lib/Socket/chats.js +874 -0
  89. package/lib/Socket/community.js +454 -0
  90. package/lib/Socket/dugong.js +658 -0
  91. package/lib/Socket/groups.js +357 -0
  92. package/lib/Socket/index.js +13 -0
  93. package/lib/Socket/messages-recv.js +1509 -0
  94. package/lib/Socket/messages-send.js +1505 -0
  95. package/lib/Socket/mex.js +54 -0
  96. package/lib/Socket/newsletter.js +171 -0
  97. package/lib/Socket/registration.js +167 -0
  98. package/lib/Socket/rich-content.js +279 -0
  99. package/lib/Socket/socket.js +905 -0
  100. package/lib/Socket/username.js +157 -0
  101. package/lib/Socket/usync.js +70 -0
  102. package/lib/Store/index.js +37 -0
  103. package/lib/Store/keyed-db.js +114 -0
  104. package/lib/Store/make-cache-manager-store.js +77 -0
  105. package/lib/Store/make-in-memory-store.js +423 -0
  106. package/lib/Store/make-ordered-dictionary.js +78 -0
  107. package/lib/Store/object-repository.js +26 -0
  108. package/lib/Types/Auth.js +2 -0
  109. package/lib/Types/Bussines.js +2 -0
  110. package/lib/Types/Call.js +2 -0
  111. package/lib/Types/Chat.js +10 -0
  112. package/lib/Types/Contact.js +2 -0
  113. package/lib/Types/Events.js +2 -0
  114. package/lib/Types/GroupMetadata.js +2 -0
  115. package/lib/Types/Label.js +25 -0
  116. package/lib/Types/LabelAssociation.js +4 -0
  117. package/lib/Types/Message.js +11 -0
  118. package/lib/Types/Mex.js +40 -0
  119. package/lib/Types/MexUpdates.js +15 -0
  120. package/lib/Types/Newsletter.js +32 -0
  121. package/lib/Types/Product.js +2 -0
  122. package/lib/Types/Signal.js +2 -0
  123. package/lib/Types/Socket.js +2 -0
  124. package/lib/Types/State.js +9 -0
  125. package/lib/Types/USync.js +2 -0
  126. package/lib/Types/index.js +60 -0
  127. package/lib/Utils/auth-utils.js +256 -0
  128. package/lib/Utils/baileys-event-stream.js +63 -0
  129. package/lib/Utils/bot-toolkit.js +455 -0
  130. package/lib/Utils/browser-utils.js +29 -0
  131. package/lib/Utils/business.js +233 -0
  132. package/lib/Utils/chat-utils.js +904 -0
  133. package/lib/Utils/companion-reg-client-utils.js +41 -0
  134. package/lib/Utils/crypto.js +144 -0
  135. package/lib/Utils/decode-wa-message.js +305 -0
  136. package/lib/Utils/event-buffer.js +555 -0
  137. package/lib/Utils/generics.js +411 -0
  138. package/lib/Utils/history.js +100 -0
  139. package/lib/Utils/identity-change-handler.js +53 -0
  140. package/lib/Utils/index.js +57 -0
  141. package/lib/Utils/link-preview.js +76 -0
  142. package/lib/Utils/logger.js +4 -0
  143. package/lib/Utils/lt-hash.js +45 -0
  144. package/lib/Utils/make-mutex.js +33 -0
  145. package/lib/Utils/message-composer.js +289 -0
  146. package/lib/Utils/message-retry-manager.js +134 -0
  147. package/lib/Utils/messages-media.js +806 -0
  148. package/lib/Utils/messages.js +1908 -0
  149. package/lib/Utils/noise-handler.js +157 -0
  150. package/lib/Utils/offline-node-processor.js +42 -0
  151. package/lib/Utils/pre-key-manager.js +86 -0
  152. package/lib/Utils/process-message.js +814 -0
  153. package/lib/Utils/reporting-utils.js +264 -0
  154. package/lib/Utils/signal.js +183 -0
  155. package/lib/Utils/stanza-ack.js +36 -0
  156. package/lib/Utils/sync-action-utils.js +52 -0
  157. package/lib/Utils/tc-token-utils.js +167 -0
  158. package/lib/Utils/use-multi-file-auth-state.js +104 -0
  159. package/lib/Utils/validate-connection.js +229 -0
  160. package/lib/Utils/vialeys-event-stream.js +41 -0
  161. package/lib/WABinary/constants.js +1308 -0
  162. package/lib/WABinary/decode.js +233 -0
  163. package/lib/WABinary/encode.js +212 -0
  164. package/lib/WABinary/generic-utils.js +124 -0
  165. package/lib/WABinary/index.js +36 -0
  166. package/lib/WABinary/jid-utils.js +101 -0
  167. package/lib/WABinary/types.js +2 -0
  168. package/lib/WAM/BinaryInfo.js +12 -0
  169. package/lib/WAM/constants.js +20491 -0
  170. package/lib/WAM/encode.js +148 -0
  171. package/lib/WAM/index.js +34 -0
  172. package/lib/WAUSync/Protocols/USyncBotProfileProtocol.js +62 -0
  173. package/lib/WAUSync/Protocols/USyncContactProtocol.js +38 -0
  174. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +50 -0
  175. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +25 -0
  176. package/lib/WAUSync/Protocols/USyncLIDProtocol.js +24 -0
  177. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +32 -0
  178. package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +24 -0
  179. package/lib/WAUSync/Protocols/index.js +38 -0
  180. package/lib/WAUSync/USyncQuery.js +97 -0
  181. package/lib/WAUSync/USyncUser.js +33 -0
  182. package/lib/WAUSync/index.js +34 -0
  183. package/lib/index.js +113 -0
  184. package/lib/messages-send.js +1496 -0
  185. package/package.json +100 -0
@@ -0,0 +1,1604 @@
1
+ "use strict";
2
+ var $protobuf = require("protobufjs/minimal");
3
+ var $Reader = $protobuf.Reader,
4
+ $Writer = $protobuf.Writer,
5
+ $util = $protobuf.util;
6
+ var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
7
+ $root.StatusAttributions = (function () {
8
+ var StatusAttributions = {};
9
+ StatusAttributions.StatusAttribution = (function () {
10
+ function StatusAttribution(properties) {
11
+ if (properties)
12
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
13
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
14
+ }
15
+ StatusAttribution.prototype.type = null;
16
+ StatusAttribution.prototype.actionUrl = null;
17
+ StatusAttribution.prototype.statusReshare = null;
18
+ StatusAttribution.prototype.externalShare = null;
19
+ StatusAttribution.prototype.music = null;
20
+ StatusAttribution.prototype.groupStatus = null;
21
+ StatusAttribution.prototype.rlAttribution = null;
22
+ StatusAttribution.prototype.aiCreatedAttribution = null;
23
+ var $oneOfFields;
24
+ Object.defineProperty(StatusAttribution.prototype, "_type", {
25
+ get: $util.oneOfGetter(($oneOfFields = ["type"])),
26
+ set: $util.oneOfSetter($oneOfFields),
27
+ });
28
+ Object.defineProperty(StatusAttribution.prototype, "_actionUrl", {
29
+ get: $util.oneOfGetter(($oneOfFields = ["actionUrl"])),
30
+ set: $util.oneOfSetter($oneOfFields),
31
+ });
32
+ Object.defineProperty(StatusAttribution.prototype, "attributionData", {
33
+ get: $util.oneOfGetter(
34
+ ($oneOfFields = [
35
+ "statusReshare",
36
+ "externalShare",
37
+ "music",
38
+ "groupStatus",
39
+ "rlAttribution",
40
+ "aiCreatedAttribution",
41
+ ])
42
+ ),
43
+ set: $util.oneOfSetter($oneOfFields),
44
+ });
45
+ StatusAttribution.create = function create(properties) {
46
+ return new StatusAttribution(properties);
47
+ };
48
+ StatusAttribution.encode = function encode(message, writer) {
49
+ if (!writer) writer = $Writer.create();
50
+ if (message.type != null && Object.hasOwnProperty.call(message, "type"))
51
+ writer.uint32(8).int32(message.type);
52
+ if (message.actionUrl != null && Object.hasOwnProperty.call(message, "actionUrl"))
53
+ writer.uint32(18).string(message.actionUrl);
54
+ if (
55
+ message.statusReshare != null &&
56
+ Object.hasOwnProperty.call(message, "statusReshare")
57
+ )
58
+ $root.StatusAttributions.StatusAttribution.StatusReshare.encode(
59
+ message.statusReshare,
60
+ writer.uint32(26).fork()
61
+ ).ldelim();
62
+ if (
63
+ message.externalShare != null &&
64
+ Object.hasOwnProperty.call(message, "externalShare")
65
+ )
66
+ $root.StatusAttributions.StatusAttribution.ExternalShare.encode(
67
+ message.externalShare,
68
+ writer.uint32(34).fork()
69
+ ).ldelim();
70
+ if (message.music != null && Object.hasOwnProperty.call(message, "music"))
71
+ $root.StatusAttributions.StatusAttribution.Music.encode(
72
+ message.music,
73
+ writer.uint32(42).fork()
74
+ ).ldelim();
75
+ if (message.groupStatus != null && Object.hasOwnProperty.call(message, "groupStatus"))
76
+ $root.StatusAttributions.StatusAttribution.GroupStatus.encode(
77
+ message.groupStatus,
78
+ writer.uint32(50).fork()
79
+ ).ldelim();
80
+ if (
81
+ message.rlAttribution != null &&
82
+ Object.hasOwnProperty.call(message, "rlAttribution")
83
+ )
84
+ $root.StatusAttributions.StatusAttribution.RLAttribution.encode(
85
+ message.rlAttribution,
86
+ writer.uint32(58).fork()
87
+ ).ldelim();
88
+ if (
89
+ message.aiCreatedAttribution != null &&
90
+ Object.hasOwnProperty.call(message, "aiCreatedAttribution")
91
+ )
92
+ $root.StatusAttributions.StatusAttribution.AiCreatedAttribution.encode(
93
+ message.aiCreatedAttribution,
94
+ writer.uint32(66).fork()
95
+ ).ldelim();
96
+ return writer;
97
+ };
98
+ StatusAttribution.encodeDelimited = function encodeDelimited(message, writer) {
99
+ return this.encode(message, writer).ldelim();
100
+ };
101
+ StatusAttribution.decode = function decode(reader, length, error) {
102
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
103
+ var end = length === undefined ? reader.len : reader.pos + length,
104
+ message = new $root.StatusAttributions.StatusAttribution();
105
+ while (reader.pos < end) {
106
+ var tag = reader.uint32();
107
+ if (tag === error) break;
108
+ switch (tag >>> 3) {
109
+ case 1: {
110
+ message.type = reader.int32();
111
+ break;
112
+ }
113
+ case 2: {
114
+ message.actionUrl = reader.string();
115
+ break;
116
+ }
117
+ case 3: {
118
+ message.statusReshare =
119
+ $root.StatusAttributions.StatusAttribution.StatusReshare.decode(
120
+ reader,
121
+ reader.uint32()
122
+ );
123
+ break;
124
+ }
125
+ case 4: {
126
+ message.externalShare =
127
+ $root.StatusAttributions.StatusAttribution.ExternalShare.decode(
128
+ reader,
129
+ reader.uint32()
130
+ );
131
+ break;
132
+ }
133
+ case 5: {
134
+ message.music = $root.StatusAttributions.StatusAttribution.Music.decode(
135
+ reader,
136
+ reader.uint32()
137
+ );
138
+ break;
139
+ }
140
+ case 6: {
141
+ message.groupStatus =
142
+ $root.StatusAttributions.StatusAttribution.GroupStatus.decode(
143
+ reader,
144
+ reader.uint32()
145
+ );
146
+ break;
147
+ }
148
+ case 7: {
149
+ message.rlAttribution =
150
+ $root.StatusAttributions.StatusAttribution.RLAttribution.decode(
151
+ reader,
152
+ reader.uint32()
153
+ );
154
+ break;
155
+ }
156
+ case 8: {
157
+ message.aiCreatedAttribution =
158
+ $root.StatusAttributions.StatusAttribution.AiCreatedAttribution.decode(
159
+ reader,
160
+ reader.uint32()
161
+ );
162
+ break;
163
+ }
164
+ default:
165
+ reader.skipType(tag & 7);
166
+ break;
167
+ }
168
+ }
169
+ return message;
170
+ };
171
+ StatusAttribution.decodeDelimited = function decodeDelimited(reader) {
172
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
173
+ return this.decode(reader, reader.uint32());
174
+ };
175
+ StatusAttribution.verify = function verify(message) {
176
+ if (typeof message !== "object" || message === null) return "object expected";
177
+ var properties = {};
178
+ if (message.type != null && message.hasOwnProperty("type")) {
179
+ properties._type = 1;
180
+ switch (message.type) {
181
+ default:
182
+ return "type: enum value expected";
183
+ case 0:
184
+ case 1:
185
+ case 2:
186
+ case 3:
187
+ case 4:
188
+ case 5:
189
+ case 6:
190
+ case 7:
191
+ case 8:
192
+ break;
193
+ }
194
+ }
195
+ if (message.actionUrl != null && message.hasOwnProperty("actionUrl")) {
196
+ properties._actionUrl = 1;
197
+ if (!$util.isString(message.actionUrl)) return "actionUrl: string expected";
198
+ }
199
+ if (message.statusReshare != null && message.hasOwnProperty("statusReshare")) {
200
+ properties.attributionData = 1;
201
+ {
202
+ var error = $root.StatusAttributions.StatusAttribution.StatusReshare.verify(
203
+ message.statusReshare
204
+ );
205
+ if (error) return "statusReshare." + error;
206
+ }
207
+ }
208
+ if (message.externalShare != null && message.hasOwnProperty("externalShare")) {
209
+ if (properties.attributionData === 1) return "attributionData: multiple values";
210
+ properties.attributionData = 1;
211
+ {
212
+ var error = $root.StatusAttributions.StatusAttribution.ExternalShare.verify(
213
+ message.externalShare
214
+ );
215
+ if (error) return "externalShare." + error;
216
+ }
217
+ }
218
+ if (message.music != null && message.hasOwnProperty("music")) {
219
+ if (properties.attributionData === 1) return "attributionData: multiple values";
220
+ properties.attributionData = 1;
221
+ {
222
+ var error = $root.StatusAttributions.StatusAttribution.Music.verify(
223
+ message.music
224
+ );
225
+ if (error) return "music." + error;
226
+ }
227
+ }
228
+ if (message.groupStatus != null && message.hasOwnProperty("groupStatus")) {
229
+ if (properties.attributionData === 1) return "attributionData: multiple values";
230
+ properties.attributionData = 1;
231
+ {
232
+ var error = $root.StatusAttributions.StatusAttribution.GroupStatus.verify(
233
+ message.groupStatus
234
+ );
235
+ if (error) return "groupStatus." + error;
236
+ }
237
+ }
238
+ if (message.rlAttribution != null && message.hasOwnProperty("rlAttribution")) {
239
+ if (properties.attributionData === 1) return "attributionData: multiple values";
240
+ properties.attributionData = 1;
241
+ {
242
+ var error = $root.StatusAttributions.StatusAttribution.RLAttribution.verify(
243
+ message.rlAttribution
244
+ );
245
+ if (error) return "rlAttribution." + error;
246
+ }
247
+ }
248
+ if (
249
+ message.aiCreatedAttribution != null &&
250
+ message.hasOwnProperty("aiCreatedAttribution")
251
+ ) {
252
+ if (properties.attributionData === 1) return "attributionData: multiple values";
253
+ properties.attributionData = 1;
254
+ {
255
+ var error =
256
+ $root.StatusAttributions.StatusAttribution.AiCreatedAttribution.verify(
257
+ message.aiCreatedAttribution
258
+ );
259
+ if (error) return "aiCreatedAttribution." + error;
260
+ }
261
+ }
262
+ return null;
263
+ };
264
+ StatusAttribution.fromObject = function fromObject(object) {
265
+ if (object instanceof $root.StatusAttributions.StatusAttribution) return object;
266
+ var message = new $root.StatusAttributions.StatusAttribution();
267
+ switch (object.type) {
268
+ default:
269
+ if (typeof object.type === "number") {
270
+ message.type = object.type;
271
+ break;
272
+ }
273
+ break;
274
+ case "UNKNOWN":
275
+ case 0:
276
+ message.type = 0;
277
+ break;
278
+ case "RESHARE":
279
+ case 1:
280
+ message.type = 1;
281
+ break;
282
+ case "EXTERNAL_SHARE":
283
+ case 2:
284
+ message.type = 2;
285
+ break;
286
+ case "MUSIC":
287
+ case 3:
288
+ message.type = 3;
289
+ break;
290
+ case "STATUS_MENTION":
291
+ case 4:
292
+ message.type = 4;
293
+ break;
294
+ case "GROUP_STATUS":
295
+ case 5:
296
+ message.type = 5;
297
+ break;
298
+ case "RL_ATTRIBUTION":
299
+ case 6:
300
+ message.type = 6;
301
+ break;
302
+ case "AI_CREATED":
303
+ case 7:
304
+ message.type = 7;
305
+ break;
306
+ case "LAYOUTS":
307
+ case 8:
308
+ message.type = 8;
309
+ break;
310
+ }
311
+ if (object.actionUrl != null) message.actionUrl = String(object.actionUrl);
312
+ if (object.statusReshare != null) {
313
+ if (typeof object.statusReshare !== "object")
314
+ throw TypeError(
315
+ ".StatusAttributions.StatusAttribution.statusReshare: object expected"
316
+ );
317
+ message.statusReshare =
318
+ $root.StatusAttributions.StatusAttribution.StatusReshare.fromObject(
319
+ object.statusReshare
320
+ );
321
+ }
322
+ if (object.externalShare != null) {
323
+ if (typeof object.externalShare !== "object")
324
+ throw TypeError(
325
+ ".StatusAttributions.StatusAttribution.externalShare: object expected"
326
+ );
327
+ message.externalShare =
328
+ $root.StatusAttributions.StatusAttribution.ExternalShare.fromObject(
329
+ object.externalShare
330
+ );
331
+ }
332
+ if (object.music != null) {
333
+ if (typeof object.music !== "object")
334
+ throw TypeError(".StatusAttributions.StatusAttribution.music: object expected");
335
+ message.music = $root.StatusAttributions.StatusAttribution.Music.fromObject(
336
+ object.music
337
+ );
338
+ }
339
+ if (object.groupStatus != null) {
340
+ if (typeof object.groupStatus !== "object")
341
+ throw TypeError(
342
+ ".StatusAttributions.StatusAttribution.groupStatus: object expected"
343
+ );
344
+ message.groupStatus =
345
+ $root.StatusAttributions.StatusAttribution.GroupStatus.fromObject(
346
+ object.groupStatus
347
+ );
348
+ }
349
+ if (object.rlAttribution != null) {
350
+ if (typeof object.rlAttribution !== "object")
351
+ throw TypeError(
352
+ ".StatusAttributions.StatusAttribution.rlAttribution: object expected"
353
+ );
354
+ message.rlAttribution =
355
+ $root.StatusAttributions.StatusAttribution.RLAttribution.fromObject(
356
+ object.rlAttribution
357
+ );
358
+ }
359
+ if (object.aiCreatedAttribution != null) {
360
+ if (typeof object.aiCreatedAttribution !== "object")
361
+ throw TypeError(
362
+ ".StatusAttributions.StatusAttribution.aiCreatedAttribution: object expected"
363
+ );
364
+ message.aiCreatedAttribution =
365
+ $root.StatusAttributions.StatusAttribution.AiCreatedAttribution.fromObject(
366
+ object.aiCreatedAttribution
367
+ );
368
+ }
369
+ return message;
370
+ };
371
+ StatusAttribution.toObject = function toObject(message, options) {
372
+ if (!options) options = {};
373
+ var object = {};
374
+ if (message.type != null && message.hasOwnProperty("type")) {
375
+ object.type =
376
+ options.enums === String
377
+ ? $root.StatusAttributions.StatusAttribution.Type[message.type] ===
378
+ undefined
379
+ ? message.type
380
+ : $root.StatusAttributions.StatusAttribution.Type[message.type]
381
+ : message.type;
382
+ if (options.oneofs) object._type = "type";
383
+ }
384
+ if (message.actionUrl != null && message.hasOwnProperty("actionUrl")) {
385
+ object.actionUrl = message.actionUrl;
386
+ if (options.oneofs) object._actionUrl = "actionUrl";
387
+ }
388
+ if (message.statusReshare != null && message.hasOwnProperty("statusReshare")) {
389
+ object.statusReshare =
390
+ $root.StatusAttributions.StatusAttribution.StatusReshare.toObject(
391
+ message.statusReshare,
392
+ options
393
+ );
394
+ if (options.oneofs) object.attributionData = "statusReshare";
395
+ }
396
+ if (message.externalShare != null && message.hasOwnProperty("externalShare")) {
397
+ object.externalShare =
398
+ $root.StatusAttributions.StatusAttribution.ExternalShare.toObject(
399
+ message.externalShare,
400
+ options
401
+ );
402
+ if (options.oneofs) object.attributionData = "externalShare";
403
+ }
404
+ if (message.music != null && message.hasOwnProperty("music")) {
405
+ object.music = $root.StatusAttributions.StatusAttribution.Music.toObject(
406
+ message.music,
407
+ options
408
+ );
409
+ if (options.oneofs) object.attributionData = "music";
410
+ }
411
+ if (message.groupStatus != null && message.hasOwnProperty("groupStatus")) {
412
+ object.groupStatus =
413
+ $root.StatusAttributions.StatusAttribution.GroupStatus.toObject(
414
+ message.groupStatus,
415
+ options
416
+ );
417
+ if (options.oneofs) object.attributionData = "groupStatus";
418
+ }
419
+ if (message.rlAttribution != null && message.hasOwnProperty("rlAttribution")) {
420
+ object.rlAttribution =
421
+ $root.StatusAttributions.StatusAttribution.RLAttribution.toObject(
422
+ message.rlAttribution,
423
+ options
424
+ );
425
+ if (options.oneofs) object.attributionData = "rlAttribution";
426
+ }
427
+ if (
428
+ message.aiCreatedAttribution != null &&
429
+ message.hasOwnProperty("aiCreatedAttribution")
430
+ ) {
431
+ object.aiCreatedAttribution =
432
+ $root.StatusAttributions.StatusAttribution.AiCreatedAttribution.toObject(
433
+ message.aiCreatedAttribution,
434
+ options
435
+ );
436
+ if (options.oneofs) object.attributionData = "aiCreatedAttribution";
437
+ }
438
+ return object;
439
+ };
440
+ StatusAttribution.prototype.toJSON = function toJSON() {
441
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
442
+ };
443
+ StatusAttribution.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
444
+ if (typeUrlPrefix === undefined) {
445
+ typeUrlPrefix = "type.googleapis.com";
446
+ }
447
+ return typeUrlPrefix + "/StatusAttributions.StatusAttribution";
448
+ };
449
+ StatusAttribution.AiCreatedAttribution = (function () {
450
+ function AiCreatedAttribution(properties) {
451
+ if (properties)
452
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
453
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
454
+ }
455
+ AiCreatedAttribution.prototype.source = null;
456
+ var $oneOfFields;
457
+ Object.defineProperty(AiCreatedAttribution.prototype, "_source", {
458
+ get: $util.oneOfGetter(($oneOfFields = ["source"])),
459
+ set: $util.oneOfSetter($oneOfFields),
460
+ });
461
+ AiCreatedAttribution.create = function create(properties) {
462
+ return new AiCreatedAttribution(properties);
463
+ };
464
+ AiCreatedAttribution.encode = function encode(message, writer) {
465
+ if (!writer) writer = $Writer.create();
466
+ if (message.source != null && Object.hasOwnProperty.call(message, "source"))
467
+ writer.uint32(8).int32(message.source);
468
+ return writer;
469
+ };
470
+ AiCreatedAttribution.encodeDelimited = function encodeDelimited(message, writer) {
471
+ return this.encode(message, writer).ldelim();
472
+ };
473
+ AiCreatedAttribution.decode = function decode(reader, length, error) {
474
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
475
+ var end = length === undefined ? reader.len : reader.pos + length,
476
+ message = new $root.StatusAttributions.StatusAttribution.AiCreatedAttribution();
477
+ while (reader.pos < end) {
478
+ var tag = reader.uint32();
479
+ if (tag === error) break;
480
+ switch (tag >>> 3) {
481
+ case 1: {
482
+ message.source = reader.int32();
483
+ break;
484
+ }
485
+ default:
486
+ reader.skipType(tag & 7);
487
+ break;
488
+ }
489
+ }
490
+ return message;
491
+ };
492
+ AiCreatedAttribution.decodeDelimited = function decodeDelimited(reader) {
493
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
494
+ return this.decode(reader, reader.uint32());
495
+ };
496
+ AiCreatedAttribution.verify = function verify(message) {
497
+ if (typeof message !== "object" || message === null) return "object expected";
498
+ var properties = {};
499
+ if (message.source != null && message.hasOwnProperty("source")) {
500
+ properties._source = 1;
501
+ switch (message.source) {
502
+ default:
503
+ return "source: enum value expected";
504
+ case 0:
505
+ case 1:
506
+ break;
507
+ }
508
+ }
509
+ return null;
510
+ };
511
+ AiCreatedAttribution.fromObject = function fromObject(object) {
512
+ if (
513
+ object instanceof
514
+ $root.StatusAttributions.StatusAttribution.AiCreatedAttribution
515
+ )
516
+ return object;
517
+ var message = new $root.StatusAttributions.StatusAttribution.AiCreatedAttribution();
518
+ switch (object.source) {
519
+ default:
520
+ if (typeof object.source === "number") {
521
+ message.source = object.source;
522
+ break;
523
+ }
524
+ break;
525
+ case "UNKNOWN":
526
+ case 0:
527
+ message.source = 0;
528
+ break;
529
+ case "STATUS_MIMICRY":
530
+ case 1:
531
+ message.source = 1;
532
+ break;
533
+ }
534
+ return message;
535
+ };
536
+ AiCreatedAttribution.toObject = function toObject(message, options) {
537
+ if (!options) options = {};
538
+ var object = {};
539
+ if (message.source != null && message.hasOwnProperty("source")) {
540
+ object.source =
541
+ options.enums === String
542
+ ? $root.StatusAttributions.StatusAttribution.AiCreatedAttribution
543
+ .Source[message.source] === undefined
544
+ ? message.source
545
+ : $root.StatusAttributions.StatusAttribution.AiCreatedAttribution
546
+ .Source[message.source]
547
+ : message.source;
548
+ if (options.oneofs) object._source = "source";
549
+ }
550
+ return object;
551
+ };
552
+ AiCreatedAttribution.prototype.toJSON = function toJSON() {
553
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
554
+ };
555
+ AiCreatedAttribution.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
556
+ if (typeUrlPrefix === undefined) {
557
+ typeUrlPrefix = "type.googleapis.com";
558
+ }
559
+ return typeUrlPrefix + "/StatusAttributions.StatusAttribution.AiCreatedAttribution";
560
+ };
561
+ AiCreatedAttribution.Source = (function () {
562
+ var valuesById = {},
563
+ values = Object.create(valuesById);
564
+ values[(valuesById[0] = "UNKNOWN")] = 0;
565
+ values[(valuesById[1] = "STATUS_MIMICRY")] = 1;
566
+ return values;
567
+ })();
568
+ return AiCreatedAttribution;
569
+ })();
570
+ StatusAttribution.ExternalShare = (function () {
571
+ function ExternalShare(properties) {
572
+ if (properties)
573
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
574
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
575
+ }
576
+ ExternalShare.prototype.actionUrl = null;
577
+ ExternalShare.prototype.source = null;
578
+ ExternalShare.prototype.duration = null;
579
+ ExternalShare.prototype.actionFallbackUrl = null;
580
+ var $oneOfFields;
581
+ Object.defineProperty(ExternalShare.prototype, "_actionUrl", {
582
+ get: $util.oneOfGetter(($oneOfFields = ["actionUrl"])),
583
+ set: $util.oneOfSetter($oneOfFields),
584
+ });
585
+ Object.defineProperty(ExternalShare.prototype, "_source", {
586
+ get: $util.oneOfGetter(($oneOfFields = ["source"])),
587
+ set: $util.oneOfSetter($oneOfFields),
588
+ });
589
+ Object.defineProperty(ExternalShare.prototype, "_duration", {
590
+ get: $util.oneOfGetter(($oneOfFields = ["duration"])),
591
+ set: $util.oneOfSetter($oneOfFields),
592
+ });
593
+ Object.defineProperty(ExternalShare.prototype, "_actionFallbackUrl", {
594
+ get: $util.oneOfGetter(($oneOfFields = ["actionFallbackUrl"])),
595
+ set: $util.oneOfSetter($oneOfFields),
596
+ });
597
+ ExternalShare.create = function create(properties) {
598
+ return new ExternalShare(properties);
599
+ };
600
+ ExternalShare.encode = function encode(message, writer) {
601
+ if (!writer) writer = $Writer.create();
602
+ if (message.actionUrl != null && Object.hasOwnProperty.call(message, "actionUrl"))
603
+ writer.uint32(10).string(message.actionUrl);
604
+ if (message.source != null && Object.hasOwnProperty.call(message, "source"))
605
+ writer.uint32(16).int32(message.source);
606
+ if (message.duration != null && Object.hasOwnProperty.call(message, "duration"))
607
+ writer.uint32(24).int32(message.duration);
608
+ if (
609
+ message.actionFallbackUrl != null &&
610
+ Object.hasOwnProperty.call(message, "actionFallbackUrl")
611
+ )
612
+ writer.uint32(34).string(message.actionFallbackUrl);
613
+ return writer;
614
+ };
615
+ ExternalShare.encodeDelimited = function encodeDelimited(message, writer) {
616
+ return this.encode(message, writer).ldelim();
617
+ };
618
+ ExternalShare.decode = function decode(reader, length, error) {
619
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
620
+ var end = length === undefined ? reader.len : reader.pos + length,
621
+ message = new $root.StatusAttributions.StatusAttribution.ExternalShare();
622
+ while (reader.pos < end) {
623
+ var tag = reader.uint32();
624
+ if (tag === error) break;
625
+ switch (tag >>> 3) {
626
+ case 1: {
627
+ message.actionUrl = reader.string();
628
+ break;
629
+ }
630
+ case 2: {
631
+ message.source = reader.int32();
632
+ break;
633
+ }
634
+ case 3: {
635
+ message.duration = reader.int32();
636
+ break;
637
+ }
638
+ case 4: {
639
+ message.actionFallbackUrl = reader.string();
640
+ break;
641
+ }
642
+ default:
643
+ reader.skipType(tag & 7);
644
+ break;
645
+ }
646
+ }
647
+ return message;
648
+ };
649
+ ExternalShare.decodeDelimited = function decodeDelimited(reader) {
650
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
651
+ return this.decode(reader, reader.uint32());
652
+ };
653
+ ExternalShare.verify = function verify(message) {
654
+ if (typeof message !== "object" || message === null) return "object expected";
655
+ var properties = {};
656
+ if (message.actionUrl != null && message.hasOwnProperty("actionUrl")) {
657
+ properties._actionUrl = 1;
658
+ if (!$util.isString(message.actionUrl)) return "actionUrl: string expected";
659
+ }
660
+ if (message.source != null && message.hasOwnProperty("source")) {
661
+ properties._source = 1;
662
+ switch (message.source) {
663
+ default:
664
+ return "source: enum value expected";
665
+ case 0:
666
+ case 1:
667
+ case 2:
668
+ case 3:
669
+ case 4:
670
+ case 5:
671
+ case 6:
672
+ case 7:
673
+ case 8:
674
+ case 9:
675
+ case 10:
676
+ break;
677
+ }
678
+ }
679
+ if (message.duration != null && message.hasOwnProperty("duration")) {
680
+ properties._duration = 1;
681
+ if (!$util.isInteger(message.duration)) return "duration: integer expected";
682
+ }
683
+ if (
684
+ message.actionFallbackUrl != null &&
685
+ message.hasOwnProperty("actionFallbackUrl")
686
+ ) {
687
+ properties._actionFallbackUrl = 1;
688
+ if (!$util.isString(message.actionFallbackUrl))
689
+ return "actionFallbackUrl: string expected";
690
+ }
691
+ return null;
692
+ };
693
+ ExternalShare.fromObject = function fromObject(object) {
694
+ if (object instanceof $root.StatusAttributions.StatusAttribution.ExternalShare)
695
+ return object;
696
+ var message = new $root.StatusAttributions.StatusAttribution.ExternalShare();
697
+ if (object.actionUrl != null) message.actionUrl = String(object.actionUrl);
698
+ switch (object.source) {
699
+ default:
700
+ if (typeof object.source === "number") {
701
+ message.source = object.source;
702
+ break;
703
+ }
704
+ break;
705
+ case "UNKNOWN":
706
+ case 0:
707
+ message.source = 0;
708
+ break;
709
+ case "INSTAGRAM":
710
+ case 1:
711
+ message.source = 1;
712
+ break;
713
+ case "FACEBOOK":
714
+ case 2:
715
+ message.source = 2;
716
+ break;
717
+ case "MESSENGER":
718
+ case 3:
719
+ message.source = 3;
720
+ break;
721
+ case "SPOTIFY":
722
+ case 4:
723
+ message.source = 4;
724
+ break;
725
+ case "YOUTUBE":
726
+ case 5:
727
+ message.source = 5;
728
+ break;
729
+ case "PINTEREST":
730
+ case 6:
731
+ message.source = 6;
732
+ break;
733
+ case "THREADS":
734
+ case 7:
735
+ message.source = 7;
736
+ break;
737
+ case "APPLE_MUSIC":
738
+ case 8:
739
+ message.source = 8;
740
+ break;
741
+ case "SHARECHAT":
742
+ case 9:
743
+ message.source = 9;
744
+ break;
745
+ case "GOOGLE_PHOTOS":
746
+ case 10:
747
+ message.source = 10;
748
+ break;
749
+ }
750
+ if (object.duration != null) message.duration = object.duration | 0;
751
+ if (object.actionFallbackUrl != null)
752
+ message.actionFallbackUrl = String(object.actionFallbackUrl);
753
+ return message;
754
+ };
755
+ ExternalShare.toObject = function toObject(message, options) {
756
+ if (!options) options = {};
757
+ var object = {};
758
+ if (message.actionUrl != null && message.hasOwnProperty("actionUrl")) {
759
+ object.actionUrl = message.actionUrl;
760
+ if (options.oneofs) object._actionUrl = "actionUrl";
761
+ }
762
+ if (message.source != null && message.hasOwnProperty("source")) {
763
+ object.source =
764
+ options.enums === String
765
+ ? $root.StatusAttributions.StatusAttribution.ExternalShare.Source[
766
+ message.source
767
+ ] === undefined
768
+ ? message.source
769
+ : $root.StatusAttributions.StatusAttribution.ExternalShare.Source[
770
+ message.source
771
+ ]
772
+ : message.source;
773
+ if (options.oneofs) object._source = "source";
774
+ }
775
+ if (message.duration != null && message.hasOwnProperty("duration")) {
776
+ object.duration = message.duration;
777
+ if (options.oneofs) object._duration = "duration";
778
+ }
779
+ if (
780
+ message.actionFallbackUrl != null &&
781
+ message.hasOwnProperty("actionFallbackUrl")
782
+ ) {
783
+ object.actionFallbackUrl = message.actionFallbackUrl;
784
+ if (options.oneofs) object._actionFallbackUrl = "actionFallbackUrl";
785
+ }
786
+ return object;
787
+ };
788
+ ExternalShare.prototype.toJSON = function toJSON() {
789
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
790
+ };
791
+ ExternalShare.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
792
+ if (typeUrlPrefix === undefined) {
793
+ typeUrlPrefix = "type.googleapis.com";
794
+ }
795
+ return typeUrlPrefix + "/StatusAttributions.StatusAttribution.ExternalShare";
796
+ };
797
+ ExternalShare.Source = (function () {
798
+ var valuesById = {},
799
+ values = Object.create(valuesById);
800
+ values[(valuesById[0] = "UNKNOWN")] = 0;
801
+ values[(valuesById[1] = "INSTAGRAM")] = 1;
802
+ values[(valuesById[2] = "FACEBOOK")] = 2;
803
+ values[(valuesById[3] = "MESSENGER")] = 3;
804
+ values[(valuesById[4] = "SPOTIFY")] = 4;
805
+ values[(valuesById[5] = "YOUTUBE")] = 5;
806
+ values[(valuesById[6] = "PINTEREST")] = 6;
807
+ values[(valuesById[7] = "THREADS")] = 7;
808
+ values[(valuesById[8] = "APPLE_MUSIC")] = 8;
809
+ values[(valuesById[9] = "SHARECHAT")] = 9;
810
+ values[(valuesById[10] = "GOOGLE_PHOTOS")] = 10;
811
+ return values;
812
+ })();
813
+ return ExternalShare;
814
+ })();
815
+ StatusAttribution.GroupStatus = (function () {
816
+ function GroupStatus(properties) {
817
+ if (properties)
818
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
819
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
820
+ }
821
+ GroupStatus.prototype.authorJid = null;
822
+ var $oneOfFields;
823
+ Object.defineProperty(GroupStatus.prototype, "_authorJid", {
824
+ get: $util.oneOfGetter(($oneOfFields = ["authorJid"])),
825
+ set: $util.oneOfSetter($oneOfFields),
826
+ });
827
+ GroupStatus.create = function create(properties) {
828
+ return new GroupStatus(properties);
829
+ };
830
+ GroupStatus.encode = function encode(message, writer) {
831
+ if (!writer) writer = $Writer.create();
832
+ if (message.authorJid != null && Object.hasOwnProperty.call(message, "authorJid"))
833
+ writer.uint32(10).string(message.authorJid);
834
+ return writer;
835
+ };
836
+ GroupStatus.encodeDelimited = function encodeDelimited(message, writer) {
837
+ return this.encode(message, writer).ldelim();
838
+ };
839
+ GroupStatus.decode = function decode(reader, length, error) {
840
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
841
+ var end = length === undefined ? reader.len : reader.pos + length,
842
+ message = new $root.StatusAttributions.StatusAttribution.GroupStatus();
843
+ while (reader.pos < end) {
844
+ var tag = reader.uint32();
845
+ if (tag === error) break;
846
+ switch (tag >>> 3) {
847
+ case 1: {
848
+ message.authorJid = reader.string();
849
+ break;
850
+ }
851
+ default:
852
+ reader.skipType(tag & 7);
853
+ break;
854
+ }
855
+ }
856
+ return message;
857
+ };
858
+ GroupStatus.decodeDelimited = function decodeDelimited(reader) {
859
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
860
+ return this.decode(reader, reader.uint32());
861
+ };
862
+ GroupStatus.verify = function verify(message) {
863
+ if (typeof message !== "object" || message === null) return "object expected";
864
+ var properties = {};
865
+ if (message.authorJid != null && message.hasOwnProperty("authorJid")) {
866
+ properties._authorJid = 1;
867
+ if (!$util.isString(message.authorJid)) return "authorJid: string expected";
868
+ }
869
+ return null;
870
+ };
871
+ GroupStatus.fromObject = function fromObject(object) {
872
+ if (object instanceof $root.StatusAttributions.StatusAttribution.GroupStatus)
873
+ return object;
874
+ var message = new $root.StatusAttributions.StatusAttribution.GroupStatus();
875
+ if (object.authorJid != null) message.authorJid = String(object.authorJid);
876
+ return message;
877
+ };
878
+ GroupStatus.toObject = function toObject(message, options) {
879
+ if (!options) options = {};
880
+ var object = {};
881
+ if (message.authorJid != null && message.hasOwnProperty("authorJid")) {
882
+ object.authorJid = message.authorJid;
883
+ if (options.oneofs) object._authorJid = "authorJid";
884
+ }
885
+ return object;
886
+ };
887
+ GroupStatus.prototype.toJSON = function toJSON() {
888
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
889
+ };
890
+ GroupStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
891
+ if (typeUrlPrefix === undefined) {
892
+ typeUrlPrefix = "type.googleapis.com";
893
+ }
894
+ return typeUrlPrefix + "/StatusAttributions.StatusAttribution.GroupStatus";
895
+ };
896
+ return GroupStatus;
897
+ })();
898
+ StatusAttribution.Music = (function () {
899
+ function Music(properties) {
900
+ if (properties)
901
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
902
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
903
+ }
904
+ Music.prototype.authorName = null;
905
+ Music.prototype.songId = null;
906
+ Music.prototype.title = null;
907
+ Music.prototype.author = null;
908
+ Music.prototype.artistAttribution = null;
909
+ Music.prototype.isExplicit = null;
910
+ var $oneOfFields;
911
+ Object.defineProperty(Music.prototype, "_authorName", {
912
+ get: $util.oneOfGetter(($oneOfFields = ["authorName"])),
913
+ set: $util.oneOfSetter($oneOfFields),
914
+ });
915
+ Object.defineProperty(Music.prototype, "_songId", {
916
+ get: $util.oneOfGetter(($oneOfFields = ["songId"])),
917
+ set: $util.oneOfSetter($oneOfFields),
918
+ });
919
+ Object.defineProperty(Music.prototype, "_title", {
920
+ get: $util.oneOfGetter(($oneOfFields = ["title"])),
921
+ set: $util.oneOfSetter($oneOfFields),
922
+ });
923
+ Object.defineProperty(Music.prototype, "_author", {
924
+ get: $util.oneOfGetter(($oneOfFields = ["author"])),
925
+ set: $util.oneOfSetter($oneOfFields),
926
+ });
927
+ Object.defineProperty(Music.prototype, "_artistAttribution", {
928
+ get: $util.oneOfGetter(($oneOfFields = ["artistAttribution"])),
929
+ set: $util.oneOfSetter($oneOfFields),
930
+ });
931
+ Object.defineProperty(Music.prototype, "_isExplicit", {
932
+ get: $util.oneOfGetter(($oneOfFields = ["isExplicit"])),
933
+ set: $util.oneOfSetter($oneOfFields),
934
+ });
935
+ Music.create = function create(properties) {
936
+ return new Music(properties);
937
+ };
938
+ Music.encode = function encode(message, writer) {
939
+ if (!writer) writer = $Writer.create();
940
+ if (message.authorName != null && Object.hasOwnProperty.call(message, "authorName"))
941
+ writer.uint32(10).string(message.authorName);
942
+ if (message.songId != null && Object.hasOwnProperty.call(message, "songId"))
943
+ writer.uint32(18).string(message.songId);
944
+ if (message.title != null && Object.hasOwnProperty.call(message, "title"))
945
+ writer.uint32(26).string(message.title);
946
+ if (message.author != null && Object.hasOwnProperty.call(message, "author"))
947
+ writer.uint32(34).string(message.author);
948
+ if (
949
+ message.artistAttribution != null &&
950
+ Object.hasOwnProperty.call(message, "artistAttribution")
951
+ )
952
+ writer.uint32(42).string(message.artistAttribution);
953
+ if (message.isExplicit != null && Object.hasOwnProperty.call(message, "isExplicit"))
954
+ writer.uint32(48).bool(message.isExplicit);
955
+ return writer;
956
+ };
957
+ Music.encodeDelimited = function encodeDelimited(message, writer) {
958
+ return this.encode(message, writer).ldelim();
959
+ };
960
+ Music.decode = function decode(reader, length, error) {
961
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
962
+ var end = length === undefined ? reader.len : reader.pos + length,
963
+ message = new $root.StatusAttributions.StatusAttribution.Music();
964
+ while (reader.pos < end) {
965
+ var tag = reader.uint32();
966
+ if (tag === error) break;
967
+ switch (tag >>> 3) {
968
+ case 1: {
969
+ message.authorName = reader.string();
970
+ break;
971
+ }
972
+ case 2: {
973
+ message.songId = reader.string();
974
+ break;
975
+ }
976
+ case 3: {
977
+ message.title = reader.string();
978
+ break;
979
+ }
980
+ case 4: {
981
+ message.author = reader.string();
982
+ break;
983
+ }
984
+ case 5: {
985
+ message.artistAttribution = reader.string();
986
+ break;
987
+ }
988
+ case 6: {
989
+ message.isExplicit = reader.bool();
990
+ break;
991
+ }
992
+ default:
993
+ reader.skipType(tag & 7);
994
+ break;
995
+ }
996
+ }
997
+ return message;
998
+ };
999
+ Music.decodeDelimited = function decodeDelimited(reader) {
1000
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
1001
+ return this.decode(reader, reader.uint32());
1002
+ };
1003
+ Music.verify = function verify(message) {
1004
+ if (typeof message !== "object" || message === null) return "object expected";
1005
+ var properties = {};
1006
+ if (message.authorName != null && message.hasOwnProperty("authorName")) {
1007
+ properties._authorName = 1;
1008
+ if (!$util.isString(message.authorName)) return "authorName: string expected";
1009
+ }
1010
+ if (message.songId != null && message.hasOwnProperty("songId")) {
1011
+ properties._songId = 1;
1012
+ if (!$util.isString(message.songId)) return "songId: string expected";
1013
+ }
1014
+ if (message.title != null && message.hasOwnProperty("title")) {
1015
+ properties._title = 1;
1016
+ if (!$util.isString(message.title)) return "title: string expected";
1017
+ }
1018
+ if (message.author != null && message.hasOwnProperty("author")) {
1019
+ properties._author = 1;
1020
+ if (!$util.isString(message.author)) return "author: string expected";
1021
+ }
1022
+ if (
1023
+ message.artistAttribution != null &&
1024
+ message.hasOwnProperty("artistAttribution")
1025
+ ) {
1026
+ properties._artistAttribution = 1;
1027
+ if (!$util.isString(message.artistAttribution))
1028
+ return "artistAttribution: string expected";
1029
+ }
1030
+ if (message.isExplicit != null && message.hasOwnProperty("isExplicit")) {
1031
+ properties._isExplicit = 1;
1032
+ if (typeof message.isExplicit !== "boolean")
1033
+ return "isExplicit: boolean expected";
1034
+ }
1035
+ return null;
1036
+ };
1037
+ Music.fromObject = function fromObject(object) {
1038
+ if (object instanceof $root.StatusAttributions.StatusAttribution.Music)
1039
+ return object;
1040
+ var message = new $root.StatusAttributions.StatusAttribution.Music();
1041
+ if (object.authorName != null) message.authorName = String(object.authorName);
1042
+ if (object.songId != null) message.songId = String(object.songId);
1043
+ if (object.title != null) message.title = String(object.title);
1044
+ if (object.author != null) message.author = String(object.author);
1045
+ if (object.artistAttribution != null)
1046
+ message.artistAttribution = String(object.artistAttribution);
1047
+ if (object.isExplicit != null) message.isExplicit = Boolean(object.isExplicit);
1048
+ return message;
1049
+ };
1050
+ Music.toObject = function toObject(message, options) {
1051
+ if (!options) options = {};
1052
+ var object = {};
1053
+ if (message.authorName != null && message.hasOwnProperty("authorName")) {
1054
+ object.authorName = message.authorName;
1055
+ if (options.oneofs) object._authorName = "authorName";
1056
+ }
1057
+ if (message.songId != null && message.hasOwnProperty("songId")) {
1058
+ object.songId = message.songId;
1059
+ if (options.oneofs) object._songId = "songId";
1060
+ }
1061
+ if (message.title != null && message.hasOwnProperty("title")) {
1062
+ object.title = message.title;
1063
+ if (options.oneofs) object._title = "title";
1064
+ }
1065
+ if (message.author != null && message.hasOwnProperty("author")) {
1066
+ object.author = message.author;
1067
+ if (options.oneofs) object._author = "author";
1068
+ }
1069
+ if (
1070
+ message.artistAttribution != null &&
1071
+ message.hasOwnProperty("artistAttribution")
1072
+ ) {
1073
+ object.artistAttribution = message.artistAttribution;
1074
+ if (options.oneofs) object._artistAttribution = "artistAttribution";
1075
+ }
1076
+ if (message.isExplicit != null && message.hasOwnProperty("isExplicit")) {
1077
+ object.isExplicit = message.isExplicit;
1078
+ if (options.oneofs) object._isExplicit = "isExplicit";
1079
+ }
1080
+ return object;
1081
+ };
1082
+ Music.prototype.toJSON = function toJSON() {
1083
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1084
+ };
1085
+ Music.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
1086
+ if (typeUrlPrefix === undefined) {
1087
+ typeUrlPrefix = "type.googleapis.com";
1088
+ }
1089
+ return typeUrlPrefix + "/StatusAttributions.StatusAttribution.Music";
1090
+ };
1091
+ return Music;
1092
+ })();
1093
+ StatusAttribution.RLAttribution = (function () {
1094
+ function RLAttribution(properties) {
1095
+ if (properties)
1096
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1097
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
1098
+ }
1099
+ RLAttribution.prototype.source = null;
1100
+ var $oneOfFields;
1101
+ Object.defineProperty(RLAttribution.prototype, "_source", {
1102
+ get: $util.oneOfGetter(($oneOfFields = ["source"])),
1103
+ set: $util.oneOfSetter($oneOfFields),
1104
+ });
1105
+ RLAttribution.create = function create(properties) {
1106
+ return new RLAttribution(properties);
1107
+ };
1108
+ RLAttribution.encode = function encode(message, writer) {
1109
+ if (!writer) writer = $Writer.create();
1110
+ if (message.source != null && Object.hasOwnProperty.call(message, "source"))
1111
+ writer.uint32(8).int32(message.source);
1112
+ return writer;
1113
+ };
1114
+ RLAttribution.encodeDelimited = function encodeDelimited(message, writer) {
1115
+ return this.encode(message, writer).ldelim();
1116
+ };
1117
+ RLAttribution.decode = function decode(reader, length, error) {
1118
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
1119
+ var end = length === undefined ? reader.len : reader.pos + length,
1120
+ message = new $root.StatusAttributions.StatusAttribution.RLAttribution();
1121
+ while (reader.pos < end) {
1122
+ var tag = reader.uint32();
1123
+ if (tag === error) break;
1124
+ switch (tag >>> 3) {
1125
+ case 1: {
1126
+ message.source = reader.int32();
1127
+ break;
1128
+ }
1129
+ default:
1130
+ reader.skipType(tag & 7);
1131
+ break;
1132
+ }
1133
+ }
1134
+ return message;
1135
+ };
1136
+ RLAttribution.decodeDelimited = function decodeDelimited(reader) {
1137
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
1138
+ return this.decode(reader, reader.uint32());
1139
+ };
1140
+ RLAttribution.verify = function verify(message) {
1141
+ if (typeof message !== "object" || message === null) return "object expected";
1142
+ var properties = {};
1143
+ if (message.source != null && message.hasOwnProperty("source")) {
1144
+ properties._source = 1;
1145
+ switch (message.source) {
1146
+ default:
1147
+ return "source: enum value expected";
1148
+ case 0:
1149
+ case 1:
1150
+ case 2:
1151
+ case 3:
1152
+ break;
1153
+ }
1154
+ }
1155
+ return null;
1156
+ };
1157
+ RLAttribution.fromObject = function fromObject(object) {
1158
+ if (object instanceof $root.StatusAttributions.StatusAttribution.RLAttribution)
1159
+ return object;
1160
+ var message = new $root.StatusAttributions.StatusAttribution.RLAttribution();
1161
+ switch (object.source) {
1162
+ default:
1163
+ if (typeof object.source === "number") {
1164
+ message.source = object.source;
1165
+ break;
1166
+ }
1167
+ break;
1168
+ case "UNKNOWN":
1169
+ case 0:
1170
+ message.source = 0;
1171
+ break;
1172
+ case "RAY_BAN_META_GLASSES":
1173
+ case 1:
1174
+ message.source = 1;
1175
+ break;
1176
+ case "OAKLEY_META_GLASSES":
1177
+ case 2:
1178
+ message.source = 2;
1179
+ break;
1180
+ case "HYPERNOVA_GLASSES":
1181
+ case 3:
1182
+ message.source = 3;
1183
+ break;
1184
+ }
1185
+ return message;
1186
+ };
1187
+ RLAttribution.toObject = function toObject(message, options) {
1188
+ if (!options) options = {};
1189
+ var object = {};
1190
+ if (message.source != null && message.hasOwnProperty("source")) {
1191
+ object.source =
1192
+ options.enums === String
1193
+ ? $root.StatusAttributions.StatusAttribution.RLAttribution.Source[
1194
+ message.source
1195
+ ] === undefined
1196
+ ? message.source
1197
+ : $root.StatusAttributions.StatusAttribution.RLAttribution.Source[
1198
+ message.source
1199
+ ]
1200
+ : message.source;
1201
+ if (options.oneofs) object._source = "source";
1202
+ }
1203
+ return object;
1204
+ };
1205
+ RLAttribution.prototype.toJSON = function toJSON() {
1206
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1207
+ };
1208
+ RLAttribution.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
1209
+ if (typeUrlPrefix === undefined) {
1210
+ typeUrlPrefix = "type.googleapis.com";
1211
+ }
1212
+ return typeUrlPrefix + "/StatusAttributions.StatusAttribution.RLAttribution";
1213
+ };
1214
+ RLAttribution.Source = (function () {
1215
+ var valuesById = {},
1216
+ values = Object.create(valuesById);
1217
+ values[(valuesById[0] = "UNKNOWN")] = 0;
1218
+ values[(valuesById[1] = "RAY_BAN_META_GLASSES")] = 1;
1219
+ values[(valuesById[2] = "OAKLEY_META_GLASSES")] = 2;
1220
+ values[(valuesById[3] = "HYPERNOVA_GLASSES")] = 3;
1221
+ return values;
1222
+ })();
1223
+ return RLAttribution;
1224
+ })();
1225
+ StatusAttribution.StatusReshare = (function () {
1226
+ function StatusReshare(properties) {
1227
+ if (properties)
1228
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1229
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
1230
+ }
1231
+ StatusReshare.prototype.source = null;
1232
+ StatusReshare.prototype.metadata = null;
1233
+ var $oneOfFields;
1234
+ Object.defineProperty(StatusReshare.prototype, "_source", {
1235
+ get: $util.oneOfGetter(($oneOfFields = ["source"])),
1236
+ set: $util.oneOfSetter($oneOfFields),
1237
+ });
1238
+ Object.defineProperty(StatusReshare.prototype, "_metadata", {
1239
+ get: $util.oneOfGetter(($oneOfFields = ["metadata"])),
1240
+ set: $util.oneOfSetter($oneOfFields),
1241
+ });
1242
+ StatusReshare.create = function create(properties) {
1243
+ return new StatusReshare(properties);
1244
+ };
1245
+ StatusReshare.encode = function encode(message, writer) {
1246
+ if (!writer) writer = $Writer.create();
1247
+ if (message.source != null && Object.hasOwnProperty.call(message, "source"))
1248
+ writer.uint32(8).int32(message.source);
1249
+ if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata"))
1250
+ $root.StatusAttributions.StatusAttribution.StatusReshare.Metadata.encode(
1251
+ message.metadata,
1252
+ writer.uint32(18).fork()
1253
+ ).ldelim();
1254
+ return writer;
1255
+ };
1256
+ StatusReshare.encodeDelimited = function encodeDelimited(message, writer) {
1257
+ return this.encode(message, writer).ldelim();
1258
+ };
1259
+ StatusReshare.decode = function decode(reader, length, error) {
1260
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
1261
+ var end = length === undefined ? reader.len : reader.pos + length,
1262
+ message = new $root.StatusAttributions.StatusAttribution.StatusReshare();
1263
+ while (reader.pos < end) {
1264
+ var tag = reader.uint32();
1265
+ if (tag === error) break;
1266
+ switch (tag >>> 3) {
1267
+ case 1: {
1268
+ message.source = reader.int32();
1269
+ break;
1270
+ }
1271
+ case 2: {
1272
+ message.metadata =
1273
+ $root.StatusAttributions.StatusAttribution.StatusReshare.Metadata.decode(
1274
+ reader,
1275
+ reader.uint32()
1276
+ );
1277
+ break;
1278
+ }
1279
+ default:
1280
+ reader.skipType(tag & 7);
1281
+ break;
1282
+ }
1283
+ }
1284
+ return message;
1285
+ };
1286
+ StatusReshare.decodeDelimited = function decodeDelimited(reader) {
1287
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
1288
+ return this.decode(reader, reader.uint32());
1289
+ };
1290
+ StatusReshare.verify = function verify(message) {
1291
+ if (typeof message !== "object" || message === null) return "object expected";
1292
+ var properties = {};
1293
+ if (message.source != null && message.hasOwnProperty("source")) {
1294
+ properties._source = 1;
1295
+ switch (message.source) {
1296
+ default:
1297
+ return "source: enum value expected";
1298
+ case 0:
1299
+ case 1:
1300
+ case 2:
1301
+ case 3:
1302
+ case 4:
1303
+ break;
1304
+ }
1305
+ }
1306
+ if (message.metadata != null && message.hasOwnProperty("metadata")) {
1307
+ properties._metadata = 1;
1308
+ {
1309
+ var error =
1310
+ $root.StatusAttributions.StatusAttribution.StatusReshare.Metadata.verify(
1311
+ message.metadata
1312
+ );
1313
+ if (error) return "metadata." + error;
1314
+ }
1315
+ }
1316
+ return null;
1317
+ };
1318
+ StatusReshare.fromObject = function fromObject(object) {
1319
+ if (object instanceof $root.StatusAttributions.StatusAttribution.StatusReshare)
1320
+ return object;
1321
+ var message = new $root.StatusAttributions.StatusAttribution.StatusReshare();
1322
+ switch (object.source) {
1323
+ default:
1324
+ if (typeof object.source === "number") {
1325
+ message.source = object.source;
1326
+ break;
1327
+ }
1328
+ break;
1329
+ case "UNKNOWN":
1330
+ case 0:
1331
+ message.source = 0;
1332
+ break;
1333
+ case "INTERNAL_RESHARE":
1334
+ case 1:
1335
+ message.source = 1;
1336
+ break;
1337
+ case "MENTION_RESHARE":
1338
+ case 2:
1339
+ message.source = 2;
1340
+ break;
1341
+ case "CHANNEL_RESHARE":
1342
+ case 3:
1343
+ message.source = 3;
1344
+ break;
1345
+ case "FORWARD":
1346
+ case 4:
1347
+ message.source = 4;
1348
+ break;
1349
+ }
1350
+ if (object.metadata != null) {
1351
+ if (typeof object.metadata !== "object")
1352
+ throw TypeError(
1353
+ ".StatusAttributions.StatusAttribution.StatusReshare.metadata: object expected"
1354
+ );
1355
+ message.metadata =
1356
+ $root.StatusAttributions.StatusAttribution.StatusReshare.Metadata.fromObject(
1357
+ object.metadata
1358
+ );
1359
+ }
1360
+ return message;
1361
+ };
1362
+ StatusReshare.toObject = function toObject(message, options) {
1363
+ if (!options) options = {};
1364
+ var object = {};
1365
+ if (message.source != null && message.hasOwnProperty("source")) {
1366
+ object.source =
1367
+ options.enums === String
1368
+ ? $root.StatusAttributions.StatusAttribution.StatusReshare.Source[
1369
+ message.source
1370
+ ] === undefined
1371
+ ? message.source
1372
+ : $root.StatusAttributions.StatusAttribution.StatusReshare.Source[
1373
+ message.source
1374
+ ]
1375
+ : message.source;
1376
+ if (options.oneofs) object._source = "source";
1377
+ }
1378
+ if (message.metadata != null && message.hasOwnProperty("metadata")) {
1379
+ object.metadata =
1380
+ $root.StatusAttributions.StatusAttribution.StatusReshare.Metadata.toObject(
1381
+ message.metadata,
1382
+ options
1383
+ );
1384
+ if (options.oneofs) object._metadata = "metadata";
1385
+ }
1386
+ return object;
1387
+ };
1388
+ StatusReshare.prototype.toJSON = function toJSON() {
1389
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1390
+ };
1391
+ StatusReshare.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
1392
+ if (typeUrlPrefix === undefined) {
1393
+ typeUrlPrefix = "type.googleapis.com";
1394
+ }
1395
+ return typeUrlPrefix + "/StatusAttributions.StatusAttribution.StatusReshare";
1396
+ };
1397
+ StatusReshare.Metadata = (function () {
1398
+ function Metadata(properties) {
1399
+ if (properties)
1400
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1401
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
1402
+ }
1403
+ Metadata.prototype.duration = null;
1404
+ Metadata.prototype.channelJid = null;
1405
+ Metadata.prototype.channelMessageId = null;
1406
+ Metadata.prototype.hasMultipleReshares = null;
1407
+ var $oneOfFields;
1408
+ Object.defineProperty(Metadata.prototype, "_duration", {
1409
+ get: $util.oneOfGetter(($oneOfFields = ["duration"])),
1410
+ set: $util.oneOfSetter($oneOfFields),
1411
+ });
1412
+ Object.defineProperty(Metadata.prototype, "_channelJid", {
1413
+ get: $util.oneOfGetter(($oneOfFields = ["channelJid"])),
1414
+ set: $util.oneOfSetter($oneOfFields),
1415
+ });
1416
+ Object.defineProperty(Metadata.prototype, "_channelMessageId", {
1417
+ get: $util.oneOfGetter(($oneOfFields = ["channelMessageId"])),
1418
+ set: $util.oneOfSetter($oneOfFields),
1419
+ });
1420
+ Object.defineProperty(Metadata.prototype, "_hasMultipleReshares", {
1421
+ get: $util.oneOfGetter(($oneOfFields = ["hasMultipleReshares"])),
1422
+ set: $util.oneOfSetter($oneOfFields),
1423
+ });
1424
+ Metadata.create = function create(properties) {
1425
+ return new Metadata(properties);
1426
+ };
1427
+ Metadata.encode = function encode(message, writer) {
1428
+ if (!writer) writer = $Writer.create();
1429
+ if (message.duration != null && Object.hasOwnProperty.call(message, "duration"))
1430
+ writer.uint32(8).int32(message.duration);
1431
+ if (
1432
+ message.channelJid != null &&
1433
+ Object.hasOwnProperty.call(message, "channelJid")
1434
+ )
1435
+ writer.uint32(18).string(message.channelJid);
1436
+ if (
1437
+ message.channelMessageId != null &&
1438
+ Object.hasOwnProperty.call(message, "channelMessageId")
1439
+ )
1440
+ writer.uint32(24).int32(message.channelMessageId);
1441
+ if (
1442
+ message.hasMultipleReshares != null &&
1443
+ Object.hasOwnProperty.call(message, "hasMultipleReshares")
1444
+ )
1445
+ writer.uint32(32).bool(message.hasMultipleReshares);
1446
+ return writer;
1447
+ };
1448
+ Metadata.encodeDelimited = function encodeDelimited(message, writer) {
1449
+ return this.encode(message, writer).ldelim();
1450
+ };
1451
+ Metadata.decode = function decode(reader, length, error) {
1452
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
1453
+ var end = length === undefined ? reader.len : reader.pos + length,
1454
+ message =
1455
+ new $root.StatusAttributions.StatusAttribution.StatusReshare.Metadata();
1456
+ while (reader.pos < end) {
1457
+ var tag = reader.uint32();
1458
+ if (tag === error) break;
1459
+ switch (tag >>> 3) {
1460
+ case 1: {
1461
+ message.duration = reader.int32();
1462
+ break;
1463
+ }
1464
+ case 2: {
1465
+ message.channelJid = reader.string();
1466
+ break;
1467
+ }
1468
+ case 3: {
1469
+ message.channelMessageId = reader.int32();
1470
+ break;
1471
+ }
1472
+ case 4: {
1473
+ message.hasMultipleReshares = reader.bool();
1474
+ break;
1475
+ }
1476
+ default:
1477
+ reader.skipType(tag & 7);
1478
+ break;
1479
+ }
1480
+ }
1481
+ return message;
1482
+ };
1483
+ Metadata.decodeDelimited = function decodeDelimited(reader) {
1484
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
1485
+ return this.decode(reader, reader.uint32());
1486
+ };
1487
+ Metadata.verify = function verify(message) {
1488
+ if (typeof message !== "object" || message === null) return "object expected";
1489
+ var properties = {};
1490
+ if (message.duration != null && message.hasOwnProperty("duration")) {
1491
+ properties._duration = 1;
1492
+ if (!$util.isInteger(message.duration)) return "duration: integer expected";
1493
+ }
1494
+ if (message.channelJid != null && message.hasOwnProperty("channelJid")) {
1495
+ properties._channelJid = 1;
1496
+ if (!$util.isString(message.channelJid))
1497
+ return "channelJid: string expected";
1498
+ }
1499
+ if (
1500
+ message.channelMessageId != null &&
1501
+ message.hasOwnProperty("channelMessageId")
1502
+ ) {
1503
+ properties._channelMessageId = 1;
1504
+ if (!$util.isInteger(message.channelMessageId))
1505
+ return "channelMessageId: integer expected";
1506
+ }
1507
+ if (
1508
+ message.hasMultipleReshares != null &&
1509
+ message.hasOwnProperty("hasMultipleReshares")
1510
+ ) {
1511
+ properties._hasMultipleReshares = 1;
1512
+ if (typeof message.hasMultipleReshares !== "boolean")
1513
+ return "hasMultipleReshares: boolean expected";
1514
+ }
1515
+ return null;
1516
+ };
1517
+ Metadata.fromObject = function fromObject(object) {
1518
+ if (
1519
+ object instanceof
1520
+ $root.StatusAttributions.StatusAttribution.StatusReshare.Metadata
1521
+ )
1522
+ return object;
1523
+ var message =
1524
+ new $root.StatusAttributions.StatusAttribution.StatusReshare.Metadata();
1525
+ if (object.duration != null) message.duration = object.duration | 0;
1526
+ if (object.channelJid != null) message.channelJid = String(object.channelJid);
1527
+ if (object.channelMessageId != null)
1528
+ message.channelMessageId = object.channelMessageId | 0;
1529
+ if (object.hasMultipleReshares != null)
1530
+ message.hasMultipleReshares = Boolean(object.hasMultipleReshares);
1531
+ return message;
1532
+ };
1533
+ Metadata.toObject = function toObject(message, options) {
1534
+ if (!options) options = {};
1535
+ var object = {};
1536
+ if (message.duration != null && message.hasOwnProperty("duration")) {
1537
+ object.duration = message.duration;
1538
+ if (options.oneofs) object._duration = "duration";
1539
+ }
1540
+ if (message.channelJid != null && message.hasOwnProperty("channelJid")) {
1541
+ object.channelJid = message.channelJid;
1542
+ if (options.oneofs) object._channelJid = "channelJid";
1543
+ }
1544
+ if (
1545
+ message.channelMessageId != null &&
1546
+ message.hasOwnProperty("channelMessageId")
1547
+ ) {
1548
+ object.channelMessageId = message.channelMessageId;
1549
+ if (options.oneofs) object._channelMessageId = "channelMessageId";
1550
+ }
1551
+ if (
1552
+ message.hasMultipleReshares != null &&
1553
+ message.hasOwnProperty("hasMultipleReshares")
1554
+ ) {
1555
+ object.hasMultipleReshares = message.hasMultipleReshares;
1556
+ if (options.oneofs) object._hasMultipleReshares = "hasMultipleReshares";
1557
+ }
1558
+ return object;
1559
+ };
1560
+ Metadata.prototype.toJSON = function toJSON() {
1561
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1562
+ };
1563
+ Metadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
1564
+ if (typeUrlPrefix === undefined) {
1565
+ typeUrlPrefix = "type.googleapis.com";
1566
+ }
1567
+ return (
1568
+ typeUrlPrefix +
1569
+ "/StatusAttributions.StatusAttribution.StatusReshare.Metadata"
1570
+ );
1571
+ };
1572
+ return Metadata;
1573
+ })();
1574
+ StatusReshare.Source = (function () {
1575
+ var valuesById = {},
1576
+ values = Object.create(valuesById);
1577
+ values[(valuesById[0] = "UNKNOWN")] = 0;
1578
+ values[(valuesById[1] = "INTERNAL_RESHARE")] = 1;
1579
+ values[(valuesById[2] = "MENTION_RESHARE")] = 2;
1580
+ values[(valuesById[3] = "CHANNEL_RESHARE")] = 3;
1581
+ values[(valuesById[4] = "FORWARD")] = 4;
1582
+ return values;
1583
+ })();
1584
+ return StatusReshare;
1585
+ })();
1586
+ StatusAttribution.Type = (function () {
1587
+ var valuesById = {},
1588
+ values = Object.create(valuesById);
1589
+ values[(valuesById[0] = "UNKNOWN")] = 0;
1590
+ values[(valuesById[1] = "RESHARE")] = 1;
1591
+ values[(valuesById[2] = "EXTERNAL_SHARE")] = 2;
1592
+ values[(valuesById[3] = "MUSIC")] = 3;
1593
+ values[(valuesById[4] = "STATUS_MENTION")] = 4;
1594
+ values[(valuesById[5] = "GROUP_STATUS")] = 5;
1595
+ values[(valuesById[6] = "RL_ATTRIBUTION")] = 6;
1596
+ values[(valuesById[7] = "AI_CREATED")] = 7;
1597
+ values[(valuesById[8] = "LAYOUTS")] = 8;
1598
+ return values;
1599
+ })();
1600
+ return StatusAttribution;
1601
+ })();
1602
+ return StatusAttributions;
1603
+ })();
1604
+ module.exports = $root;