@wireapp/protocol-messaging 1.60.0 → 1.61.0

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 (4) hide show
  1. package/package.json +2 -2
  2. package/web/messages.js +2476 -1210
  3. package/web/mls.js +80 -32
  4. package/web/otr.js +567 -259
package/web/otr.js CHANGED
@@ -38,7 +38,7 @@ $root.proteus = (function() {
38
38
  function UserId(properties) {
39
39
  if (properties)
40
40
  for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
41
- if (properties[keys[i]] != null)
41
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
42
42
  this[keys[i]] = properties[keys[i]];
43
43
  }
44
44
 
@@ -71,9 +71,13 @@ $root.proteus = (function() {
71
71
  * @param {$protobuf.Writer} [writer] Writer to encode to
72
72
  * @returns {$protobuf.Writer} Writer
73
73
  */
74
- UserId.encode = function encode(message, writer) {
74
+ UserId.encode = function encode(message, writer, q) {
75
75
  if (!writer)
76
76
  writer = $Writer.create();
77
+ if (q === undefined)
78
+ q = 0;
79
+ if (q > $util.recursionLimit)
80
+ throw Error("max depth exceeded");
77
81
  writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.uuid);
78
82
  return writer;
79
83
  };
@@ -102,23 +106,29 @@ $root.proteus = (function() {
102
106
  * @throws {Error} If the payload is not a reader or valid buffer
103
107
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
104
108
  */
105
- UserId.decode = function decode(reader, length) {
109
+ UserId.decode = function decode(reader, length, error, long) {
106
110
  if (!(reader instanceof $Reader))
107
111
  reader = $Reader.create(reader);
112
+ if (long === undefined)
113
+ long = 0;
114
+ if (long > $Reader.recursionLimit)
115
+ throw Error("maximum nesting depth exceeded");
108
116
  var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proteus.UserId();
109
117
  while (reader.pos < end) {
110
118
  var tag = reader.uint32();
119
+ if (tag === error)
120
+ break;
111
121
  switch (tag >>> 3) {
112
122
  case 1: {
113
123
  message.uuid = reader.bytes();
114
124
  break;
115
125
  }
116
126
  default:
117
- reader.skipType(tag & 7);
127
+ reader.skipType(tag & 7, long);
118
128
  break;
119
129
  }
120
130
  }
121
- if (!message.hasOwnProperty("uuid"))
131
+ if (!Object.hasOwnProperty.call(message, "uuid"))
122
132
  throw $util.ProtocolError("missing required 'uuid'", { instance: message });
123
133
  return message;
124
134
  };
@@ -147,9 +157,13 @@ $root.proteus = (function() {
147
157
  * @param {Object.<string,*>} message Plain object to verify
148
158
  * @returns {string|null} `null` if valid, otherwise the reason why it is not
149
159
  */
150
- UserId.verify = function verify(message) {
160
+ UserId.verify = function verify(message, long) {
151
161
  if (typeof message !== "object" || message === null)
152
162
  return "object expected";
163
+ if (long === undefined)
164
+ long = 0;
165
+ if (long > $util.recursionLimit)
166
+ return "maximum nesting depth exceeded";
153
167
  if (!(message.uuid && typeof message.uuid.length === "number" || $util.isString(message.uuid)))
154
168
  return "uuid: buffer expected";
155
169
  return null;
@@ -163,9 +177,15 @@ $root.proteus = (function() {
163
177
  * @param {Object.<string,*>} object Plain object
164
178
  * @returns {proteus.UserId} UserId
165
179
  */
166
- UserId.fromObject = function fromObject(object) {
180
+ UserId.fromObject = function fromObject(object, long) {
167
181
  if (object instanceof $root.proteus.UserId)
168
182
  return object;
183
+ if (!$util.isObject(object))
184
+ throw TypeError(".proteus.UserId: object expected");
185
+ if (long === undefined)
186
+ long = 0;
187
+ if (long > $util.recursionLimit)
188
+ throw Error("maximum nesting depth exceeded");
169
189
  var message = new $root.proteus.UserId();
170
190
  if (object.uuid != null)
171
191
  if (typeof object.uuid === "string")
@@ -184,9 +204,13 @@ $root.proteus = (function() {
184
204
  * @param {$protobuf.IConversionOptions} [options] Conversion options
185
205
  * @returns {Object.<string,*>} Plain object
186
206
  */
187
- UserId.toObject = function toObject(message, options) {
207
+ UserId.toObject = function toObject(message, options, q) {
188
208
  if (!options)
189
209
  options = {};
210
+ if (q === undefined)
211
+ q = 0;
212
+ if (q > $util.recursionLimit)
213
+ throw Error("max depth exceeded");
190
214
  var object = {};
191
215
  if (options.defaults)
192
216
  if (options.bytes === String)
@@ -196,7 +220,7 @@ $root.proteus = (function() {
196
220
  if (options.bytes !== Array)
197
221
  object.uuid = $util.newBuffer(object.uuid);
198
222
  }
199
- if (message.uuid != null && message.hasOwnProperty("uuid"))
223
+ if (message.uuid != null && Object.hasOwnProperty.call(message, "uuid"))
200
224
  object.uuid = options.bytes === String ? $util.base64.encode(message.uuid, 0, message.uuid.length) : options.bytes === Array ? Array.prototype.slice.call(message.uuid) : message.uuid;
201
225
  return object;
202
226
  };
@@ -251,7 +275,7 @@ $root.proteus = (function() {
251
275
  function QualifiedUserId(properties) {
252
276
  if (properties)
253
277
  for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
254
- if (properties[keys[i]] != null)
278
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
255
279
  this[keys[i]] = properties[keys[i]];
256
280
  }
257
281
 
@@ -292,9 +316,13 @@ $root.proteus = (function() {
292
316
  * @param {$protobuf.Writer} [writer] Writer to encode to
293
317
  * @returns {$protobuf.Writer} Writer
294
318
  */
295
- QualifiedUserId.encode = function encode(message, writer) {
319
+ QualifiedUserId.encode = function encode(message, writer, q) {
296
320
  if (!writer)
297
321
  writer = $Writer.create();
322
+ if (q === undefined)
323
+ q = 0;
324
+ if (q > $util.recursionLimit)
325
+ throw Error("max depth exceeded");
298
326
  writer.uint32(/* id 1, wireType 2 =*/10).string(message.id);
299
327
  writer.uint32(/* id 2, wireType 2 =*/18).string(message.domain);
300
328
  return writer;
@@ -324,12 +352,18 @@ $root.proteus = (function() {
324
352
  * @throws {Error} If the payload is not a reader or valid buffer
325
353
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
326
354
  */
327
- QualifiedUserId.decode = function decode(reader, length) {
355
+ QualifiedUserId.decode = function decode(reader, length, error, long) {
328
356
  if (!(reader instanceof $Reader))
329
357
  reader = $Reader.create(reader);
358
+ if (long === undefined)
359
+ long = 0;
360
+ if (long > $Reader.recursionLimit)
361
+ throw Error("maximum nesting depth exceeded");
330
362
  var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proteus.QualifiedUserId();
331
363
  while (reader.pos < end) {
332
364
  var tag = reader.uint32();
365
+ if (tag === error)
366
+ break;
333
367
  switch (tag >>> 3) {
334
368
  case 1: {
335
369
  message.id = reader.string();
@@ -340,13 +374,13 @@ $root.proteus = (function() {
340
374
  break;
341
375
  }
342
376
  default:
343
- reader.skipType(tag & 7);
377
+ reader.skipType(tag & 7, long);
344
378
  break;
345
379
  }
346
380
  }
347
- if (!message.hasOwnProperty("id"))
381
+ if (!Object.hasOwnProperty.call(message, "id"))
348
382
  throw $util.ProtocolError("missing required 'id'", { instance: message });
349
- if (!message.hasOwnProperty("domain"))
383
+ if (!Object.hasOwnProperty.call(message, "domain"))
350
384
  throw $util.ProtocolError("missing required 'domain'", { instance: message });
351
385
  return message;
352
386
  };
@@ -375,9 +409,13 @@ $root.proteus = (function() {
375
409
  * @param {Object.<string,*>} message Plain object to verify
376
410
  * @returns {string|null} `null` if valid, otherwise the reason why it is not
377
411
  */
378
- QualifiedUserId.verify = function verify(message) {
412
+ QualifiedUserId.verify = function verify(message, long) {
379
413
  if (typeof message !== "object" || message === null)
380
414
  return "object expected";
415
+ if (long === undefined)
416
+ long = 0;
417
+ if (long > $util.recursionLimit)
418
+ return "maximum nesting depth exceeded";
381
419
  if (!$util.isString(message.id))
382
420
  return "id: string expected";
383
421
  if (!$util.isString(message.domain))
@@ -393,9 +431,15 @@ $root.proteus = (function() {
393
431
  * @param {Object.<string,*>} object Plain object
394
432
  * @returns {proteus.QualifiedUserId} QualifiedUserId
395
433
  */
396
- QualifiedUserId.fromObject = function fromObject(object) {
434
+ QualifiedUserId.fromObject = function fromObject(object, long) {
397
435
  if (object instanceof $root.proteus.QualifiedUserId)
398
436
  return object;
437
+ if (!$util.isObject(object))
438
+ throw TypeError(".proteus.QualifiedUserId: object expected");
439
+ if (long === undefined)
440
+ long = 0;
441
+ if (long > $util.recursionLimit)
442
+ throw Error("maximum nesting depth exceeded");
399
443
  var message = new $root.proteus.QualifiedUserId();
400
444
  if (object.id != null)
401
445
  message.id = String(object.id);
@@ -413,17 +457,21 @@ $root.proteus = (function() {
413
457
  * @param {$protobuf.IConversionOptions} [options] Conversion options
414
458
  * @returns {Object.<string,*>} Plain object
415
459
  */
416
- QualifiedUserId.toObject = function toObject(message, options) {
460
+ QualifiedUserId.toObject = function toObject(message, options, q) {
417
461
  if (!options)
418
462
  options = {};
463
+ if (q === undefined)
464
+ q = 0;
465
+ if (q > $util.recursionLimit)
466
+ throw Error("max depth exceeded");
419
467
  var object = {};
420
468
  if (options.defaults) {
421
469
  object.id = "";
422
470
  object.domain = "";
423
471
  }
424
- if (message.id != null && message.hasOwnProperty("id"))
472
+ if (message.id != null && Object.hasOwnProperty.call(message, "id"))
425
473
  object.id = message.id;
426
- if (message.domain != null && message.hasOwnProperty("domain"))
474
+ if (message.domain != null && Object.hasOwnProperty.call(message, "domain"))
427
475
  object.domain = message.domain;
428
476
  return object;
429
477
  };
@@ -477,7 +525,7 @@ $root.proteus = (function() {
477
525
  function ClientId(properties) {
478
526
  if (properties)
479
527
  for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
480
- if (properties[keys[i]] != null)
528
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
481
529
  this[keys[i]] = properties[keys[i]];
482
530
  }
483
531
 
@@ -510,9 +558,13 @@ $root.proteus = (function() {
510
558
  * @param {$protobuf.Writer} [writer] Writer to encode to
511
559
  * @returns {$protobuf.Writer} Writer
512
560
  */
513
- ClientId.encode = function encode(message, writer) {
561
+ ClientId.encode = function encode(message, writer, q) {
514
562
  if (!writer)
515
563
  writer = $Writer.create();
564
+ if (q === undefined)
565
+ q = 0;
566
+ if (q > $util.recursionLimit)
567
+ throw Error("max depth exceeded");
516
568
  writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.client);
517
569
  return writer;
518
570
  };
@@ -541,23 +593,29 @@ $root.proteus = (function() {
541
593
  * @throws {Error} If the payload is not a reader or valid buffer
542
594
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
543
595
  */
544
- ClientId.decode = function decode(reader, length) {
596
+ ClientId.decode = function decode(reader, length, error, long) {
545
597
  if (!(reader instanceof $Reader))
546
598
  reader = $Reader.create(reader);
599
+ if (long === undefined)
600
+ long = 0;
601
+ if (long > $Reader.recursionLimit)
602
+ throw Error("maximum nesting depth exceeded");
547
603
  var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proteus.ClientId();
548
604
  while (reader.pos < end) {
549
605
  var tag = reader.uint32();
606
+ if (tag === error)
607
+ break;
550
608
  switch (tag >>> 3) {
551
609
  case 1: {
552
610
  message.client = reader.uint64();
553
611
  break;
554
612
  }
555
613
  default:
556
- reader.skipType(tag & 7);
614
+ reader.skipType(tag & 7, long);
557
615
  break;
558
616
  }
559
617
  }
560
- if (!message.hasOwnProperty("client"))
618
+ if (!Object.hasOwnProperty.call(message, "client"))
561
619
  throw $util.ProtocolError("missing required 'client'", { instance: message });
562
620
  return message;
563
621
  };
@@ -586,9 +644,13 @@ $root.proteus = (function() {
586
644
  * @param {Object.<string,*>} message Plain object to verify
587
645
  * @returns {string|null} `null` if valid, otherwise the reason why it is not
588
646
  */
589
- ClientId.verify = function verify(message) {
647
+ ClientId.verify = function verify(message, long) {
590
648
  if (typeof message !== "object" || message === null)
591
649
  return "object expected";
650
+ if (long === undefined)
651
+ long = 0;
652
+ if (long > $util.recursionLimit)
653
+ return "maximum nesting depth exceeded";
592
654
  if (!$util.isInteger(message.client) && !(message.client && $util.isInteger(message.client.low) && $util.isInteger(message.client.high)))
593
655
  return "client: integer|Long expected";
594
656
  return null;
@@ -602,13 +664,19 @@ $root.proteus = (function() {
602
664
  * @param {Object.<string,*>} object Plain object
603
665
  * @returns {proteus.ClientId} ClientId
604
666
  */
605
- ClientId.fromObject = function fromObject(object) {
667
+ ClientId.fromObject = function fromObject(object, long) {
606
668
  if (object instanceof $root.proteus.ClientId)
607
669
  return object;
670
+ if (!$util.isObject(object))
671
+ throw TypeError(".proteus.ClientId: object expected");
672
+ if (long === undefined)
673
+ long = 0;
674
+ if (long > $util.recursionLimit)
675
+ throw Error("maximum nesting depth exceeded");
608
676
  var message = new $root.proteus.ClientId();
609
677
  if (object.client != null)
610
678
  if ($util.Long)
611
- (message.client = $util.Long.fromValue(object.client)).unsigned = true;
679
+ message.client = $util.Long.fromValue(object.client, true);
612
680
  else if (typeof object.client === "string")
613
681
  message.client = parseInt(object.client, 10);
614
682
  else if (typeof object.client === "number")
@@ -627,18 +695,24 @@ $root.proteus = (function() {
627
695
  * @param {$protobuf.IConversionOptions} [options] Conversion options
628
696
  * @returns {Object.<string,*>} Plain object
629
697
  */
630
- ClientId.toObject = function toObject(message, options) {
698
+ ClientId.toObject = function toObject(message, options, q) {
631
699
  if (!options)
632
700
  options = {};
701
+ if (q === undefined)
702
+ q = 0;
703
+ if (q > $util.recursionLimit)
704
+ throw Error("max depth exceeded");
633
705
  var object = {};
634
706
  if (options.defaults)
635
707
  if ($util.Long) {
636
708
  var long = new $util.Long(0, 0, true);
637
- object.client = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
709
+ object.client = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long;
638
710
  } else
639
- object.client = options.longs === String ? "0" : 0;
640
- if (message.client != null && message.hasOwnProperty("client"))
641
- if (typeof message.client === "number")
711
+ object.client = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0;
712
+ if (message.client != null && Object.hasOwnProperty.call(message, "client"))
713
+ if (typeof BigInt !== "undefined" && options.longs === BigInt)
714
+ object.client = typeof message.client === "number" ? BigInt(message.client) : $util.Long.fromBits(message.client.low >>> 0, message.client.high >>> 0, true).toBigInt();
715
+ else if (typeof message.client === "number")
642
716
  object.client = options.longs === String ? String(message.client) : message.client;
643
717
  else
644
718
  object.client = options.longs === String ? $util.Long.prototype.toString.call(message.client) : options.longs === Number ? new $util.LongBits(message.client.low >>> 0, message.client.high >>> 0).toNumber(true) : message.client;
@@ -695,7 +769,7 @@ $root.proteus = (function() {
695
769
  function ClientEntry(properties) {
696
770
  if (properties)
697
771
  for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
698
- if (properties[keys[i]] != null)
772
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
699
773
  this[keys[i]] = properties[keys[i]];
700
774
  }
701
775
 
@@ -736,10 +810,14 @@ $root.proteus = (function() {
736
810
  * @param {$protobuf.Writer} [writer] Writer to encode to
737
811
  * @returns {$protobuf.Writer} Writer
738
812
  */
739
- ClientEntry.encode = function encode(message, writer) {
813
+ ClientEntry.encode = function encode(message, writer, q) {
740
814
  if (!writer)
741
815
  writer = $Writer.create();
742
- $root.proteus.ClientId.encode(message.client, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
816
+ if (q === undefined)
817
+ q = 0;
818
+ if (q > $util.recursionLimit)
819
+ throw Error("max depth exceeded");
820
+ $root.proteus.ClientId.encode(message.client, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim();
743
821
  writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.text);
744
822
  return writer;
745
823
  };
@@ -768,15 +846,21 @@ $root.proteus = (function() {
768
846
  * @throws {Error} If the payload is not a reader or valid buffer
769
847
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
770
848
  */
771
- ClientEntry.decode = function decode(reader, length) {
849
+ ClientEntry.decode = function decode(reader, length, error, long) {
772
850
  if (!(reader instanceof $Reader))
773
851
  reader = $Reader.create(reader);
852
+ if (long === undefined)
853
+ long = 0;
854
+ if (long > $Reader.recursionLimit)
855
+ throw Error("maximum nesting depth exceeded");
774
856
  var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proteus.ClientEntry();
775
857
  while (reader.pos < end) {
776
858
  var tag = reader.uint32();
859
+ if (tag === error)
860
+ break;
777
861
  switch (tag >>> 3) {
778
862
  case 1: {
779
- message.client = $root.proteus.ClientId.decode(reader, reader.uint32());
863
+ message.client = $root.proteus.ClientId.decode(reader, reader.uint32(), undefined, long + 1);
780
864
  break;
781
865
  }
782
866
  case 2: {
@@ -784,13 +868,13 @@ $root.proteus = (function() {
784
868
  break;
785
869
  }
786
870
  default:
787
- reader.skipType(tag & 7);
871
+ reader.skipType(tag & 7, long);
788
872
  break;
789
873
  }
790
874
  }
791
- if (!message.hasOwnProperty("client"))
875
+ if (!Object.hasOwnProperty.call(message, "client"))
792
876
  throw $util.ProtocolError("missing required 'client'", { instance: message });
793
- if (!message.hasOwnProperty("text"))
877
+ if (!Object.hasOwnProperty.call(message, "text"))
794
878
  throw $util.ProtocolError("missing required 'text'", { instance: message });
795
879
  return message;
796
880
  };
@@ -819,11 +903,15 @@ $root.proteus = (function() {
819
903
  * @param {Object.<string,*>} message Plain object to verify
820
904
  * @returns {string|null} `null` if valid, otherwise the reason why it is not
821
905
  */
822
- ClientEntry.verify = function verify(message) {
906
+ ClientEntry.verify = function verify(message, long) {
823
907
  if (typeof message !== "object" || message === null)
824
908
  return "object expected";
909
+ if (long === undefined)
910
+ long = 0;
911
+ if (long > $util.recursionLimit)
912
+ return "maximum nesting depth exceeded";
825
913
  {
826
- var error = $root.proteus.ClientId.verify(message.client);
914
+ var error = $root.proteus.ClientId.verify(message.client, long + 1);
827
915
  if (error)
828
916
  return "client." + error;
829
917
  }
@@ -840,14 +928,20 @@ $root.proteus = (function() {
840
928
  * @param {Object.<string,*>} object Plain object
841
929
  * @returns {proteus.ClientEntry} ClientEntry
842
930
  */
843
- ClientEntry.fromObject = function fromObject(object) {
931
+ ClientEntry.fromObject = function fromObject(object, long) {
844
932
  if (object instanceof $root.proteus.ClientEntry)
845
933
  return object;
934
+ if (!$util.isObject(object))
935
+ throw TypeError(".proteus.ClientEntry: object expected");
936
+ if (long === undefined)
937
+ long = 0;
938
+ if (long > $util.recursionLimit)
939
+ throw Error("maximum nesting depth exceeded");
846
940
  var message = new $root.proteus.ClientEntry();
847
941
  if (object.client != null) {
848
- if (typeof object.client !== "object")
942
+ if (!$util.isObject(object.client))
849
943
  throw TypeError(".proteus.ClientEntry.client: object expected");
850
- message.client = $root.proteus.ClientId.fromObject(object.client);
944
+ message.client = $root.proteus.ClientId.fromObject(object.client, long + 1);
851
945
  }
852
946
  if (object.text != null)
853
947
  if (typeof object.text === "string")
@@ -866,9 +960,13 @@ $root.proteus = (function() {
866
960
  * @param {$protobuf.IConversionOptions} [options] Conversion options
867
961
  * @returns {Object.<string,*>} Plain object
868
962
  */
869
- ClientEntry.toObject = function toObject(message, options) {
963
+ ClientEntry.toObject = function toObject(message, options, q) {
870
964
  if (!options)
871
965
  options = {};
966
+ if (q === undefined)
967
+ q = 0;
968
+ if (q > $util.recursionLimit)
969
+ throw Error("max depth exceeded");
872
970
  var object = {};
873
971
  if (options.defaults) {
874
972
  object.client = null;
@@ -880,9 +978,9 @@ $root.proteus = (function() {
880
978
  object.text = $util.newBuffer(object.text);
881
979
  }
882
980
  }
883
- if (message.client != null && message.hasOwnProperty("client"))
884
- object.client = $root.proteus.ClientId.toObject(message.client, options);
885
- if (message.text != null && message.hasOwnProperty("text"))
981
+ if (message.client != null && Object.hasOwnProperty.call(message, "client"))
982
+ object.client = $root.proteus.ClientId.toObject(message.client, options, q + 1);
983
+ if (message.text != null && Object.hasOwnProperty.call(message, "text"))
886
984
  object.text = options.bytes === String ? $util.base64.encode(message.text, 0, message.text.length) : options.bytes === Array ? Array.prototype.slice.call(message.text) : message.text;
887
985
  return object;
888
986
  };
@@ -938,7 +1036,7 @@ $root.proteus = (function() {
938
1036
  this.clients = [];
939
1037
  if (properties)
940
1038
  for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
941
- if (properties[keys[i]] != null)
1039
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
942
1040
  this[keys[i]] = properties[keys[i]];
943
1041
  }
944
1042
 
@@ -979,13 +1077,17 @@ $root.proteus = (function() {
979
1077
  * @param {$protobuf.Writer} [writer] Writer to encode to
980
1078
  * @returns {$protobuf.Writer} Writer
981
1079
  */
982
- UserEntry.encode = function encode(message, writer) {
1080
+ UserEntry.encode = function encode(message, writer, q) {
983
1081
  if (!writer)
984
1082
  writer = $Writer.create();
985
- $root.proteus.UserId.encode(message.user, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
1083
+ if (q === undefined)
1084
+ q = 0;
1085
+ if (q > $util.recursionLimit)
1086
+ throw Error("max depth exceeded");
1087
+ $root.proteus.UserId.encode(message.user, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim();
986
1088
  if (message.clients != null && message.clients.length)
987
1089
  for (var i = 0; i < message.clients.length; ++i)
988
- $root.proteus.ClientEntry.encode(message.clients[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
1090
+ $root.proteus.ClientEntry.encode(message.clients[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim();
989
1091
  return writer;
990
1092
  };
991
1093
 
@@ -1013,29 +1115,35 @@ $root.proteus = (function() {
1013
1115
  * @throws {Error} If the payload is not a reader or valid buffer
1014
1116
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
1015
1117
  */
1016
- UserEntry.decode = function decode(reader, length) {
1118
+ UserEntry.decode = function decode(reader, length, error, long) {
1017
1119
  if (!(reader instanceof $Reader))
1018
1120
  reader = $Reader.create(reader);
1121
+ if (long === undefined)
1122
+ long = 0;
1123
+ if (long > $Reader.recursionLimit)
1124
+ throw Error("maximum nesting depth exceeded");
1019
1125
  var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proteus.UserEntry();
1020
1126
  while (reader.pos < end) {
1021
1127
  var tag = reader.uint32();
1128
+ if (tag === error)
1129
+ break;
1022
1130
  switch (tag >>> 3) {
1023
1131
  case 1: {
1024
- message.user = $root.proteus.UserId.decode(reader, reader.uint32());
1132
+ message.user = $root.proteus.UserId.decode(reader, reader.uint32(), undefined, long + 1);
1025
1133
  break;
1026
1134
  }
1027
1135
  case 2: {
1028
1136
  if (!(message.clients && message.clients.length))
1029
1137
  message.clients = [];
1030
- message.clients.push($root.proteus.ClientEntry.decode(reader, reader.uint32()));
1138
+ message.clients.push($root.proteus.ClientEntry.decode(reader, reader.uint32(), undefined, long + 1));
1031
1139
  break;
1032
1140
  }
1033
1141
  default:
1034
- reader.skipType(tag & 7);
1142
+ reader.skipType(tag & 7, long);
1035
1143
  break;
1036
1144
  }
1037
1145
  }
1038
- if (!message.hasOwnProperty("user"))
1146
+ if (!Object.hasOwnProperty.call(message, "user"))
1039
1147
  throw $util.ProtocolError("missing required 'user'", { instance: message });
1040
1148
  return message;
1041
1149
  };
@@ -1064,19 +1172,23 @@ $root.proteus = (function() {
1064
1172
  * @param {Object.<string,*>} message Plain object to verify
1065
1173
  * @returns {string|null} `null` if valid, otherwise the reason why it is not
1066
1174
  */
1067
- UserEntry.verify = function verify(message) {
1175
+ UserEntry.verify = function verify(message, long) {
1068
1176
  if (typeof message !== "object" || message === null)
1069
1177
  return "object expected";
1178
+ if (long === undefined)
1179
+ long = 0;
1180
+ if (long > $util.recursionLimit)
1181
+ return "maximum nesting depth exceeded";
1070
1182
  {
1071
- var error = $root.proteus.UserId.verify(message.user);
1183
+ var error = $root.proteus.UserId.verify(message.user, long + 1);
1072
1184
  if (error)
1073
1185
  return "user." + error;
1074
1186
  }
1075
- if (message.clients != null && message.hasOwnProperty("clients")) {
1187
+ if (message.clients != null && Object.hasOwnProperty.call(message, "clients")) {
1076
1188
  if (!Array.isArray(message.clients))
1077
1189
  return "clients: array expected";
1078
1190
  for (var i = 0; i < message.clients.length; ++i) {
1079
- var error = $root.proteus.ClientEntry.verify(message.clients[i]);
1191
+ var error = $root.proteus.ClientEntry.verify(message.clients[i], long + 1);
1080
1192
  if (error)
1081
1193
  return "clients." + error;
1082
1194
  }
@@ -1092,23 +1204,29 @@ $root.proteus = (function() {
1092
1204
  * @param {Object.<string,*>} object Plain object
1093
1205
  * @returns {proteus.UserEntry} UserEntry
1094
1206
  */
1095
- UserEntry.fromObject = function fromObject(object) {
1207
+ UserEntry.fromObject = function fromObject(object, long) {
1096
1208
  if (object instanceof $root.proteus.UserEntry)
1097
1209
  return object;
1210
+ if (!$util.isObject(object))
1211
+ throw TypeError(".proteus.UserEntry: object expected");
1212
+ if (long === undefined)
1213
+ long = 0;
1214
+ if (long > $util.recursionLimit)
1215
+ throw Error("maximum nesting depth exceeded");
1098
1216
  var message = new $root.proteus.UserEntry();
1099
1217
  if (object.user != null) {
1100
- if (typeof object.user !== "object")
1218
+ if (!$util.isObject(object.user))
1101
1219
  throw TypeError(".proteus.UserEntry.user: object expected");
1102
- message.user = $root.proteus.UserId.fromObject(object.user);
1220
+ message.user = $root.proteus.UserId.fromObject(object.user, long + 1);
1103
1221
  }
1104
1222
  if (object.clients) {
1105
1223
  if (!Array.isArray(object.clients))
1106
1224
  throw TypeError(".proteus.UserEntry.clients: array expected");
1107
1225
  message.clients = [];
1108
1226
  for (var i = 0; i < object.clients.length; ++i) {
1109
- if (typeof object.clients[i] !== "object")
1227
+ if (!$util.isObject(object.clients[i]))
1110
1228
  throw TypeError(".proteus.UserEntry.clients: object expected");
1111
- message.clients[i] = $root.proteus.ClientEntry.fromObject(object.clients[i]);
1229
+ message.clients[i] = $root.proteus.ClientEntry.fromObject(object.clients[i], long + 1);
1112
1230
  }
1113
1231
  }
1114
1232
  return message;
@@ -1123,20 +1241,24 @@ $root.proteus = (function() {
1123
1241
  * @param {$protobuf.IConversionOptions} [options] Conversion options
1124
1242
  * @returns {Object.<string,*>} Plain object
1125
1243
  */
1126
- UserEntry.toObject = function toObject(message, options) {
1244
+ UserEntry.toObject = function toObject(message, options, q) {
1127
1245
  if (!options)
1128
1246
  options = {};
1247
+ if (q === undefined)
1248
+ q = 0;
1249
+ if (q > $util.recursionLimit)
1250
+ throw Error("max depth exceeded");
1129
1251
  var object = {};
1130
1252
  if (options.arrays || options.defaults)
1131
1253
  object.clients = [];
1132
1254
  if (options.defaults)
1133
1255
  object.user = null;
1134
- if (message.user != null && message.hasOwnProperty("user"))
1135
- object.user = $root.proteus.UserId.toObject(message.user, options);
1256
+ if (message.user != null && Object.hasOwnProperty.call(message, "user"))
1257
+ object.user = $root.proteus.UserId.toObject(message.user, options, q + 1);
1136
1258
  if (message.clients && message.clients.length) {
1137
1259
  object.clients = [];
1138
1260
  for (var j = 0; j < message.clients.length; ++j)
1139
- object.clients[j] = $root.proteus.ClientEntry.toObject(message.clients[j], options);
1261
+ object.clients[j] = $root.proteus.ClientEntry.toObject(message.clients[j], options, q + 1);
1140
1262
  }
1141
1263
  return object;
1142
1264
  };
@@ -1192,7 +1314,7 @@ $root.proteus = (function() {
1192
1314
  this.entries = [];
1193
1315
  if (properties)
1194
1316
  for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1195
- if (properties[keys[i]] != null)
1317
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
1196
1318
  this[keys[i]] = properties[keys[i]];
1197
1319
  }
1198
1320
 
@@ -1233,13 +1355,17 @@ $root.proteus = (function() {
1233
1355
  * @param {$protobuf.Writer} [writer] Writer to encode to
1234
1356
  * @returns {$protobuf.Writer} Writer
1235
1357
  */
1236
- QualifiedUserEntry.encode = function encode(message, writer) {
1358
+ QualifiedUserEntry.encode = function encode(message, writer, q) {
1237
1359
  if (!writer)
1238
1360
  writer = $Writer.create();
1361
+ if (q === undefined)
1362
+ q = 0;
1363
+ if (q > $util.recursionLimit)
1364
+ throw Error("max depth exceeded");
1239
1365
  writer.uint32(/* id 1, wireType 2 =*/10).string(message.domain);
1240
1366
  if (message.entries != null && message.entries.length)
1241
1367
  for (var i = 0; i < message.entries.length; ++i)
1242
- $root.proteus.UserEntry.encode(message.entries[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
1368
+ $root.proteus.UserEntry.encode(message.entries[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim();
1243
1369
  return writer;
1244
1370
  };
1245
1371
 
@@ -1267,12 +1393,18 @@ $root.proteus = (function() {
1267
1393
  * @throws {Error} If the payload is not a reader or valid buffer
1268
1394
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
1269
1395
  */
1270
- QualifiedUserEntry.decode = function decode(reader, length) {
1396
+ QualifiedUserEntry.decode = function decode(reader, length, error, long) {
1271
1397
  if (!(reader instanceof $Reader))
1272
1398
  reader = $Reader.create(reader);
1399
+ if (long === undefined)
1400
+ long = 0;
1401
+ if (long > $Reader.recursionLimit)
1402
+ throw Error("maximum nesting depth exceeded");
1273
1403
  var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proteus.QualifiedUserEntry();
1274
1404
  while (reader.pos < end) {
1275
1405
  var tag = reader.uint32();
1406
+ if (tag === error)
1407
+ break;
1276
1408
  switch (tag >>> 3) {
1277
1409
  case 1: {
1278
1410
  message.domain = reader.string();
@@ -1281,15 +1413,15 @@ $root.proteus = (function() {
1281
1413
  case 2: {
1282
1414
  if (!(message.entries && message.entries.length))
1283
1415
  message.entries = [];
1284
- message.entries.push($root.proteus.UserEntry.decode(reader, reader.uint32()));
1416
+ message.entries.push($root.proteus.UserEntry.decode(reader, reader.uint32(), undefined, long + 1));
1285
1417
  break;
1286
1418
  }
1287
1419
  default:
1288
- reader.skipType(tag & 7);
1420
+ reader.skipType(tag & 7, long);
1289
1421
  break;
1290
1422
  }
1291
1423
  }
1292
- if (!message.hasOwnProperty("domain"))
1424
+ if (!Object.hasOwnProperty.call(message, "domain"))
1293
1425
  throw $util.ProtocolError("missing required 'domain'", { instance: message });
1294
1426
  return message;
1295
1427
  };
@@ -1318,16 +1450,20 @@ $root.proteus = (function() {
1318
1450
  * @param {Object.<string,*>} message Plain object to verify
1319
1451
  * @returns {string|null} `null` if valid, otherwise the reason why it is not
1320
1452
  */
1321
- QualifiedUserEntry.verify = function verify(message) {
1453
+ QualifiedUserEntry.verify = function verify(message, long) {
1322
1454
  if (typeof message !== "object" || message === null)
1323
1455
  return "object expected";
1456
+ if (long === undefined)
1457
+ long = 0;
1458
+ if (long > $util.recursionLimit)
1459
+ return "maximum nesting depth exceeded";
1324
1460
  if (!$util.isString(message.domain))
1325
1461
  return "domain: string expected";
1326
- if (message.entries != null && message.hasOwnProperty("entries")) {
1462
+ if (message.entries != null && Object.hasOwnProperty.call(message, "entries")) {
1327
1463
  if (!Array.isArray(message.entries))
1328
1464
  return "entries: array expected";
1329
1465
  for (var i = 0; i < message.entries.length; ++i) {
1330
- var error = $root.proteus.UserEntry.verify(message.entries[i]);
1466
+ var error = $root.proteus.UserEntry.verify(message.entries[i], long + 1);
1331
1467
  if (error)
1332
1468
  return "entries." + error;
1333
1469
  }
@@ -1343,9 +1479,15 @@ $root.proteus = (function() {
1343
1479
  * @param {Object.<string,*>} object Plain object
1344
1480
  * @returns {proteus.QualifiedUserEntry} QualifiedUserEntry
1345
1481
  */
1346
- QualifiedUserEntry.fromObject = function fromObject(object) {
1482
+ QualifiedUserEntry.fromObject = function fromObject(object, long) {
1347
1483
  if (object instanceof $root.proteus.QualifiedUserEntry)
1348
1484
  return object;
1485
+ if (!$util.isObject(object))
1486
+ throw TypeError(".proteus.QualifiedUserEntry: object expected");
1487
+ if (long === undefined)
1488
+ long = 0;
1489
+ if (long > $util.recursionLimit)
1490
+ throw Error("maximum nesting depth exceeded");
1349
1491
  var message = new $root.proteus.QualifiedUserEntry();
1350
1492
  if (object.domain != null)
1351
1493
  message.domain = String(object.domain);
@@ -1354,9 +1496,9 @@ $root.proteus = (function() {
1354
1496
  throw TypeError(".proteus.QualifiedUserEntry.entries: array expected");
1355
1497
  message.entries = [];
1356
1498
  for (var i = 0; i < object.entries.length; ++i) {
1357
- if (typeof object.entries[i] !== "object")
1499
+ if (!$util.isObject(object.entries[i]))
1358
1500
  throw TypeError(".proteus.QualifiedUserEntry.entries: object expected");
1359
- message.entries[i] = $root.proteus.UserEntry.fromObject(object.entries[i]);
1501
+ message.entries[i] = $root.proteus.UserEntry.fromObject(object.entries[i], long + 1);
1360
1502
  }
1361
1503
  }
1362
1504
  return message;
@@ -1371,20 +1513,24 @@ $root.proteus = (function() {
1371
1513
  * @param {$protobuf.IConversionOptions} [options] Conversion options
1372
1514
  * @returns {Object.<string,*>} Plain object
1373
1515
  */
1374
- QualifiedUserEntry.toObject = function toObject(message, options) {
1516
+ QualifiedUserEntry.toObject = function toObject(message, options, q) {
1375
1517
  if (!options)
1376
1518
  options = {};
1519
+ if (q === undefined)
1520
+ q = 0;
1521
+ if (q > $util.recursionLimit)
1522
+ throw Error("max depth exceeded");
1377
1523
  var object = {};
1378
1524
  if (options.arrays || options.defaults)
1379
1525
  object.entries = [];
1380
1526
  if (options.defaults)
1381
1527
  object.domain = "";
1382
- if (message.domain != null && message.hasOwnProperty("domain"))
1528
+ if (message.domain != null && Object.hasOwnProperty.call(message, "domain"))
1383
1529
  object.domain = message.domain;
1384
1530
  if (message.entries && message.entries.length) {
1385
1531
  object.entries = [];
1386
1532
  for (var j = 0; j < message.entries.length; ++j)
1387
- object.entries[j] = $root.proteus.UserEntry.toObject(message.entries[j], options);
1533
+ object.entries[j] = $root.proteus.UserEntry.toObject(message.entries[j], options, q + 1);
1388
1534
  }
1389
1535
  return object;
1390
1536
  };
@@ -1460,7 +1606,7 @@ $root.proteus = (function() {
1460
1606
  this.reportMissing = [];
1461
1607
  if (properties)
1462
1608
  for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1463
- if (properties[keys[i]] != null)
1609
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
1464
1610
  this[keys[i]] = properties[keys[i]];
1465
1611
  }
1466
1612
 
@@ -1541,13 +1687,17 @@ $root.proteus = (function() {
1541
1687
  * @param {$protobuf.Writer} [writer] Writer to encode to
1542
1688
  * @returns {$protobuf.Writer} Writer
1543
1689
  */
1544
- NewOtrMessage.encode = function encode(message, writer) {
1690
+ NewOtrMessage.encode = function encode(message, writer, q) {
1545
1691
  if (!writer)
1546
1692
  writer = $Writer.create();
1547
- $root.proteus.ClientId.encode(message.sender, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
1693
+ if (q === undefined)
1694
+ q = 0;
1695
+ if (q > $util.recursionLimit)
1696
+ throw Error("max depth exceeded");
1697
+ $root.proteus.ClientId.encode(message.sender, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim();
1548
1698
  if (message.recipients != null && message.recipients.length)
1549
1699
  for (var i = 0; i < message.recipients.length; ++i)
1550
- $root.proteus.UserEntry.encode(message.recipients[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
1700
+ $root.proteus.UserEntry.encode(message.recipients[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim();
1551
1701
  if (message.nativePush != null && Object.hasOwnProperty.call(message, "nativePush"))
1552
1702
  writer.uint32(/* id 3, wireType 0 =*/24).bool(message.nativePush);
1553
1703
  if (message.blob != null && Object.hasOwnProperty.call(message, "blob"))
@@ -1558,7 +1708,7 @@ $root.proteus = (function() {
1558
1708
  writer.uint32(/* id 6, wireType 0 =*/48).bool(message.transient);
1559
1709
  if (message.reportMissing != null && message.reportMissing.length)
1560
1710
  for (var i = 0; i < message.reportMissing.length; ++i)
1561
- $root.proteus.UserId.encode(message.reportMissing[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
1711
+ $root.proteus.UserId.encode(message.reportMissing[i], writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim();
1562
1712
  return writer;
1563
1713
  };
1564
1714
 
@@ -1586,21 +1736,27 @@ $root.proteus = (function() {
1586
1736
  * @throws {Error} If the payload is not a reader or valid buffer
1587
1737
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
1588
1738
  */
1589
- NewOtrMessage.decode = function decode(reader, length) {
1739
+ NewOtrMessage.decode = function decode(reader, length, error, long) {
1590
1740
  if (!(reader instanceof $Reader))
1591
1741
  reader = $Reader.create(reader);
1742
+ if (long === undefined)
1743
+ long = 0;
1744
+ if (long > $Reader.recursionLimit)
1745
+ throw Error("maximum nesting depth exceeded");
1592
1746
  var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proteus.NewOtrMessage();
1593
1747
  while (reader.pos < end) {
1594
1748
  var tag = reader.uint32();
1749
+ if (tag === error)
1750
+ break;
1595
1751
  switch (tag >>> 3) {
1596
1752
  case 1: {
1597
- message.sender = $root.proteus.ClientId.decode(reader, reader.uint32());
1753
+ message.sender = $root.proteus.ClientId.decode(reader, reader.uint32(), undefined, long + 1);
1598
1754
  break;
1599
1755
  }
1600
1756
  case 2: {
1601
1757
  if (!(message.recipients && message.recipients.length))
1602
1758
  message.recipients = [];
1603
- message.recipients.push($root.proteus.UserEntry.decode(reader, reader.uint32()));
1759
+ message.recipients.push($root.proteus.UserEntry.decode(reader, reader.uint32(), undefined, long + 1));
1604
1760
  break;
1605
1761
  }
1606
1762
  case 3: {
@@ -1622,15 +1778,15 @@ $root.proteus = (function() {
1622
1778
  case 7: {
1623
1779
  if (!(message.reportMissing && message.reportMissing.length))
1624
1780
  message.reportMissing = [];
1625
- message.reportMissing.push($root.proteus.UserId.decode(reader, reader.uint32()));
1781
+ message.reportMissing.push($root.proteus.UserId.decode(reader, reader.uint32(), undefined, long + 1));
1626
1782
  break;
1627
1783
  }
1628
1784
  default:
1629
- reader.skipType(tag & 7);
1785
+ reader.skipType(tag & 7, long);
1630
1786
  break;
1631
1787
  }
1632
1788
  }
1633
- if (!message.hasOwnProperty("sender"))
1789
+ if (!Object.hasOwnProperty.call(message, "sender"))
1634
1790
  throw $util.ProtocolError("missing required 'sender'", { instance: message });
1635
1791
  return message;
1636
1792
  };
@@ -1659,30 +1815,34 @@ $root.proteus = (function() {
1659
1815
  * @param {Object.<string,*>} message Plain object to verify
1660
1816
  * @returns {string|null} `null` if valid, otherwise the reason why it is not
1661
1817
  */
1662
- NewOtrMessage.verify = function verify(message) {
1818
+ NewOtrMessage.verify = function verify(message, long) {
1663
1819
  if (typeof message !== "object" || message === null)
1664
1820
  return "object expected";
1821
+ if (long === undefined)
1822
+ long = 0;
1823
+ if (long > $util.recursionLimit)
1824
+ return "maximum nesting depth exceeded";
1665
1825
  {
1666
- var error = $root.proteus.ClientId.verify(message.sender);
1826
+ var error = $root.proteus.ClientId.verify(message.sender, long + 1);
1667
1827
  if (error)
1668
1828
  return "sender." + error;
1669
1829
  }
1670
- if (message.recipients != null && message.hasOwnProperty("recipients")) {
1830
+ if (message.recipients != null && Object.hasOwnProperty.call(message, "recipients")) {
1671
1831
  if (!Array.isArray(message.recipients))
1672
1832
  return "recipients: array expected";
1673
1833
  for (var i = 0; i < message.recipients.length; ++i) {
1674
- var error = $root.proteus.UserEntry.verify(message.recipients[i]);
1834
+ var error = $root.proteus.UserEntry.verify(message.recipients[i], long + 1);
1675
1835
  if (error)
1676
1836
  return "recipients." + error;
1677
1837
  }
1678
1838
  }
1679
- if (message.nativePush != null && message.hasOwnProperty("nativePush"))
1839
+ if (message.nativePush != null && Object.hasOwnProperty.call(message, "nativePush"))
1680
1840
  if (typeof message.nativePush !== "boolean")
1681
1841
  return "nativePush: boolean expected";
1682
- if (message.blob != null && message.hasOwnProperty("blob"))
1842
+ if (message.blob != null && Object.hasOwnProperty.call(message, "blob"))
1683
1843
  if (!(message.blob && typeof message.blob.length === "number" || $util.isString(message.blob)))
1684
1844
  return "blob: buffer expected";
1685
- if (message.nativePriority != null && message.hasOwnProperty("nativePriority"))
1845
+ if (message.nativePriority != null && Object.hasOwnProperty.call(message, "nativePriority"))
1686
1846
  switch (message.nativePriority) {
1687
1847
  default:
1688
1848
  return "nativePriority: enum value expected";
@@ -1690,14 +1850,14 @@ $root.proteus = (function() {
1690
1850
  case 2:
1691
1851
  break;
1692
1852
  }
1693
- if (message.transient != null && message.hasOwnProperty("transient"))
1853
+ if (message.transient != null && Object.hasOwnProperty.call(message, "transient"))
1694
1854
  if (typeof message.transient !== "boolean")
1695
1855
  return "transient: boolean expected";
1696
- if (message.reportMissing != null && message.hasOwnProperty("reportMissing")) {
1856
+ if (message.reportMissing != null && Object.hasOwnProperty.call(message, "reportMissing")) {
1697
1857
  if (!Array.isArray(message.reportMissing))
1698
1858
  return "reportMissing: array expected";
1699
1859
  for (var i = 0; i < message.reportMissing.length; ++i) {
1700
- var error = $root.proteus.UserId.verify(message.reportMissing[i]);
1860
+ var error = $root.proteus.UserId.verify(message.reportMissing[i], long + 1);
1701
1861
  if (error)
1702
1862
  return "reportMissing." + error;
1703
1863
  }
@@ -1713,23 +1873,29 @@ $root.proteus = (function() {
1713
1873
  * @param {Object.<string,*>} object Plain object
1714
1874
  * @returns {proteus.NewOtrMessage} NewOtrMessage
1715
1875
  */
1716
- NewOtrMessage.fromObject = function fromObject(object) {
1876
+ NewOtrMessage.fromObject = function fromObject(object, long) {
1717
1877
  if (object instanceof $root.proteus.NewOtrMessage)
1718
1878
  return object;
1879
+ if (!$util.isObject(object))
1880
+ throw TypeError(".proteus.NewOtrMessage: object expected");
1881
+ if (long === undefined)
1882
+ long = 0;
1883
+ if (long > $util.recursionLimit)
1884
+ throw Error("maximum nesting depth exceeded");
1719
1885
  var message = new $root.proteus.NewOtrMessage();
1720
1886
  if (object.sender != null) {
1721
- if (typeof object.sender !== "object")
1887
+ if (!$util.isObject(object.sender))
1722
1888
  throw TypeError(".proteus.NewOtrMessage.sender: object expected");
1723
- message.sender = $root.proteus.ClientId.fromObject(object.sender);
1889
+ message.sender = $root.proteus.ClientId.fromObject(object.sender, long + 1);
1724
1890
  }
1725
1891
  if (object.recipients) {
1726
1892
  if (!Array.isArray(object.recipients))
1727
1893
  throw TypeError(".proteus.NewOtrMessage.recipients: array expected");
1728
1894
  message.recipients = [];
1729
1895
  for (var i = 0; i < object.recipients.length; ++i) {
1730
- if (typeof object.recipients[i] !== "object")
1896
+ if (!$util.isObject(object.recipients[i]))
1731
1897
  throw TypeError(".proteus.NewOtrMessage.recipients: object expected");
1732
- message.recipients[i] = $root.proteus.UserEntry.fromObject(object.recipients[i]);
1898
+ message.recipients[i] = $root.proteus.UserEntry.fromObject(object.recipients[i], long + 1);
1733
1899
  }
1734
1900
  }
1735
1901
  if (object.nativePush != null)
@@ -1762,9 +1928,9 @@ $root.proteus = (function() {
1762
1928
  throw TypeError(".proteus.NewOtrMessage.reportMissing: array expected");
1763
1929
  message.reportMissing = [];
1764
1930
  for (var i = 0; i < object.reportMissing.length; ++i) {
1765
- if (typeof object.reportMissing[i] !== "object")
1931
+ if (!$util.isObject(object.reportMissing[i]))
1766
1932
  throw TypeError(".proteus.NewOtrMessage.reportMissing: object expected");
1767
- message.reportMissing[i] = $root.proteus.UserId.fromObject(object.reportMissing[i]);
1933
+ message.reportMissing[i] = $root.proteus.UserId.fromObject(object.reportMissing[i], long + 1);
1768
1934
  }
1769
1935
  }
1770
1936
  return message;
@@ -1779,9 +1945,13 @@ $root.proteus = (function() {
1779
1945
  * @param {$protobuf.IConversionOptions} [options] Conversion options
1780
1946
  * @returns {Object.<string,*>} Plain object
1781
1947
  */
1782
- NewOtrMessage.toObject = function toObject(message, options) {
1948
+ NewOtrMessage.toObject = function toObject(message, options, q) {
1783
1949
  if (!options)
1784
1950
  options = {};
1951
+ if (q === undefined)
1952
+ q = 0;
1953
+ if (q > $util.recursionLimit)
1954
+ throw Error("max depth exceeded");
1785
1955
  var object = {};
1786
1956
  if (options.arrays || options.defaults) {
1787
1957
  object.recipients = [];
@@ -1800,25 +1970,25 @@ $root.proteus = (function() {
1800
1970
  object.nativePriority = options.enums === String ? "LOW_PRIORITY" : 1;
1801
1971
  object.transient = false;
1802
1972
  }
1803
- if (message.sender != null && message.hasOwnProperty("sender"))
1804
- object.sender = $root.proteus.ClientId.toObject(message.sender, options);
1973
+ if (message.sender != null && Object.hasOwnProperty.call(message, "sender"))
1974
+ object.sender = $root.proteus.ClientId.toObject(message.sender, options, q + 1);
1805
1975
  if (message.recipients && message.recipients.length) {
1806
1976
  object.recipients = [];
1807
1977
  for (var j = 0; j < message.recipients.length; ++j)
1808
- object.recipients[j] = $root.proteus.UserEntry.toObject(message.recipients[j], options);
1978
+ object.recipients[j] = $root.proteus.UserEntry.toObject(message.recipients[j], options, q + 1);
1809
1979
  }
1810
- if (message.nativePush != null && message.hasOwnProperty("nativePush"))
1980
+ if (message.nativePush != null && Object.hasOwnProperty.call(message, "nativePush"))
1811
1981
  object.nativePush = message.nativePush;
1812
- if (message.blob != null && message.hasOwnProperty("blob"))
1982
+ if (message.blob != null && Object.hasOwnProperty.call(message, "blob"))
1813
1983
  object.blob = options.bytes === String ? $util.base64.encode(message.blob, 0, message.blob.length) : options.bytes === Array ? Array.prototype.slice.call(message.blob) : message.blob;
1814
- if (message.nativePriority != null && message.hasOwnProperty("nativePriority"))
1984
+ if (message.nativePriority != null && Object.hasOwnProperty.call(message, "nativePriority"))
1815
1985
  object.nativePriority = options.enums === String ? $root.proteus.Priority[message.nativePriority] === undefined ? message.nativePriority : $root.proteus.Priority[message.nativePriority] : message.nativePriority;
1816
- if (message.transient != null && message.hasOwnProperty("transient"))
1986
+ if (message.transient != null && Object.hasOwnProperty.call(message, "transient"))
1817
1987
  object.transient = message.transient;
1818
1988
  if (message.reportMissing && message.reportMissing.length) {
1819
1989
  object.reportMissing = [];
1820
1990
  for (var j = 0; j < message.reportMissing.length; ++j)
1821
- object.reportMissing[j] = $root.proteus.UserId.toObject(message.reportMissing[j], options);
1991
+ object.reportMissing[j] = $root.proteus.UserId.toObject(message.reportMissing[j], options, q + 1);
1822
1992
  }
1823
1993
  return object;
1824
1994
  };
@@ -1882,7 +2052,7 @@ $root.proteus = (function() {
1882
2052
  this.recipients = [];
1883
2053
  if (properties)
1884
2054
  for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1885
- if (properties[keys[i]] != null)
2055
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
1886
2056
  this[keys[i]] = properties[keys[i]];
1887
2057
  }
1888
2058
 
@@ -2001,13 +2171,17 @@ $root.proteus = (function() {
2001
2171
  * @param {$protobuf.Writer} [writer] Writer to encode to
2002
2172
  * @returns {$protobuf.Writer} Writer
2003
2173
  */
2004
- QualifiedNewOtrMessage.encode = function encode(message, writer) {
2174
+ QualifiedNewOtrMessage.encode = function encode(message, writer, q) {
2005
2175
  if (!writer)
2006
2176
  writer = $Writer.create();
2007
- $root.proteus.ClientId.encode(message.sender, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
2177
+ if (q === undefined)
2178
+ q = 0;
2179
+ if (q > $util.recursionLimit)
2180
+ throw Error("max depth exceeded");
2181
+ $root.proteus.ClientId.encode(message.sender, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim();
2008
2182
  if (message.recipients != null && message.recipients.length)
2009
2183
  for (var i = 0; i < message.recipients.length; ++i)
2010
- $root.proteus.QualifiedUserEntry.encode(message.recipients[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
2184
+ $root.proteus.QualifiedUserEntry.encode(message.recipients[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim();
2011
2185
  if (message.nativePush != null && Object.hasOwnProperty.call(message, "nativePush"))
2012
2186
  writer.uint32(/* id 3, wireType 0 =*/24).bool(message.nativePush);
2013
2187
  if (message.blob != null && Object.hasOwnProperty.call(message, "blob"))
@@ -2017,13 +2191,13 @@ $root.proteus = (function() {
2017
2191
  if (message.transient != null && Object.hasOwnProperty.call(message, "transient"))
2018
2192
  writer.uint32(/* id 6, wireType 0 =*/48).bool(message.transient);
2019
2193
  if (message.reportAll != null && Object.hasOwnProperty.call(message, "reportAll"))
2020
- $root.proteus.ClientMismatchStrategy.ReportAll.encode(message.reportAll, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
2194
+ $root.proteus.ClientMismatchStrategy.ReportAll.encode(message.reportAll, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim();
2021
2195
  if (message.ignoreAll != null && Object.hasOwnProperty.call(message, "ignoreAll"))
2022
- $root.proteus.ClientMismatchStrategy.IgnoreAll.encode(message.ignoreAll, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
2196
+ $root.proteus.ClientMismatchStrategy.IgnoreAll.encode(message.ignoreAll, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim();
2023
2197
  if (message.reportOnly != null && Object.hasOwnProperty.call(message, "reportOnly"))
2024
- $root.proteus.ClientMismatchStrategy.ReportOnly.encode(message.reportOnly, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
2198
+ $root.proteus.ClientMismatchStrategy.ReportOnly.encode(message.reportOnly, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim();
2025
2199
  if (message.ignoreOnly != null && Object.hasOwnProperty.call(message, "ignoreOnly"))
2026
- $root.proteus.ClientMismatchStrategy.IgnoreOnly.encode(message.ignoreOnly, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
2200
+ $root.proteus.ClientMismatchStrategy.IgnoreOnly.encode(message.ignoreOnly, writer.uint32(/* id 10, wireType 2 =*/82).fork(), q + 1).ldelim();
2027
2201
  return writer;
2028
2202
  };
2029
2203
 
@@ -2051,21 +2225,27 @@ $root.proteus = (function() {
2051
2225
  * @throws {Error} If the payload is not a reader or valid buffer
2052
2226
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
2053
2227
  */
2054
- QualifiedNewOtrMessage.decode = function decode(reader, length) {
2228
+ QualifiedNewOtrMessage.decode = function decode(reader, length, error, long) {
2055
2229
  if (!(reader instanceof $Reader))
2056
2230
  reader = $Reader.create(reader);
2231
+ if (long === undefined)
2232
+ long = 0;
2233
+ if (long > $Reader.recursionLimit)
2234
+ throw Error("maximum nesting depth exceeded");
2057
2235
  var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proteus.QualifiedNewOtrMessage();
2058
2236
  while (reader.pos < end) {
2059
2237
  var tag = reader.uint32();
2238
+ if (tag === error)
2239
+ break;
2060
2240
  switch (tag >>> 3) {
2061
2241
  case 1: {
2062
- message.sender = $root.proteus.ClientId.decode(reader, reader.uint32());
2242
+ message.sender = $root.proteus.ClientId.decode(reader, reader.uint32(), undefined, long + 1);
2063
2243
  break;
2064
2244
  }
2065
2245
  case 2: {
2066
2246
  if (!(message.recipients && message.recipients.length))
2067
2247
  message.recipients = [];
2068
- message.recipients.push($root.proteus.QualifiedUserEntry.decode(reader, reader.uint32()));
2248
+ message.recipients.push($root.proteus.QualifiedUserEntry.decode(reader, reader.uint32(), undefined, long + 1));
2069
2249
  break;
2070
2250
  }
2071
2251
  case 3: {
@@ -2085,27 +2265,27 @@ $root.proteus = (function() {
2085
2265
  break;
2086
2266
  }
2087
2267
  case 7: {
2088
- message.reportAll = $root.proteus.ClientMismatchStrategy.ReportAll.decode(reader, reader.uint32());
2268
+ message.reportAll = $root.proteus.ClientMismatchStrategy.ReportAll.decode(reader, reader.uint32(), undefined, long + 1);
2089
2269
  break;
2090
2270
  }
2091
2271
  case 8: {
2092
- message.ignoreAll = $root.proteus.ClientMismatchStrategy.IgnoreAll.decode(reader, reader.uint32());
2272
+ message.ignoreAll = $root.proteus.ClientMismatchStrategy.IgnoreAll.decode(reader, reader.uint32(), undefined, long + 1);
2093
2273
  break;
2094
2274
  }
2095
2275
  case 9: {
2096
- message.reportOnly = $root.proteus.ClientMismatchStrategy.ReportOnly.decode(reader, reader.uint32());
2276
+ message.reportOnly = $root.proteus.ClientMismatchStrategy.ReportOnly.decode(reader, reader.uint32(), undefined, long + 1);
2097
2277
  break;
2098
2278
  }
2099
2279
  case 10: {
2100
- message.ignoreOnly = $root.proteus.ClientMismatchStrategy.IgnoreOnly.decode(reader, reader.uint32());
2280
+ message.ignoreOnly = $root.proteus.ClientMismatchStrategy.IgnoreOnly.decode(reader, reader.uint32(), undefined, long + 1);
2101
2281
  break;
2102
2282
  }
2103
2283
  default:
2104
- reader.skipType(tag & 7);
2284
+ reader.skipType(tag & 7, long);
2105
2285
  break;
2106
2286
  }
2107
2287
  }
2108
- if (!message.hasOwnProperty("sender"))
2288
+ if (!Object.hasOwnProperty.call(message, "sender"))
2109
2289
  throw $util.ProtocolError("missing required 'sender'", { instance: message });
2110
2290
  return message;
2111
2291
  };
@@ -2134,31 +2314,35 @@ $root.proteus = (function() {
2134
2314
  * @param {Object.<string,*>} message Plain object to verify
2135
2315
  * @returns {string|null} `null` if valid, otherwise the reason why it is not
2136
2316
  */
2137
- QualifiedNewOtrMessage.verify = function verify(message) {
2317
+ QualifiedNewOtrMessage.verify = function verify(message, long) {
2138
2318
  if (typeof message !== "object" || message === null)
2139
2319
  return "object expected";
2320
+ if (long === undefined)
2321
+ long = 0;
2322
+ if (long > $util.recursionLimit)
2323
+ return "maximum nesting depth exceeded";
2140
2324
  var properties = {};
2141
2325
  {
2142
- var error = $root.proteus.ClientId.verify(message.sender);
2326
+ var error = $root.proteus.ClientId.verify(message.sender, long + 1);
2143
2327
  if (error)
2144
2328
  return "sender." + error;
2145
2329
  }
2146
- if (message.recipients != null && message.hasOwnProperty("recipients")) {
2330
+ if (message.recipients != null && Object.hasOwnProperty.call(message, "recipients")) {
2147
2331
  if (!Array.isArray(message.recipients))
2148
2332
  return "recipients: array expected";
2149
2333
  for (var i = 0; i < message.recipients.length; ++i) {
2150
- var error = $root.proteus.QualifiedUserEntry.verify(message.recipients[i]);
2334
+ var error = $root.proteus.QualifiedUserEntry.verify(message.recipients[i], long + 1);
2151
2335
  if (error)
2152
2336
  return "recipients." + error;
2153
2337
  }
2154
2338
  }
2155
- if (message.nativePush != null && message.hasOwnProperty("nativePush"))
2339
+ if (message.nativePush != null && Object.hasOwnProperty.call(message, "nativePush"))
2156
2340
  if (typeof message.nativePush !== "boolean")
2157
2341
  return "nativePush: boolean expected";
2158
- if (message.blob != null && message.hasOwnProperty("blob"))
2342
+ if (message.blob != null && Object.hasOwnProperty.call(message, "blob"))
2159
2343
  if (!(message.blob && typeof message.blob.length === "number" || $util.isString(message.blob)))
2160
2344
  return "blob: buffer expected";
2161
- if (message.nativePriority != null && message.hasOwnProperty("nativePriority"))
2345
+ if (message.nativePriority != null && Object.hasOwnProperty.call(message, "nativePriority"))
2162
2346
  switch (message.nativePriority) {
2163
2347
  default:
2164
2348
  return "nativePriority: enum value expected";
@@ -2166,43 +2350,43 @@ $root.proteus = (function() {
2166
2350
  case 2:
2167
2351
  break;
2168
2352
  }
2169
- if (message.transient != null && message.hasOwnProperty("transient"))
2353
+ if (message.transient != null && Object.hasOwnProperty.call(message, "transient"))
2170
2354
  if (typeof message.transient !== "boolean")
2171
2355
  return "transient: boolean expected";
2172
- if (message.reportAll != null && message.hasOwnProperty("reportAll")) {
2356
+ if (message.reportAll != null && Object.hasOwnProperty.call(message, "reportAll")) {
2173
2357
  properties.clientMismatchStrategy = 1;
2174
2358
  {
2175
- var error = $root.proteus.ClientMismatchStrategy.ReportAll.verify(message.reportAll);
2359
+ var error = $root.proteus.ClientMismatchStrategy.ReportAll.verify(message.reportAll, long + 1);
2176
2360
  if (error)
2177
2361
  return "reportAll." + error;
2178
2362
  }
2179
2363
  }
2180
- if (message.ignoreAll != null && message.hasOwnProperty("ignoreAll")) {
2364
+ if (message.ignoreAll != null && Object.hasOwnProperty.call(message, "ignoreAll")) {
2181
2365
  if (properties.clientMismatchStrategy === 1)
2182
2366
  return "clientMismatchStrategy: multiple values";
2183
2367
  properties.clientMismatchStrategy = 1;
2184
2368
  {
2185
- var error = $root.proteus.ClientMismatchStrategy.IgnoreAll.verify(message.ignoreAll);
2369
+ var error = $root.proteus.ClientMismatchStrategy.IgnoreAll.verify(message.ignoreAll, long + 1);
2186
2370
  if (error)
2187
2371
  return "ignoreAll." + error;
2188
2372
  }
2189
2373
  }
2190
- if (message.reportOnly != null && message.hasOwnProperty("reportOnly")) {
2374
+ if (message.reportOnly != null && Object.hasOwnProperty.call(message, "reportOnly")) {
2191
2375
  if (properties.clientMismatchStrategy === 1)
2192
2376
  return "clientMismatchStrategy: multiple values";
2193
2377
  properties.clientMismatchStrategy = 1;
2194
2378
  {
2195
- var error = $root.proteus.ClientMismatchStrategy.ReportOnly.verify(message.reportOnly);
2379
+ var error = $root.proteus.ClientMismatchStrategy.ReportOnly.verify(message.reportOnly, long + 1);
2196
2380
  if (error)
2197
2381
  return "reportOnly." + error;
2198
2382
  }
2199
2383
  }
2200
- if (message.ignoreOnly != null && message.hasOwnProperty("ignoreOnly")) {
2384
+ if (message.ignoreOnly != null && Object.hasOwnProperty.call(message, "ignoreOnly")) {
2201
2385
  if (properties.clientMismatchStrategy === 1)
2202
2386
  return "clientMismatchStrategy: multiple values";
2203
2387
  properties.clientMismatchStrategy = 1;
2204
2388
  {
2205
- var error = $root.proteus.ClientMismatchStrategy.IgnoreOnly.verify(message.ignoreOnly);
2389
+ var error = $root.proteus.ClientMismatchStrategy.IgnoreOnly.verify(message.ignoreOnly, long + 1);
2206
2390
  if (error)
2207
2391
  return "ignoreOnly." + error;
2208
2392
  }
@@ -2218,23 +2402,29 @@ $root.proteus = (function() {
2218
2402
  * @param {Object.<string,*>} object Plain object
2219
2403
  * @returns {proteus.QualifiedNewOtrMessage} QualifiedNewOtrMessage
2220
2404
  */
2221
- QualifiedNewOtrMessage.fromObject = function fromObject(object) {
2405
+ QualifiedNewOtrMessage.fromObject = function fromObject(object, long) {
2222
2406
  if (object instanceof $root.proteus.QualifiedNewOtrMessage)
2223
2407
  return object;
2408
+ if (!$util.isObject(object))
2409
+ throw TypeError(".proteus.QualifiedNewOtrMessage: object expected");
2410
+ if (long === undefined)
2411
+ long = 0;
2412
+ if (long > $util.recursionLimit)
2413
+ throw Error("maximum nesting depth exceeded");
2224
2414
  var message = new $root.proteus.QualifiedNewOtrMessage();
2225
2415
  if (object.sender != null) {
2226
- if (typeof object.sender !== "object")
2416
+ if (!$util.isObject(object.sender))
2227
2417
  throw TypeError(".proteus.QualifiedNewOtrMessage.sender: object expected");
2228
- message.sender = $root.proteus.ClientId.fromObject(object.sender);
2418
+ message.sender = $root.proteus.ClientId.fromObject(object.sender, long + 1);
2229
2419
  }
2230
2420
  if (object.recipients) {
2231
2421
  if (!Array.isArray(object.recipients))
2232
2422
  throw TypeError(".proteus.QualifiedNewOtrMessage.recipients: array expected");
2233
2423
  message.recipients = [];
2234
2424
  for (var i = 0; i < object.recipients.length; ++i) {
2235
- if (typeof object.recipients[i] !== "object")
2425
+ if (!$util.isObject(object.recipients[i]))
2236
2426
  throw TypeError(".proteus.QualifiedNewOtrMessage.recipients: object expected");
2237
- message.recipients[i] = $root.proteus.QualifiedUserEntry.fromObject(object.recipients[i]);
2427
+ message.recipients[i] = $root.proteus.QualifiedUserEntry.fromObject(object.recipients[i], long + 1);
2238
2428
  }
2239
2429
  }
2240
2430
  if (object.nativePush != null)
@@ -2263,24 +2453,24 @@ $root.proteus = (function() {
2263
2453
  if (object.transient != null)
2264
2454
  message.transient = Boolean(object.transient);
2265
2455
  if (object.reportAll != null) {
2266
- if (typeof object.reportAll !== "object")
2456
+ if (!$util.isObject(object.reportAll))
2267
2457
  throw TypeError(".proteus.QualifiedNewOtrMessage.reportAll: object expected");
2268
- message.reportAll = $root.proteus.ClientMismatchStrategy.ReportAll.fromObject(object.reportAll);
2458
+ message.reportAll = $root.proteus.ClientMismatchStrategy.ReportAll.fromObject(object.reportAll, long + 1);
2269
2459
  }
2270
2460
  if (object.ignoreAll != null) {
2271
- if (typeof object.ignoreAll !== "object")
2461
+ if (!$util.isObject(object.ignoreAll))
2272
2462
  throw TypeError(".proteus.QualifiedNewOtrMessage.ignoreAll: object expected");
2273
- message.ignoreAll = $root.proteus.ClientMismatchStrategy.IgnoreAll.fromObject(object.ignoreAll);
2463
+ message.ignoreAll = $root.proteus.ClientMismatchStrategy.IgnoreAll.fromObject(object.ignoreAll, long + 1);
2274
2464
  }
2275
2465
  if (object.reportOnly != null) {
2276
- if (typeof object.reportOnly !== "object")
2466
+ if (!$util.isObject(object.reportOnly))
2277
2467
  throw TypeError(".proteus.QualifiedNewOtrMessage.reportOnly: object expected");
2278
- message.reportOnly = $root.proteus.ClientMismatchStrategy.ReportOnly.fromObject(object.reportOnly);
2468
+ message.reportOnly = $root.proteus.ClientMismatchStrategy.ReportOnly.fromObject(object.reportOnly, long + 1);
2279
2469
  }
2280
2470
  if (object.ignoreOnly != null) {
2281
- if (typeof object.ignoreOnly !== "object")
2471
+ if (!$util.isObject(object.ignoreOnly))
2282
2472
  throw TypeError(".proteus.QualifiedNewOtrMessage.ignoreOnly: object expected");
2283
- message.ignoreOnly = $root.proteus.ClientMismatchStrategy.IgnoreOnly.fromObject(object.ignoreOnly);
2473
+ message.ignoreOnly = $root.proteus.ClientMismatchStrategy.IgnoreOnly.fromObject(object.ignoreOnly, long + 1);
2284
2474
  }
2285
2475
  return message;
2286
2476
  };
@@ -2294,9 +2484,13 @@ $root.proteus = (function() {
2294
2484
  * @param {$protobuf.IConversionOptions} [options] Conversion options
2295
2485
  * @returns {Object.<string,*>} Plain object
2296
2486
  */
2297
- QualifiedNewOtrMessage.toObject = function toObject(message, options) {
2487
+ QualifiedNewOtrMessage.toObject = function toObject(message, options, q) {
2298
2488
  if (!options)
2299
2489
  options = {};
2490
+ if (q === undefined)
2491
+ q = 0;
2492
+ if (q > $util.recursionLimit)
2493
+ throw Error("max depth exceeded");
2300
2494
  var object = {};
2301
2495
  if (options.arrays || options.defaults)
2302
2496
  object.recipients = [];
@@ -2313,38 +2507,38 @@ $root.proteus = (function() {
2313
2507
  object.nativePriority = options.enums === String ? "LOW_PRIORITY" : 1;
2314
2508
  object.transient = false;
2315
2509
  }
2316
- if (message.sender != null && message.hasOwnProperty("sender"))
2317
- object.sender = $root.proteus.ClientId.toObject(message.sender, options);
2510
+ if (message.sender != null && Object.hasOwnProperty.call(message, "sender"))
2511
+ object.sender = $root.proteus.ClientId.toObject(message.sender, options, q + 1);
2318
2512
  if (message.recipients && message.recipients.length) {
2319
2513
  object.recipients = [];
2320
2514
  for (var j = 0; j < message.recipients.length; ++j)
2321
- object.recipients[j] = $root.proteus.QualifiedUserEntry.toObject(message.recipients[j], options);
2515
+ object.recipients[j] = $root.proteus.QualifiedUserEntry.toObject(message.recipients[j], options, q + 1);
2322
2516
  }
2323
- if (message.nativePush != null && message.hasOwnProperty("nativePush"))
2517
+ if (message.nativePush != null && Object.hasOwnProperty.call(message, "nativePush"))
2324
2518
  object.nativePush = message.nativePush;
2325
- if (message.blob != null && message.hasOwnProperty("blob"))
2519
+ if (message.blob != null && Object.hasOwnProperty.call(message, "blob"))
2326
2520
  object.blob = options.bytes === String ? $util.base64.encode(message.blob, 0, message.blob.length) : options.bytes === Array ? Array.prototype.slice.call(message.blob) : message.blob;
2327
- if (message.nativePriority != null && message.hasOwnProperty("nativePriority"))
2521
+ if (message.nativePriority != null && Object.hasOwnProperty.call(message, "nativePriority"))
2328
2522
  object.nativePriority = options.enums === String ? $root.proteus.Priority[message.nativePriority] === undefined ? message.nativePriority : $root.proteus.Priority[message.nativePriority] : message.nativePriority;
2329
- if (message.transient != null && message.hasOwnProperty("transient"))
2523
+ if (message.transient != null && Object.hasOwnProperty.call(message, "transient"))
2330
2524
  object.transient = message.transient;
2331
- if (message.reportAll != null && message.hasOwnProperty("reportAll")) {
2332
- object.reportAll = $root.proteus.ClientMismatchStrategy.ReportAll.toObject(message.reportAll, options);
2525
+ if (message.reportAll != null && Object.hasOwnProperty.call(message, "reportAll")) {
2526
+ object.reportAll = $root.proteus.ClientMismatchStrategy.ReportAll.toObject(message.reportAll, options, q + 1);
2333
2527
  if (options.oneofs)
2334
2528
  object.clientMismatchStrategy = "reportAll";
2335
2529
  }
2336
- if (message.ignoreAll != null && message.hasOwnProperty("ignoreAll")) {
2337
- object.ignoreAll = $root.proteus.ClientMismatchStrategy.IgnoreAll.toObject(message.ignoreAll, options);
2530
+ if (message.ignoreAll != null && Object.hasOwnProperty.call(message, "ignoreAll")) {
2531
+ object.ignoreAll = $root.proteus.ClientMismatchStrategy.IgnoreAll.toObject(message.ignoreAll, options, q + 1);
2338
2532
  if (options.oneofs)
2339
2533
  object.clientMismatchStrategy = "ignoreAll";
2340
2534
  }
2341
- if (message.reportOnly != null && message.hasOwnProperty("reportOnly")) {
2342
- object.reportOnly = $root.proteus.ClientMismatchStrategy.ReportOnly.toObject(message.reportOnly, options);
2535
+ if (message.reportOnly != null && Object.hasOwnProperty.call(message, "reportOnly")) {
2536
+ object.reportOnly = $root.proteus.ClientMismatchStrategy.ReportOnly.toObject(message.reportOnly, options, q + 1);
2343
2537
  if (options.oneofs)
2344
2538
  object.clientMismatchStrategy = "reportOnly";
2345
2539
  }
2346
- if (message.ignoreOnly != null && message.hasOwnProperty("ignoreOnly")) {
2347
- object.ignoreOnly = $root.proteus.ClientMismatchStrategy.IgnoreOnly.toObject(message.ignoreOnly, options);
2540
+ if (message.ignoreOnly != null && Object.hasOwnProperty.call(message, "ignoreOnly")) {
2541
+ object.ignoreOnly = $root.proteus.ClientMismatchStrategy.IgnoreOnly.toObject(message.ignoreOnly, options, q + 1);
2348
2542
  if (options.oneofs)
2349
2543
  object.clientMismatchStrategy = "ignoreOnly";
2350
2544
  }
@@ -2399,7 +2593,7 @@ $root.proteus = (function() {
2399
2593
  function ClientMismatchStrategy(properties) {
2400
2594
  if (properties)
2401
2595
  for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
2402
- if (properties[keys[i]] != null)
2596
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
2403
2597
  this[keys[i]] = properties[keys[i]];
2404
2598
  }
2405
2599
 
@@ -2424,9 +2618,13 @@ $root.proteus = (function() {
2424
2618
  * @param {$protobuf.Writer} [writer] Writer to encode to
2425
2619
  * @returns {$protobuf.Writer} Writer
2426
2620
  */
2427
- ClientMismatchStrategy.encode = function encode(message, writer) {
2621
+ ClientMismatchStrategy.encode = function encode(message, writer, q) {
2428
2622
  if (!writer)
2429
2623
  writer = $Writer.create();
2624
+ if (q === undefined)
2625
+ q = 0;
2626
+ if (q > $util.recursionLimit)
2627
+ throw Error("max depth exceeded");
2430
2628
  return writer;
2431
2629
  };
2432
2630
 
@@ -2454,15 +2652,21 @@ $root.proteus = (function() {
2454
2652
  * @throws {Error} If the payload is not a reader or valid buffer
2455
2653
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
2456
2654
  */
2457
- ClientMismatchStrategy.decode = function decode(reader, length) {
2655
+ ClientMismatchStrategy.decode = function decode(reader, length, error, long) {
2458
2656
  if (!(reader instanceof $Reader))
2459
2657
  reader = $Reader.create(reader);
2658
+ if (long === undefined)
2659
+ long = 0;
2660
+ if (long > $Reader.recursionLimit)
2661
+ throw Error("maximum nesting depth exceeded");
2460
2662
  var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proteus.ClientMismatchStrategy();
2461
2663
  while (reader.pos < end) {
2462
2664
  var tag = reader.uint32();
2665
+ if (tag === error)
2666
+ break;
2463
2667
  switch (tag >>> 3) {
2464
2668
  default:
2465
- reader.skipType(tag & 7);
2669
+ reader.skipType(tag & 7, long);
2466
2670
  break;
2467
2671
  }
2468
2672
  }
@@ -2493,9 +2697,13 @@ $root.proteus = (function() {
2493
2697
  * @param {Object.<string,*>} message Plain object to verify
2494
2698
  * @returns {string|null} `null` if valid, otherwise the reason why it is not
2495
2699
  */
2496
- ClientMismatchStrategy.verify = function verify(message) {
2700
+ ClientMismatchStrategy.verify = function verify(message, long) {
2497
2701
  if (typeof message !== "object" || message === null)
2498
2702
  return "object expected";
2703
+ if (long === undefined)
2704
+ long = 0;
2705
+ if (long > $util.recursionLimit)
2706
+ return "maximum nesting depth exceeded";
2499
2707
  return null;
2500
2708
  };
2501
2709
 
@@ -2507,7 +2715,7 @@ $root.proteus = (function() {
2507
2715
  * @param {Object.<string,*>} object Plain object
2508
2716
  * @returns {proteus.ClientMismatchStrategy} ClientMismatchStrategy
2509
2717
  */
2510
- ClientMismatchStrategy.fromObject = function fromObject(object) {
2718
+ ClientMismatchStrategy.fromObject = function fromObject(object, long) {
2511
2719
  if (object instanceof $root.proteus.ClientMismatchStrategy)
2512
2720
  return object;
2513
2721
  return new $root.proteus.ClientMismatchStrategy();
@@ -2571,7 +2779,7 @@ $root.proteus = (function() {
2571
2779
  function ReportAll(properties) {
2572
2780
  if (properties)
2573
2781
  for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
2574
- if (properties[keys[i]] != null)
2782
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
2575
2783
  this[keys[i]] = properties[keys[i]];
2576
2784
  }
2577
2785
 
@@ -2596,9 +2804,13 @@ $root.proteus = (function() {
2596
2804
  * @param {$protobuf.Writer} [writer] Writer to encode to
2597
2805
  * @returns {$protobuf.Writer} Writer
2598
2806
  */
2599
- ReportAll.encode = function encode(message, writer) {
2807
+ ReportAll.encode = function encode(message, writer, q) {
2600
2808
  if (!writer)
2601
2809
  writer = $Writer.create();
2810
+ if (q === undefined)
2811
+ q = 0;
2812
+ if (q > $util.recursionLimit)
2813
+ throw Error("max depth exceeded");
2602
2814
  return writer;
2603
2815
  };
2604
2816
 
@@ -2626,15 +2838,21 @@ $root.proteus = (function() {
2626
2838
  * @throws {Error} If the payload is not a reader or valid buffer
2627
2839
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
2628
2840
  */
2629
- ReportAll.decode = function decode(reader, length) {
2841
+ ReportAll.decode = function decode(reader, length, error, long) {
2630
2842
  if (!(reader instanceof $Reader))
2631
2843
  reader = $Reader.create(reader);
2844
+ if (long === undefined)
2845
+ long = 0;
2846
+ if (long > $Reader.recursionLimit)
2847
+ throw Error("maximum nesting depth exceeded");
2632
2848
  var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proteus.ClientMismatchStrategy.ReportAll();
2633
2849
  while (reader.pos < end) {
2634
2850
  var tag = reader.uint32();
2851
+ if (tag === error)
2852
+ break;
2635
2853
  switch (tag >>> 3) {
2636
2854
  default:
2637
- reader.skipType(tag & 7);
2855
+ reader.skipType(tag & 7, long);
2638
2856
  break;
2639
2857
  }
2640
2858
  }
@@ -2665,9 +2883,13 @@ $root.proteus = (function() {
2665
2883
  * @param {Object.<string,*>} message Plain object to verify
2666
2884
  * @returns {string|null} `null` if valid, otherwise the reason why it is not
2667
2885
  */
2668
- ReportAll.verify = function verify(message) {
2886
+ ReportAll.verify = function verify(message, long) {
2669
2887
  if (typeof message !== "object" || message === null)
2670
2888
  return "object expected";
2889
+ if (long === undefined)
2890
+ long = 0;
2891
+ if (long > $util.recursionLimit)
2892
+ return "maximum nesting depth exceeded";
2671
2893
  return null;
2672
2894
  };
2673
2895
 
@@ -2679,7 +2901,7 @@ $root.proteus = (function() {
2679
2901
  * @param {Object.<string,*>} object Plain object
2680
2902
  * @returns {proteus.ClientMismatchStrategy.ReportAll} ReportAll
2681
2903
  */
2682
- ReportAll.fromObject = function fromObject(object) {
2904
+ ReportAll.fromObject = function fromObject(object, long) {
2683
2905
  if (object instanceof $root.proteus.ClientMismatchStrategy.ReportAll)
2684
2906
  return object;
2685
2907
  return new $root.proteus.ClientMismatchStrategy.ReportAll();
@@ -2746,7 +2968,7 @@ $root.proteus = (function() {
2746
2968
  function IgnoreAll(properties) {
2747
2969
  if (properties)
2748
2970
  for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
2749
- if (properties[keys[i]] != null)
2971
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
2750
2972
  this[keys[i]] = properties[keys[i]];
2751
2973
  }
2752
2974
 
@@ -2771,9 +2993,13 @@ $root.proteus = (function() {
2771
2993
  * @param {$protobuf.Writer} [writer] Writer to encode to
2772
2994
  * @returns {$protobuf.Writer} Writer
2773
2995
  */
2774
- IgnoreAll.encode = function encode(message, writer) {
2996
+ IgnoreAll.encode = function encode(message, writer, q) {
2775
2997
  if (!writer)
2776
2998
  writer = $Writer.create();
2999
+ if (q === undefined)
3000
+ q = 0;
3001
+ if (q > $util.recursionLimit)
3002
+ throw Error("max depth exceeded");
2777
3003
  return writer;
2778
3004
  };
2779
3005
 
@@ -2801,15 +3027,21 @@ $root.proteus = (function() {
2801
3027
  * @throws {Error} If the payload is not a reader or valid buffer
2802
3028
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
2803
3029
  */
2804
- IgnoreAll.decode = function decode(reader, length) {
3030
+ IgnoreAll.decode = function decode(reader, length, error, long) {
2805
3031
  if (!(reader instanceof $Reader))
2806
3032
  reader = $Reader.create(reader);
3033
+ if (long === undefined)
3034
+ long = 0;
3035
+ if (long > $Reader.recursionLimit)
3036
+ throw Error("maximum nesting depth exceeded");
2807
3037
  var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proteus.ClientMismatchStrategy.IgnoreAll();
2808
3038
  while (reader.pos < end) {
2809
3039
  var tag = reader.uint32();
3040
+ if (tag === error)
3041
+ break;
2810
3042
  switch (tag >>> 3) {
2811
3043
  default:
2812
- reader.skipType(tag & 7);
3044
+ reader.skipType(tag & 7, long);
2813
3045
  break;
2814
3046
  }
2815
3047
  }
@@ -2840,9 +3072,13 @@ $root.proteus = (function() {
2840
3072
  * @param {Object.<string,*>} message Plain object to verify
2841
3073
  * @returns {string|null} `null` if valid, otherwise the reason why it is not
2842
3074
  */
2843
- IgnoreAll.verify = function verify(message) {
3075
+ IgnoreAll.verify = function verify(message, long) {
2844
3076
  if (typeof message !== "object" || message === null)
2845
3077
  return "object expected";
3078
+ if (long === undefined)
3079
+ long = 0;
3080
+ if (long > $util.recursionLimit)
3081
+ return "maximum nesting depth exceeded";
2846
3082
  return null;
2847
3083
  };
2848
3084
 
@@ -2854,7 +3090,7 @@ $root.proteus = (function() {
2854
3090
  * @param {Object.<string,*>} object Plain object
2855
3091
  * @returns {proteus.ClientMismatchStrategy.IgnoreAll} IgnoreAll
2856
3092
  */
2857
- IgnoreAll.fromObject = function fromObject(object) {
3093
+ IgnoreAll.fromObject = function fromObject(object, long) {
2858
3094
  if (object instanceof $root.proteus.ClientMismatchStrategy.IgnoreAll)
2859
3095
  return object;
2860
3096
  return new $root.proteus.ClientMismatchStrategy.IgnoreAll();
@@ -2923,7 +3159,7 @@ $root.proteus = (function() {
2923
3159
  this.userIds = [];
2924
3160
  if (properties)
2925
3161
  for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
2926
- if (properties[keys[i]] != null)
3162
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
2927
3163
  this[keys[i]] = properties[keys[i]];
2928
3164
  }
2929
3165
 
@@ -2956,12 +3192,16 @@ $root.proteus = (function() {
2956
3192
  * @param {$protobuf.Writer} [writer] Writer to encode to
2957
3193
  * @returns {$protobuf.Writer} Writer
2958
3194
  */
2959
- ReportOnly.encode = function encode(message, writer) {
3195
+ ReportOnly.encode = function encode(message, writer, q) {
2960
3196
  if (!writer)
2961
3197
  writer = $Writer.create();
3198
+ if (q === undefined)
3199
+ q = 0;
3200
+ if (q > $util.recursionLimit)
3201
+ throw Error("max depth exceeded");
2962
3202
  if (message.userIds != null && message.userIds.length)
2963
3203
  for (var i = 0; i < message.userIds.length; ++i)
2964
- $root.proteus.QualifiedUserId.encode(message.userIds[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
3204
+ $root.proteus.QualifiedUserId.encode(message.userIds[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim();
2965
3205
  return writer;
2966
3206
  };
2967
3207
 
@@ -2989,21 +3229,27 @@ $root.proteus = (function() {
2989
3229
  * @throws {Error} If the payload is not a reader or valid buffer
2990
3230
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
2991
3231
  */
2992
- ReportOnly.decode = function decode(reader, length) {
3232
+ ReportOnly.decode = function decode(reader, length, error, long) {
2993
3233
  if (!(reader instanceof $Reader))
2994
3234
  reader = $Reader.create(reader);
3235
+ if (long === undefined)
3236
+ long = 0;
3237
+ if (long > $Reader.recursionLimit)
3238
+ throw Error("maximum nesting depth exceeded");
2995
3239
  var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proteus.ClientMismatchStrategy.ReportOnly();
2996
3240
  while (reader.pos < end) {
2997
3241
  var tag = reader.uint32();
3242
+ if (tag === error)
3243
+ break;
2998
3244
  switch (tag >>> 3) {
2999
3245
  case 1: {
3000
3246
  if (!(message.userIds && message.userIds.length))
3001
3247
  message.userIds = [];
3002
- message.userIds.push($root.proteus.QualifiedUserId.decode(reader, reader.uint32()));
3248
+ message.userIds.push($root.proteus.QualifiedUserId.decode(reader, reader.uint32(), undefined, long + 1));
3003
3249
  break;
3004
3250
  }
3005
3251
  default:
3006
- reader.skipType(tag & 7);
3252
+ reader.skipType(tag & 7, long);
3007
3253
  break;
3008
3254
  }
3009
3255
  }
@@ -3034,14 +3280,18 @@ $root.proteus = (function() {
3034
3280
  * @param {Object.<string,*>} message Plain object to verify
3035
3281
  * @returns {string|null} `null` if valid, otherwise the reason why it is not
3036
3282
  */
3037
- ReportOnly.verify = function verify(message) {
3283
+ ReportOnly.verify = function verify(message, long) {
3038
3284
  if (typeof message !== "object" || message === null)
3039
3285
  return "object expected";
3040
- if (message.userIds != null && message.hasOwnProperty("userIds")) {
3286
+ if (long === undefined)
3287
+ long = 0;
3288
+ if (long > $util.recursionLimit)
3289
+ return "maximum nesting depth exceeded";
3290
+ if (message.userIds != null && Object.hasOwnProperty.call(message, "userIds")) {
3041
3291
  if (!Array.isArray(message.userIds))
3042
3292
  return "userIds: array expected";
3043
3293
  for (var i = 0; i < message.userIds.length; ++i) {
3044
- var error = $root.proteus.QualifiedUserId.verify(message.userIds[i]);
3294
+ var error = $root.proteus.QualifiedUserId.verify(message.userIds[i], long + 1);
3045
3295
  if (error)
3046
3296
  return "userIds." + error;
3047
3297
  }
@@ -3057,18 +3307,24 @@ $root.proteus = (function() {
3057
3307
  * @param {Object.<string,*>} object Plain object
3058
3308
  * @returns {proteus.ClientMismatchStrategy.ReportOnly} ReportOnly
3059
3309
  */
3060
- ReportOnly.fromObject = function fromObject(object) {
3310
+ ReportOnly.fromObject = function fromObject(object, long) {
3061
3311
  if (object instanceof $root.proteus.ClientMismatchStrategy.ReportOnly)
3062
3312
  return object;
3313
+ if (!$util.isObject(object))
3314
+ throw TypeError(".proteus.ClientMismatchStrategy.ReportOnly: object expected");
3315
+ if (long === undefined)
3316
+ long = 0;
3317
+ if (long > $util.recursionLimit)
3318
+ throw Error("maximum nesting depth exceeded");
3063
3319
  var message = new $root.proteus.ClientMismatchStrategy.ReportOnly();
3064
3320
  if (object.userIds) {
3065
3321
  if (!Array.isArray(object.userIds))
3066
3322
  throw TypeError(".proteus.ClientMismatchStrategy.ReportOnly.userIds: array expected");
3067
3323
  message.userIds = [];
3068
3324
  for (var i = 0; i < object.userIds.length; ++i) {
3069
- if (typeof object.userIds[i] !== "object")
3325
+ if (!$util.isObject(object.userIds[i]))
3070
3326
  throw TypeError(".proteus.ClientMismatchStrategy.ReportOnly.userIds: object expected");
3071
- message.userIds[i] = $root.proteus.QualifiedUserId.fromObject(object.userIds[i]);
3327
+ message.userIds[i] = $root.proteus.QualifiedUserId.fromObject(object.userIds[i], long + 1);
3072
3328
  }
3073
3329
  }
3074
3330
  return message;
@@ -3083,16 +3339,20 @@ $root.proteus = (function() {
3083
3339
  * @param {$protobuf.IConversionOptions} [options] Conversion options
3084
3340
  * @returns {Object.<string,*>} Plain object
3085
3341
  */
3086
- ReportOnly.toObject = function toObject(message, options) {
3342
+ ReportOnly.toObject = function toObject(message, options, q) {
3087
3343
  if (!options)
3088
3344
  options = {};
3345
+ if (q === undefined)
3346
+ q = 0;
3347
+ if (q > $util.recursionLimit)
3348
+ throw Error("max depth exceeded");
3089
3349
  var object = {};
3090
3350
  if (options.arrays || options.defaults)
3091
3351
  object.userIds = [];
3092
3352
  if (message.userIds && message.userIds.length) {
3093
3353
  object.userIds = [];
3094
3354
  for (var j = 0; j < message.userIds.length; ++j)
3095
- object.userIds[j] = $root.proteus.QualifiedUserId.toObject(message.userIds[j], options);
3355
+ object.userIds[j] = $root.proteus.QualifiedUserId.toObject(message.userIds[j], options, q + 1);
3096
3356
  }
3097
3357
  return object;
3098
3358
  };
@@ -3147,7 +3407,7 @@ $root.proteus = (function() {
3147
3407
  this.userIds = [];
3148
3408
  if (properties)
3149
3409
  for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
3150
- if (properties[keys[i]] != null)
3410
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
3151
3411
  this[keys[i]] = properties[keys[i]];
3152
3412
  }
3153
3413
 
@@ -3180,12 +3440,16 @@ $root.proteus = (function() {
3180
3440
  * @param {$protobuf.Writer} [writer] Writer to encode to
3181
3441
  * @returns {$protobuf.Writer} Writer
3182
3442
  */
3183
- IgnoreOnly.encode = function encode(message, writer) {
3443
+ IgnoreOnly.encode = function encode(message, writer, q) {
3184
3444
  if (!writer)
3185
3445
  writer = $Writer.create();
3446
+ if (q === undefined)
3447
+ q = 0;
3448
+ if (q > $util.recursionLimit)
3449
+ throw Error("max depth exceeded");
3186
3450
  if (message.userIds != null && message.userIds.length)
3187
3451
  for (var i = 0; i < message.userIds.length; ++i)
3188
- $root.proteus.QualifiedUserId.encode(message.userIds[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
3452
+ $root.proteus.QualifiedUserId.encode(message.userIds[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim();
3189
3453
  return writer;
3190
3454
  };
3191
3455
 
@@ -3213,21 +3477,27 @@ $root.proteus = (function() {
3213
3477
  * @throws {Error} If the payload is not a reader or valid buffer
3214
3478
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
3215
3479
  */
3216
- IgnoreOnly.decode = function decode(reader, length) {
3480
+ IgnoreOnly.decode = function decode(reader, length, error, long) {
3217
3481
  if (!(reader instanceof $Reader))
3218
3482
  reader = $Reader.create(reader);
3483
+ if (long === undefined)
3484
+ long = 0;
3485
+ if (long > $Reader.recursionLimit)
3486
+ throw Error("maximum nesting depth exceeded");
3219
3487
  var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proteus.ClientMismatchStrategy.IgnoreOnly();
3220
3488
  while (reader.pos < end) {
3221
3489
  var tag = reader.uint32();
3490
+ if (tag === error)
3491
+ break;
3222
3492
  switch (tag >>> 3) {
3223
3493
  case 1: {
3224
3494
  if (!(message.userIds && message.userIds.length))
3225
3495
  message.userIds = [];
3226
- message.userIds.push($root.proteus.QualifiedUserId.decode(reader, reader.uint32()));
3496
+ message.userIds.push($root.proteus.QualifiedUserId.decode(reader, reader.uint32(), undefined, long + 1));
3227
3497
  break;
3228
3498
  }
3229
3499
  default:
3230
- reader.skipType(tag & 7);
3500
+ reader.skipType(tag & 7, long);
3231
3501
  break;
3232
3502
  }
3233
3503
  }
@@ -3258,14 +3528,18 @@ $root.proteus = (function() {
3258
3528
  * @param {Object.<string,*>} message Plain object to verify
3259
3529
  * @returns {string|null} `null` if valid, otherwise the reason why it is not
3260
3530
  */
3261
- IgnoreOnly.verify = function verify(message) {
3531
+ IgnoreOnly.verify = function verify(message, long) {
3262
3532
  if (typeof message !== "object" || message === null)
3263
3533
  return "object expected";
3264
- if (message.userIds != null && message.hasOwnProperty("userIds")) {
3534
+ if (long === undefined)
3535
+ long = 0;
3536
+ if (long > $util.recursionLimit)
3537
+ return "maximum nesting depth exceeded";
3538
+ if (message.userIds != null && Object.hasOwnProperty.call(message, "userIds")) {
3265
3539
  if (!Array.isArray(message.userIds))
3266
3540
  return "userIds: array expected";
3267
3541
  for (var i = 0; i < message.userIds.length; ++i) {
3268
- var error = $root.proteus.QualifiedUserId.verify(message.userIds[i]);
3542
+ var error = $root.proteus.QualifiedUserId.verify(message.userIds[i], long + 1);
3269
3543
  if (error)
3270
3544
  return "userIds." + error;
3271
3545
  }
@@ -3281,18 +3555,24 @@ $root.proteus = (function() {
3281
3555
  * @param {Object.<string,*>} object Plain object
3282
3556
  * @returns {proteus.ClientMismatchStrategy.IgnoreOnly} IgnoreOnly
3283
3557
  */
3284
- IgnoreOnly.fromObject = function fromObject(object) {
3558
+ IgnoreOnly.fromObject = function fromObject(object, long) {
3285
3559
  if (object instanceof $root.proteus.ClientMismatchStrategy.IgnoreOnly)
3286
3560
  return object;
3561
+ if (!$util.isObject(object))
3562
+ throw TypeError(".proteus.ClientMismatchStrategy.IgnoreOnly: object expected");
3563
+ if (long === undefined)
3564
+ long = 0;
3565
+ if (long > $util.recursionLimit)
3566
+ throw Error("maximum nesting depth exceeded");
3287
3567
  var message = new $root.proteus.ClientMismatchStrategy.IgnoreOnly();
3288
3568
  if (object.userIds) {
3289
3569
  if (!Array.isArray(object.userIds))
3290
3570
  throw TypeError(".proteus.ClientMismatchStrategy.IgnoreOnly.userIds: array expected");
3291
3571
  message.userIds = [];
3292
3572
  for (var i = 0; i < object.userIds.length; ++i) {
3293
- if (typeof object.userIds[i] !== "object")
3573
+ if (!$util.isObject(object.userIds[i]))
3294
3574
  throw TypeError(".proteus.ClientMismatchStrategy.IgnoreOnly.userIds: object expected");
3295
- message.userIds[i] = $root.proteus.QualifiedUserId.fromObject(object.userIds[i]);
3575
+ message.userIds[i] = $root.proteus.QualifiedUserId.fromObject(object.userIds[i], long + 1);
3296
3576
  }
3297
3577
  }
3298
3578
  return message;
@@ -3307,16 +3587,20 @@ $root.proteus = (function() {
3307
3587
  * @param {$protobuf.IConversionOptions} [options] Conversion options
3308
3588
  * @returns {Object.<string,*>} Plain object
3309
3589
  */
3310
- IgnoreOnly.toObject = function toObject(message, options) {
3590
+ IgnoreOnly.toObject = function toObject(message, options, q) {
3311
3591
  if (!options)
3312
3592
  options = {};
3593
+ if (q === undefined)
3594
+ q = 0;
3595
+ if (q > $util.recursionLimit)
3596
+ throw Error("max depth exceeded");
3313
3597
  var object = {};
3314
3598
  if (options.arrays || options.defaults)
3315
3599
  object.userIds = [];
3316
3600
  if (message.userIds && message.userIds.length) {
3317
3601
  object.userIds = [];
3318
3602
  for (var j = 0; j < message.userIds.length; ++j)
3319
- object.userIds[j] = $root.proteus.QualifiedUserId.toObject(message.userIds[j], options);
3603
+ object.userIds[j] = $root.proteus.QualifiedUserId.toObject(message.userIds[j], options, q + 1);
3320
3604
  }
3321
3605
  return object;
3322
3606
  };
@@ -3377,7 +3661,7 @@ $root.proteus = (function() {
3377
3661
  this.recipients = [];
3378
3662
  if (properties)
3379
3663
  for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
3380
- if (properties[keys[i]] != null)
3664
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
3381
3665
  this[keys[i]] = properties[keys[i]];
3382
3666
  }
3383
3667
 
@@ -3434,13 +3718,17 @@ $root.proteus = (function() {
3434
3718
  * @param {$protobuf.Writer} [writer] Writer to encode to
3435
3719
  * @returns {$protobuf.Writer} Writer
3436
3720
  */
3437
- OtrAssetMeta.encode = function encode(message, writer) {
3721
+ OtrAssetMeta.encode = function encode(message, writer, q) {
3438
3722
  if (!writer)
3439
3723
  writer = $Writer.create();
3440
- $root.proteus.ClientId.encode(message.sender, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
3724
+ if (q === undefined)
3725
+ q = 0;
3726
+ if (q > $util.recursionLimit)
3727
+ throw Error("max depth exceeded");
3728
+ $root.proteus.ClientId.encode(message.sender, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim();
3441
3729
  if (message.recipients != null && message.recipients.length)
3442
3730
  for (var i = 0; i < message.recipients.length; ++i)
3443
- $root.proteus.UserEntry.encode(message.recipients[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
3731
+ $root.proteus.UserEntry.encode(message.recipients[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim();
3444
3732
  if (message.isInline != null && Object.hasOwnProperty.call(message, "isInline"))
3445
3733
  writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isInline);
3446
3734
  if (message.nativePush != null && Object.hasOwnProperty.call(message, "nativePush"))
@@ -3472,21 +3760,27 @@ $root.proteus = (function() {
3472
3760
  * @throws {Error} If the payload is not a reader or valid buffer
3473
3761
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
3474
3762
  */
3475
- OtrAssetMeta.decode = function decode(reader, length) {
3763
+ OtrAssetMeta.decode = function decode(reader, length, error, long) {
3476
3764
  if (!(reader instanceof $Reader))
3477
3765
  reader = $Reader.create(reader);
3766
+ if (long === undefined)
3767
+ long = 0;
3768
+ if (long > $Reader.recursionLimit)
3769
+ throw Error("maximum nesting depth exceeded");
3478
3770
  var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proteus.OtrAssetMeta();
3479
3771
  while (reader.pos < end) {
3480
3772
  var tag = reader.uint32();
3773
+ if (tag === error)
3774
+ break;
3481
3775
  switch (tag >>> 3) {
3482
3776
  case 1: {
3483
- message.sender = $root.proteus.ClientId.decode(reader, reader.uint32());
3777
+ message.sender = $root.proteus.ClientId.decode(reader, reader.uint32(), undefined, long + 1);
3484
3778
  break;
3485
3779
  }
3486
3780
  case 2: {
3487
3781
  if (!(message.recipients && message.recipients.length))
3488
3782
  message.recipients = [];
3489
- message.recipients.push($root.proteus.UserEntry.decode(reader, reader.uint32()));
3783
+ message.recipients.push($root.proteus.UserEntry.decode(reader, reader.uint32(), undefined, long + 1));
3490
3784
  break;
3491
3785
  }
3492
3786
  case 3: {
@@ -3498,11 +3792,11 @@ $root.proteus = (function() {
3498
3792
  break;
3499
3793
  }
3500
3794
  default:
3501
- reader.skipType(tag & 7);
3795
+ reader.skipType(tag & 7, long);
3502
3796
  break;
3503
3797
  }
3504
3798
  }
3505
- if (!message.hasOwnProperty("sender"))
3799
+ if (!Object.hasOwnProperty.call(message, "sender"))
3506
3800
  throw $util.ProtocolError("missing required 'sender'", { instance: message });
3507
3801
  return message;
3508
3802
  };
@@ -3531,27 +3825,31 @@ $root.proteus = (function() {
3531
3825
  * @param {Object.<string,*>} message Plain object to verify
3532
3826
  * @returns {string|null} `null` if valid, otherwise the reason why it is not
3533
3827
  */
3534
- OtrAssetMeta.verify = function verify(message) {
3828
+ OtrAssetMeta.verify = function verify(message, long) {
3535
3829
  if (typeof message !== "object" || message === null)
3536
3830
  return "object expected";
3831
+ if (long === undefined)
3832
+ long = 0;
3833
+ if (long > $util.recursionLimit)
3834
+ return "maximum nesting depth exceeded";
3537
3835
  {
3538
- var error = $root.proteus.ClientId.verify(message.sender);
3836
+ var error = $root.proteus.ClientId.verify(message.sender, long + 1);
3539
3837
  if (error)
3540
3838
  return "sender." + error;
3541
3839
  }
3542
- if (message.recipients != null && message.hasOwnProperty("recipients")) {
3840
+ if (message.recipients != null && Object.hasOwnProperty.call(message, "recipients")) {
3543
3841
  if (!Array.isArray(message.recipients))
3544
3842
  return "recipients: array expected";
3545
3843
  for (var i = 0; i < message.recipients.length; ++i) {
3546
- var error = $root.proteus.UserEntry.verify(message.recipients[i]);
3844
+ var error = $root.proteus.UserEntry.verify(message.recipients[i], long + 1);
3547
3845
  if (error)
3548
3846
  return "recipients." + error;
3549
3847
  }
3550
3848
  }
3551
- if (message.isInline != null && message.hasOwnProperty("isInline"))
3849
+ if (message.isInline != null && Object.hasOwnProperty.call(message, "isInline"))
3552
3850
  if (typeof message.isInline !== "boolean")
3553
3851
  return "isInline: boolean expected";
3554
- if (message.nativePush != null && message.hasOwnProperty("nativePush"))
3852
+ if (message.nativePush != null && Object.hasOwnProperty.call(message, "nativePush"))
3555
3853
  if (typeof message.nativePush !== "boolean")
3556
3854
  return "nativePush: boolean expected";
3557
3855
  return null;
@@ -3565,23 +3863,29 @@ $root.proteus = (function() {
3565
3863
  * @param {Object.<string,*>} object Plain object
3566
3864
  * @returns {proteus.OtrAssetMeta} OtrAssetMeta
3567
3865
  */
3568
- OtrAssetMeta.fromObject = function fromObject(object) {
3866
+ OtrAssetMeta.fromObject = function fromObject(object, long) {
3569
3867
  if (object instanceof $root.proteus.OtrAssetMeta)
3570
3868
  return object;
3869
+ if (!$util.isObject(object))
3870
+ throw TypeError(".proteus.OtrAssetMeta: object expected");
3871
+ if (long === undefined)
3872
+ long = 0;
3873
+ if (long > $util.recursionLimit)
3874
+ throw Error("maximum nesting depth exceeded");
3571
3875
  var message = new $root.proteus.OtrAssetMeta();
3572
3876
  if (object.sender != null) {
3573
- if (typeof object.sender !== "object")
3877
+ if (!$util.isObject(object.sender))
3574
3878
  throw TypeError(".proteus.OtrAssetMeta.sender: object expected");
3575
- message.sender = $root.proteus.ClientId.fromObject(object.sender);
3879
+ message.sender = $root.proteus.ClientId.fromObject(object.sender, long + 1);
3576
3880
  }
3577
3881
  if (object.recipients) {
3578
3882
  if (!Array.isArray(object.recipients))
3579
3883
  throw TypeError(".proteus.OtrAssetMeta.recipients: array expected");
3580
3884
  message.recipients = [];
3581
3885
  for (var i = 0; i < object.recipients.length; ++i) {
3582
- if (typeof object.recipients[i] !== "object")
3886
+ if (!$util.isObject(object.recipients[i]))
3583
3887
  throw TypeError(".proteus.OtrAssetMeta.recipients: object expected");
3584
- message.recipients[i] = $root.proteus.UserEntry.fromObject(object.recipients[i]);
3888
+ message.recipients[i] = $root.proteus.UserEntry.fromObject(object.recipients[i], long + 1);
3585
3889
  }
3586
3890
  }
3587
3891
  if (object.isInline != null)
@@ -3600,9 +3904,13 @@ $root.proteus = (function() {
3600
3904
  * @param {$protobuf.IConversionOptions} [options] Conversion options
3601
3905
  * @returns {Object.<string,*>} Plain object
3602
3906
  */
3603
- OtrAssetMeta.toObject = function toObject(message, options) {
3907
+ OtrAssetMeta.toObject = function toObject(message, options, q) {
3604
3908
  if (!options)
3605
3909
  options = {};
3910
+ if (q === undefined)
3911
+ q = 0;
3912
+ if (q > $util.recursionLimit)
3913
+ throw Error("max depth exceeded");
3606
3914
  var object = {};
3607
3915
  if (options.arrays || options.defaults)
3608
3916
  object.recipients = [];
@@ -3611,16 +3919,16 @@ $root.proteus = (function() {
3611
3919
  object.isInline = false;
3612
3920
  object.nativePush = true;
3613
3921
  }
3614
- if (message.sender != null && message.hasOwnProperty("sender"))
3615
- object.sender = $root.proteus.ClientId.toObject(message.sender, options);
3922
+ if (message.sender != null && Object.hasOwnProperty.call(message, "sender"))
3923
+ object.sender = $root.proteus.ClientId.toObject(message.sender, options, q + 1);
3616
3924
  if (message.recipients && message.recipients.length) {
3617
3925
  object.recipients = [];
3618
3926
  for (var j = 0; j < message.recipients.length; ++j)
3619
- object.recipients[j] = $root.proteus.UserEntry.toObject(message.recipients[j], options);
3927
+ object.recipients[j] = $root.proteus.UserEntry.toObject(message.recipients[j], options, q + 1);
3620
3928
  }
3621
- if (message.isInline != null && message.hasOwnProperty("isInline"))
3929
+ if (message.isInline != null && Object.hasOwnProperty.call(message, "isInline"))
3622
3930
  object.isInline = message.isInline;
3623
- if (message.nativePush != null && message.hasOwnProperty("nativePush"))
3931
+ if (message.nativePush != null && Object.hasOwnProperty.call(message, "nativePush"))
3624
3932
  object.nativePush = message.nativePush;
3625
3933
  return object;
3626
3934
  };