stream-chat 8.40.2 → 8.40.4

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.
@@ -421,8 +421,10 @@ function addToMessageList(messages, newMessage) {
421
421
  } // for empty list just concat and return unless it's an update or deletion
422
422
 
423
423
 
424
- if (!newMessages.length && addMessageToList) {
424
+ if (newMessages.length === 0 && addMessageToList) {
425
425
  return newMessages.concat(newMessage);
426
+ } else if (newMessages.length === 0) {
427
+ return newMessages;
426
428
  } // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
427
429
 
428
430
 
@@ -432,6 +434,8 @@ function addToMessageList(messages, newMessage) {
432
434
 
433
435
  if (messageIsNewest && addMessageToList) {
434
436
  return newMessages.concat(newMessage);
437
+ } else if (newMessages.length === 0) {
438
+ return newMessages;
435
439
  } // find the closest index to push the new message
436
440
 
437
441
 
@@ -2250,6 +2254,51 @@ var Channel = /*#__PURE__*/function () {
2250
2254
 
2251
2255
  return queryMembers;
2252
2256
  }()
2257
+ /**
2258
+ * partialUpdateMember - Partial update a member
2259
+ *
2260
+ * @param {string} user_id member user id
2261
+ * @param {PartialUpdateMember<StreamChatGenerics>} updates
2262
+ *
2263
+ * @return {Promise<ChannelMemberResponse<StreamChatGenerics>>} Updated member
2264
+ */
2265
+
2266
+ }, {
2267
+ key: "partialUpdateMember",
2268
+ value: function () {
2269
+ var _partialUpdateMember = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(user_id, updates) {
2270
+ return _regeneratorRuntime.wrap(function _callee6$(_context6) {
2271
+ while (1) {
2272
+ switch (_context6.prev = _context6.next) {
2273
+ case 0:
2274
+ if (user_id) {
2275
+ _context6.next = 2;
2276
+ break;
2277
+ }
2278
+
2279
+ throw Error('Please specify the user id');
2280
+
2281
+ case 2:
2282
+ _context6.next = 4;
2283
+ return this.getClient().patch(this._channelURL() + "/member/".concat(encodeURIComponent(user_id)), updates);
2284
+
2285
+ case 4:
2286
+ return _context6.abrupt("return", _context6.sent);
2287
+
2288
+ case 5:
2289
+ case "end":
2290
+ return _context6.stop();
2291
+ }
2292
+ }
2293
+ }, _callee6, this);
2294
+ }));
2295
+
2296
+ function partialUpdateMember(_x7, _x8) {
2297
+ return _partialUpdateMember.apply(this, arguments);
2298
+ }
2299
+
2300
+ return partialUpdateMember;
2301
+ }()
2253
2302
  /**
2254
2303
  * sendReaction - Send a reaction about a message
2255
2304
  *
@@ -2263,13 +2312,13 @@ var Channel = /*#__PURE__*/function () {
2263
2312
  }, {
2264
2313
  key: "sendReaction",
2265
2314
  value: function () {
2266
- var _sendReaction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(messageID, reaction, options) {
2267
- return _regeneratorRuntime.wrap(function _callee6$(_context6) {
2315
+ var _sendReaction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(messageID, reaction, options) {
2316
+ return _regeneratorRuntime.wrap(function _callee7$(_context7) {
2268
2317
  while (1) {
2269
- switch (_context6.prev = _context6.next) {
2318
+ switch (_context7.prev = _context7.next) {
2270
2319
  case 0:
2271
2320
  if (messageID) {
2272
- _context6.next = 2;
2321
+ _context7.next = 2;
2273
2322
  break;
2274
2323
  }
2275
2324
 
@@ -2277,30 +2326,30 @@ var Channel = /*#__PURE__*/function () {
2277
2326
 
2278
2327
  case 2:
2279
2328
  if (!(!reaction || Object.keys(reaction).length === 0)) {
2280
- _context6.next = 4;
2329
+ _context7.next = 4;
2281
2330
  break;
2282
2331
  }
2283
2332
 
2284
2333
  throw Error("Reaction object is missing");
2285
2334
 
2286
2335
  case 4:
2287
- _context6.next = 6;
2336
+ _context7.next = 6;
2288
2337
  return this.getClient().post(this.getClient().baseURL + "/messages/".concat(encodeURIComponent(messageID), "/reaction"), _objectSpread$9({
2289
2338
  reaction: reaction
2290
2339
  }, options));
2291
2340
 
2292
2341
  case 6:
2293
- return _context6.abrupt("return", _context6.sent);
2342
+ return _context7.abrupt("return", _context7.sent);
2294
2343
 
2295
2344
  case 7:
2296
2345
  case "end":
2297
- return _context6.stop();
2346
+ return _context7.stop();
2298
2347
  }
2299
2348
  }
2300
- }, _callee6, this);
2349
+ }, _callee7, this);
2301
2350
  }));
2302
2351
 
2303
- function sendReaction(_x7, _x8, _x9) {
2352
+ function sendReaction(_x9, _x10, _x11) {
2304
2353
  return _sendReaction.apply(this, arguments);
2305
2354
  }
2306
2355
 
@@ -2347,39 +2396,39 @@ var Channel = /*#__PURE__*/function () {
2347
2396
  }, {
2348
2397
  key: "update",
2349
2398
  value: function () {
2350
- var _update2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
2399
+ var _update2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
2351
2400
  var channelData,
2352
2401
  updateMessage,
2353
2402
  options,
2354
2403
  reserved,
2355
- _args7 = arguments;
2356
- return _regeneratorRuntime.wrap(function _callee7$(_context7) {
2404
+ _args8 = arguments;
2405
+ return _regeneratorRuntime.wrap(function _callee8$(_context8) {
2357
2406
  while (1) {
2358
- switch (_context7.prev = _context7.next) {
2407
+ switch (_context8.prev = _context8.next) {
2359
2408
  case 0:
2360
- channelData = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {};
2361
- updateMessage = _args7.length > 1 ? _args7[1] : undefined;
2362
- options = _args7.length > 2 ? _args7[2] : undefined;
2409
+ channelData = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {};
2410
+ updateMessage = _args8.length > 1 ? _args8[1] : undefined;
2411
+ options = _args8.length > 2 ? _args8[2] : undefined;
2363
2412
  // Strip out reserved names that will result in API errors.
2364
2413
  reserved = ['config', 'cid', 'created_by', 'id', 'member_count', 'type', 'created_at', 'updated_at', 'last_message_at', 'own_capabilities'];
2365
2414
  reserved.forEach(function (key) {
2366
2415
  delete channelData[key];
2367
2416
  });
2368
- _context7.next = 7;
2417
+ _context8.next = 7;
2369
2418
  return this._update(_objectSpread$9({
2370
2419
  message: updateMessage,
2371
2420
  data: channelData
2372
2421
  }, options));
2373
2422
 
2374
2423
  case 7:
2375
- return _context7.abrupt("return", _context7.sent);
2424
+ return _context8.abrupt("return", _context8.sent);
2376
2425
 
2377
2426
  case 8:
2378
2427
  case "end":
2379
- return _context7.stop();
2428
+ return _context8.stop();
2380
2429
  }
2381
2430
  }
2382
- }, _callee7, this);
2431
+ }, _callee8, this);
2383
2432
  }));
2384
2433
 
2385
2434
  function update() {
@@ -2399,19 +2448,19 @@ var Channel = /*#__PURE__*/function () {
2399
2448
  }, {
2400
2449
  key: "updatePartial",
2401
2450
  value: function () {
2402
- var _updatePartial = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(update) {
2451
+ var _updatePartial = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(update) {
2403
2452
  var _this$data2, _this$data3;
2404
2453
 
2405
2454
  var data, areCapabilitiesChanged;
2406
- return _regeneratorRuntime.wrap(function _callee8$(_context8) {
2455
+ return _regeneratorRuntime.wrap(function _callee9$(_context9) {
2407
2456
  while (1) {
2408
- switch (_context8.prev = _context8.next) {
2457
+ switch (_context9.prev = _context9.next) {
2409
2458
  case 0:
2410
- _context8.next = 2;
2459
+ _context9.next = 2;
2411
2460
  return this.getClient().patch(this._channelURL(), update);
2412
2461
 
2413
2462
  case 2:
2414
- data = _context8.sent;
2463
+ data = _context9.sent;
2415
2464
  areCapabilitiesChanged = _toConsumableArray(data.channel.own_capabilities || []).sort().join() !== _toConsumableArray(Array.isArray((_this$data2 = this.data) === null || _this$data2 === void 0 ? void 0 : _this$data2.own_capabilities) ? (_this$data3 = this.data) === null || _this$data3 === void 0 ? void 0 : _this$data3.own_capabilities : []).sort().join();
2416
2465
  this.data = data.channel; // If the capabiltities are changed, we trigger the `capabilities.changed` event.
2417
2466
 
@@ -2423,17 +2472,17 @@ var Channel = /*#__PURE__*/function () {
2423
2472
  });
2424
2473
  }
2425
2474
 
2426
- return _context8.abrupt("return", data);
2475
+ return _context9.abrupt("return", data);
2427
2476
 
2428
2477
  case 7:
2429
2478
  case "end":
2430
- return _context8.stop();
2479
+ return _context9.stop();
2431
2480
  }
2432
2481
  }
2433
- }, _callee8, this);
2482
+ }, _callee9, this);
2434
2483
  }));
2435
2484
 
2436
- function updatePartial(_x10) {
2485
+ function updatePartial(_x12) {
2437
2486
  return _updatePartial.apply(this, arguments);
2438
2487
  }
2439
2488
 
@@ -2449,31 +2498,31 @@ var Channel = /*#__PURE__*/function () {
2449
2498
  }, {
2450
2499
  key: "enableSlowMode",
2451
2500
  value: function () {
2452
- var _enableSlowMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(coolDownInterval) {
2501
+ var _enableSlowMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(coolDownInterval) {
2453
2502
  var data;
2454
- return _regeneratorRuntime.wrap(function _callee9$(_context9) {
2503
+ return _regeneratorRuntime.wrap(function _callee10$(_context10) {
2455
2504
  while (1) {
2456
- switch (_context9.prev = _context9.next) {
2505
+ switch (_context10.prev = _context10.next) {
2457
2506
  case 0:
2458
- _context9.next = 2;
2507
+ _context10.next = 2;
2459
2508
  return this.getClient().post(this._channelURL(), {
2460
2509
  cooldown: coolDownInterval
2461
2510
  });
2462
2511
 
2463
2512
  case 2:
2464
- data = _context9.sent;
2513
+ data = _context10.sent;
2465
2514
  this.data = data.channel;
2466
- return _context9.abrupt("return", data);
2515
+ return _context10.abrupt("return", data);
2467
2516
 
2468
2517
  case 5:
2469
2518
  case "end":
2470
- return _context9.stop();
2519
+ return _context10.stop();
2471
2520
  }
2472
2521
  }
2473
- }, _callee9, this);
2522
+ }, _callee10, this);
2474
2523
  }));
2475
2524
 
2476
- function enableSlowMode(_x11) {
2525
+ function enableSlowMode(_x13) {
2477
2526
  return _enableSlowMode.apply(this, arguments);
2478
2527
  }
2479
2528
 
@@ -2488,28 +2537,28 @@ var Channel = /*#__PURE__*/function () {
2488
2537
  }, {
2489
2538
  key: "disableSlowMode",
2490
2539
  value: function () {
2491
- var _disableSlowMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {
2540
+ var _disableSlowMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11() {
2492
2541
  var data;
2493
- return _regeneratorRuntime.wrap(function _callee10$(_context10) {
2542
+ return _regeneratorRuntime.wrap(function _callee11$(_context11) {
2494
2543
  while (1) {
2495
- switch (_context10.prev = _context10.next) {
2544
+ switch (_context11.prev = _context11.next) {
2496
2545
  case 0:
2497
- _context10.next = 2;
2546
+ _context11.next = 2;
2498
2547
  return this.getClient().post(this._channelURL(), {
2499
2548
  cooldown: 0
2500
2549
  });
2501
2550
 
2502
2551
  case 2:
2503
- data = _context10.sent;
2552
+ data = _context11.sent;
2504
2553
  this.data = data.channel;
2505
- return _context10.abrupt("return", data);
2554
+ return _context11.abrupt("return", data);
2506
2555
 
2507
2556
  case 5:
2508
2557
  case "end":
2509
- return _context10.stop();
2558
+ return _context11.stop();
2510
2559
  }
2511
2560
  }
2512
- }, _callee10, this);
2561
+ }, _callee11, this);
2513
2562
  }));
2514
2563
 
2515
2564
  function disableSlowMode() {
@@ -2529,26 +2578,26 @@ var Channel = /*#__PURE__*/function () {
2529
2578
  }, {
2530
2579
  key: "delete",
2531
2580
  value: function () {
2532
- var _delete2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11() {
2581
+ var _delete2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
2533
2582
  var options,
2534
- _args11 = arguments;
2535
- return _regeneratorRuntime.wrap(function _callee11$(_context11) {
2583
+ _args12 = arguments;
2584
+ return _regeneratorRuntime.wrap(function _callee12$(_context12) {
2536
2585
  while (1) {
2537
- switch (_context11.prev = _context11.next) {
2586
+ switch (_context12.prev = _context12.next) {
2538
2587
  case 0:
2539
- options = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : {};
2540
- _context11.next = 3;
2588
+ options = _args12.length > 0 && _args12[0] !== undefined ? _args12[0] : {};
2589
+ _context12.next = 3;
2541
2590
  return this.getClient().delete(this._channelURL(), _objectSpread$9({}, options));
2542
2591
 
2543
2592
  case 3:
2544
- return _context11.abrupt("return", _context11.sent);
2593
+ return _context12.abrupt("return", _context12.sent);
2545
2594
 
2546
2595
  case 4:
2547
2596
  case "end":
2548
- return _context11.stop();
2597
+ return _context12.stop();
2549
2598
  }
2550
2599
  }
2551
- }, _callee11, this);
2600
+ }, _callee12, this);
2552
2601
  }));
2553
2602
 
2554
2603
  function _delete() {
@@ -2566,26 +2615,26 @@ var Channel = /*#__PURE__*/function () {
2566
2615
  }, {
2567
2616
  key: "truncate",
2568
2617
  value: function () {
2569
- var _truncate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
2618
+ var _truncate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13() {
2570
2619
  var options,
2571
- _args12 = arguments;
2572
- return _regeneratorRuntime.wrap(function _callee12$(_context12) {
2620
+ _args13 = arguments;
2621
+ return _regeneratorRuntime.wrap(function _callee13$(_context13) {
2573
2622
  while (1) {
2574
- switch (_context12.prev = _context12.next) {
2623
+ switch (_context13.prev = _context13.next) {
2575
2624
  case 0:
2576
- options = _args12.length > 0 && _args12[0] !== undefined ? _args12[0] : {};
2577
- _context12.next = 3;
2625
+ options = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : {};
2626
+ _context13.next = 3;
2578
2627
  return this.getClient().post(this._channelURL() + '/truncate', options);
2579
2628
 
2580
2629
  case 3:
2581
- return _context12.abrupt("return", _context12.sent);
2630
+ return _context13.abrupt("return", _context13.sent);
2582
2631
 
2583
2632
  case 4:
2584
2633
  case "end":
2585
- return _context12.stop();
2634
+ return _context13.stop();
2586
2635
  }
2587
2636
  }
2588
- }, _callee12, this);
2637
+ }, _callee13, this);
2589
2638
  }));
2590
2639
 
2591
2640
  function truncate() {
@@ -2605,28 +2654,28 @@ var Channel = /*#__PURE__*/function () {
2605
2654
  }, {
2606
2655
  key: "acceptInvite",
2607
2656
  value: function () {
2608
- var _acceptInvite = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13() {
2657
+ var _acceptInvite = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
2609
2658
  var options,
2610
- _args13 = arguments;
2611
- return _regeneratorRuntime.wrap(function _callee13$(_context13) {
2659
+ _args14 = arguments;
2660
+ return _regeneratorRuntime.wrap(function _callee14$(_context14) {
2612
2661
  while (1) {
2613
- switch (_context13.prev = _context13.next) {
2662
+ switch (_context14.prev = _context14.next) {
2614
2663
  case 0:
2615
- options = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : {};
2616
- _context13.next = 3;
2664
+ options = _args14.length > 0 && _args14[0] !== undefined ? _args14[0] : {};
2665
+ _context14.next = 3;
2617
2666
  return this._update(_objectSpread$9({
2618
2667
  accept_invite: true
2619
2668
  }, options));
2620
2669
 
2621
2670
  case 3:
2622
- return _context13.abrupt("return", _context13.sent);
2671
+ return _context14.abrupt("return", _context14.sent);
2623
2672
 
2624
2673
  case 4:
2625
2674
  case "end":
2626
- return _context13.stop();
2675
+ return _context14.stop();
2627
2676
  }
2628
2677
  }
2629
- }, _callee13, this);
2678
+ }, _callee14, this);
2630
2679
  }));
2631
2680
 
2632
2681
  function acceptInvite() {
@@ -2646,28 +2695,28 @@ var Channel = /*#__PURE__*/function () {
2646
2695
  }, {
2647
2696
  key: "rejectInvite",
2648
2697
  value: function () {
2649
- var _rejectInvite = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
2698
+ var _rejectInvite = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15() {
2650
2699
  var options,
2651
- _args14 = arguments;
2652
- return _regeneratorRuntime.wrap(function _callee14$(_context14) {
2700
+ _args15 = arguments;
2701
+ return _regeneratorRuntime.wrap(function _callee15$(_context15) {
2653
2702
  while (1) {
2654
- switch (_context14.prev = _context14.next) {
2703
+ switch (_context15.prev = _context15.next) {
2655
2704
  case 0:
2656
- options = _args14.length > 0 && _args14[0] !== undefined ? _args14[0] : {};
2657
- _context14.next = 3;
2705
+ options = _args15.length > 0 && _args15[0] !== undefined ? _args15[0] : {};
2706
+ _context15.next = 3;
2658
2707
  return this._update(_objectSpread$9({
2659
2708
  reject_invite: true
2660
2709
  }, options));
2661
2710
 
2662
2711
  case 3:
2663
- return _context14.abrupt("return", _context14.sent);
2712
+ return _context15.abrupt("return", _context15.sent);
2664
2713
 
2665
2714
  case 4:
2666
2715
  case "end":
2667
- return _context14.stop();
2716
+ return _context15.stop();
2668
2717
  }
2669
2718
  }
2670
- }, _callee14, this);
2719
+ }, _callee15, this);
2671
2720
  }));
2672
2721
 
2673
2722
  function rejectInvite() {
@@ -2688,32 +2737,32 @@ var Channel = /*#__PURE__*/function () {
2688
2737
  }, {
2689
2738
  key: "addMembers",
2690
2739
  value: function () {
2691
- var _addMembers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(members, message) {
2740
+ var _addMembers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(members, message) {
2692
2741
  var options,
2693
- _args15 = arguments;
2694
- return _regeneratorRuntime.wrap(function _callee15$(_context15) {
2742
+ _args16 = arguments;
2743
+ return _regeneratorRuntime.wrap(function _callee16$(_context16) {
2695
2744
  while (1) {
2696
- switch (_context15.prev = _context15.next) {
2745
+ switch (_context16.prev = _context16.next) {
2697
2746
  case 0:
2698
- options = _args15.length > 2 && _args15[2] !== undefined ? _args15[2] : {};
2699
- _context15.next = 3;
2747
+ options = _args16.length > 2 && _args16[2] !== undefined ? _args16[2] : {};
2748
+ _context16.next = 3;
2700
2749
  return this._update(_objectSpread$9({
2701
2750
  add_members: members,
2702
2751
  message: message
2703
2752
  }, options));
2704
2753
 
2705
2754
  case 3:
2706
- return _context15.abrupt("return", _context15.sent);
2755
+ return _context16.abrupt("return", _context16.sent);
2707
2756
 
2708
2757
  case 4:
2709
2758
  case "end":
2710
- return _context15.stop();
2759
+ return _context16.stop();
2711
2760
  }
2712
2761
  }
2713
- }, _callee15, this);
2762
+ }, _callee16, this);
2714
2763
  }));
2715
2764
 
2716
- function addMembers(_x12, _x13) {
2765
+ function addMembers(_x14, _x15) {
2717
2766
  return _addMembers.apply(this, arguments);
2718
2767
  }
2719
2768
 
@@ -2731,32 +2780,32 @@ var Channel = /*#__PURE__*/function () {
2731
2780
  }, {
2732
2781
  key: "addModerators",
2733
2782
  value: function () {
2734
- var _addModerators = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(members, message) {
2783
+ var _addModerators = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(members, message) {
2735
2784
  var options,
2736
- _args16 = arguments;
2737
- return _regeneratorRuntime.wrap(function _callee16$(_context16) {
2785
+ _args17 = arguments;
2786
+ return _regeneratorRuntime.wrap(function _callee17$(_context17) {
2738
2787
  while (1) {
2739
- switch (_context16.prev = _context16.next) {
2788
+ switch (_context17.prev = _context17.next) {
2740
2789
  case 0:
2741
- options = _args16.length > 2 && _args16[2] !== undefined ? _args16[2] : {};
2742
- _context16.next = 3;
2790
+ options = _args17.length > 2 && _args17[2] !== undefined ? _args17[2] : {};
2791
+ _context17.next = 3;
2743
2792
  return this._update(_objectSpread$9({
2744
2793
  add_moderators: members,
2745
2794
  message: message
2746
2795
  }, options));
2747
2796
 
2748
2797
  case 3:
2749
- return _context16.abrupt("return", _context16.sent);
2798
+ return _context17.abrupt("return", _context17.sent);
2750
2799
 
2751
2800
  case 4:
2752
2801
  case "end":
2753
- return _context16.stop();
2802
+ return _context17.stop();
2754
2803
  }
2755
2804
  }
2756
- }, _callee16, this);
2805
+ }, _callee17, this);
2757
2806
  }));
2758
2807
 
2759
- function addModerators(_x14, _x15) {
2808
+ function addModerators(_x16, _x17) {
2760
2809
  return _addModerators.apply(this, arguments);
2761
2810
  }
2762
2811
 
@@ -2774,32 +2823,32 @@ var Channel = /*#__PURE__*/function () {
2774
2823
  }, {
2775
2824
  key: "assignRoles",
2776
2825
  value: function () {
2777
- var _assignRoles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(roles, message) {
2826
+ var _assignRoles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18(roles, message) {
2778
2827
  var options,
2779
- _args17 = arguments;
2780
- return _regeneratorRuntime.wrap(function _callee17$(_context17) {
2828
+ _args18 = arguments;
2829
+ return _regeneratorRuntime.wrap(function _callee18$(_context18) {
2781
2830
  while (1) {
2782
- switch (_context17.prev = _context17.next) {
2831
+ switch (_context18.prev = _context18.next) {
2783
2832
  case 0:
2784
- options = _args17.length > 2 && _args17[2] !== undefined ? _args17[2] : {};
2785
- _context17.next = 3;
2833
+ options = _args18.length > 2 && _args18[2] !== undefined ? _args18[2] : {};
2834
+ _context18.next = 3;
2786
2835
  return this._update(_objectSpread$9({
2787
2836
  assign_roles: roles,
2788
2837
  message: message
2789
2838
  }, options));
2790
2839
 
2791
2840
  case 3:
2792
- return _context17.abrupt("return", _context17.sent);
2841
+ return _context18.abrupt("return", _context18.sent);
2793
2842
 
2794
2843
  case 4:
2795
2844
  case "end":
2796
- return _context17.stop();
2845
+ return _context18.stop();
2797
2846
  }
2798
2847
  }
2799
- }, _callee17, this);
2848
+ }, _callee18, this);
2800
2849
  }));
2801
2850
 
2802
- function assignRoles(_x16, _x17) {
2851
+ function assignRoles(_x18, _x19) {
2803
2852
  return _assignRoles.apply(this, arguments);
2804
2853
  }
2805
2854
 
@@ -2817,32 +2866,32 @@ var Channel = /*#__PURE__*/function () {
2817
2866
  }, {
2818
2867
  key: "inviteMembers",
2819
2868
  value: function () {
2820
- var _inviteMembers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18(members, message) {
2869
+ var _inviteMembers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(members, message) {
2821
2870
  var options,
2822
- _args18 = arguments;
2823
- return _regeneratorRuntime.wrap(function _callee18$(_context18) {
2871
+ _args19 = arguments;
2872
+ return _regeneratorRuntime.wrap(function _callee19$(_context19) {
2824
2873
  while (1) {
2825
- switch (_context18.prev = _context18.next) {
2874
+ switch (_context19.prev = _context19.next) {
2826
2875
  case 0:
2827
- options = _args18.length > 2 && _args18[2] !== undefined ? _args18[2] : {};
2828
- _context18.next = 3;
2876
+ options = _args19.length > 2 && _args19[2] !== undefined ? _args19[2] : {};
2877
+ _context19.next = 3;
2829
2878
  return this._update(_objectSpread$9({
2830
2879
  invites: members,
2831
2880
  message: message
2832
2881
  }, options));
2833
2882
 
2834
2883
  case 3:
2835
- return _context18.abrupt("return", _context18.sent);
2884
+ return _context19.abrupt("return", _context19.sent);
2836
2885
 
2837
2886
  case 4:
2838
2887
  case "end":
2839
- return _context18.stop();
2888
+ return _context19.stop();
2840
2889
  }
2841
2890
  }
2842
- }, _callee18, this);
2891
+ }, _callee19, this);
2843
2892
  }));
2844
2893
 
2845
- function inviteMembers(_x18, _x19) {
2894
+ function inviteMembers(_x20, _x21) {
2846
2895
  return _inviteMembers.apply(this, arguments);
2847
2896
  }
2848
2897
 
@@ -2860,32 +2909,32 @@ var Channel = /*#__PURE__*/function () {
2860
2909
  }, {
2861
2910
  key: "removeMembers",
2862
2911
  value: function () {
2863
- var _removeMembers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(members, message) {
2912
+ var _removeMembers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20(members, message) {
2864
2913
  var options,
2865
- _args19 = arguments;
2866
- return _regeneratorRuntime.wrap(function _callee19$(_context19) {
2914
+ _args20 = arguments;
2915
+ return _regeneratorRuntime.wrap(function _callee20$(_context20) {
2867
2916
  while (1) {
2868
- switch (_context19.prev = _context19.next) {
2917
+ switch (_context20.prev = _context20.next) {
2869
2918
  case 0:
2870
- options = _args19.length > 2 && _args19[2] !== undefined ? _args19[2] : {};
2871
- _context19.next = 3;
2919
+ options = _args20.length > 2 && _args20[2] !== undefined ? _args20[2] : {};
2920
+ _context20.next = 3;
2872
2921
  return this._update(_objectSpread$9({
2873
2922
  remove_members: members,
2874
2923
  message: message
2875
2924
  }, options));
2876
2925
 
2877
2926
  case 3:
2878
- return _context19.abrupt("return", _context19.sent);
2927
+ return _context20.abrupt("return", _context20.sent);
2879
2928
 
2880
2929
  case 4:
2881
2930
  case "end":
2882
- return _context19.stop();
2931
+ return _context20.stop();
2883
2932
  }
2884
2933
  }
2885
- }, _callee19, this);
2934
+ }, _callee20, this);
2886
2935
  }));
2887
2936
 
2888
- function removeMembers(_x20, _x21) {
2937
+ function removeMembers(_x22, _x23) {
2889
2938
  return _removeMembers.apply(this, arguments);
2890
2939
  }
2891
2940
 
@@ -2903,32 +2952,32 @@ var Channel = /*#__PURE__*/function () {
2903
2952
  }, {
2904
2953
  key: "demoteModerators",
2905
2954
  value: function () {
2906
- var _demoteModerators = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20(members, message) {
2955
+ var _demoteModerators = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21(members, message) {
2907
2956
  var options,
2908
- _args20 = arguments;
2909
- return _regeneratorRuntime.wrap(function _callee20$(_context20) {
2957
+ _args21 = arguments;
2958
+ return _regeneratorRuntime.wrap(function _callee21$(_context21) {
2910
2959
  while (1) {
2911
- switch (_context20.prev = _context20.next) {
2960
+ switch (_context21.prev = _context21.next) {
2912
2961
  case 0:
2913
- options = _args20.length > 2 && _args20[2] !== undefined ? _args20[2] : {};
2914
- _context20.next = 3;
2962
+ options = _args21.length > 2 && _args21[2] !== undefined ? _args21[2] : {};
2963
+ _context21.next = 3;
2915
2964
  return this._update(_objectSpread$9({
2916
2965
  demote_moderators: members,
2917
2966
  message: message
2918
2967
  }, options));
2919
2968
 
2920
2969
  case 3:
2921
- return _context20.abrupt("return", _context20.sent);
2970
+ return _context21.abrupt("return", _context21.sent);
2922
2971
 
2923
2972
  case 4:
2924
2973
  case "end":
2925
- return _context20.stop();
2974
+ return _context21.stop();
2926
2975
  }
2927
2976
  }
2928
- }, _callee20, this);
2977
+ }, _callee21, this);
2929
2978
  }));
2930
2979
 
2931
- function demoteModerators(_x22, _x23) {
2980
+ function demoteModerators(_x24, _x25) {
2932
2981
  return _demoteModerators.apply(this, arguments);
2933
2982
  }
2934
2983
 
@@ -2944,29 +2993,29 @@ var Channel = /*#__PURE__*/function () {
2944
2993
  }, {
2945
2994
  key: "_update",
2946
2995
  value: function () {
2947
- var _update3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21(payload) {
2996
+ var _update3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22(payload) {
2948
2997
  var data;
2949
- return _regeneratorRuntime.wrap(function _callee21$(_context21) {
2998
+ return _regeneratorRuntime.wrap(function _callee22$(_context22) {
2950
2999
  while (1) {
2951
- switch (_context21.prev = _context21.next) {
3000
+ switch (_context22.prev = _context22.next) {
2952
3001
  case 0:
2953
- _context21.next = 2;
3002
+ _context22.next = 2;
2954
3003
  return this.getClient().post(this._channelURL(), payload);
2955
3004
 
2956
3005
  case 2:
2957
- data = _context21.sent;
3006
+ data = _context22.sent;
2958
3007
  this.data = data.channel;
2959
- return _context21.abrupt("return", data);
3008
+ return _context22.abrupt("return", data);
2960
3009
 
2961
3010
  case 5:
2962
3011
  case "end":
2963
- return _context21.stop();
3012
+ return _context22.stop();
2964
3013
  }
2965
3014
  }
2966
- }, _callee21, this);
3015
+ }, _callee22, this);
2967
3016
  }));
2968
3017
 
2969
- function _update(_x24) {
3018
+ function _update(_x26) {
2970
3019
  return _update3.apply(this, arguments);
2971
3020
  }
2972
3021
 
@@ -2988,28 +3037,28 @@ var Channel = /*#__PURE__*/function () {
2988
3037
  }, {
2989
3038
  key: "mute",
2990
3039
  value: function () {
2991
- var _mute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22() {
3040
+ var _mute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23() {
2992
3041
  var opts,
2993
- _args22 = arguments;
2994
- return _regeneratorRuntime.wrap(function _callee22$(_context22) {
3042
+ _args23 = arguments;
3043
+ return _regeneratorRuntime.wrap(function _callee23$(_context23) {
2995
3044
  while (1) {
2996
- switch (_context22.prev = _context22.next) {
3045
+ switch (_context23.prev = _context23.next) {
2997
3046
  case 0:
2998
- opts = _args22.length > 0 && _args22[0] !== undefined ? _args22[0] : {};
2999
- _context22.next = 3;
3047
+ opts = _args23.length > 0 && _args23[0] !== undefined ? _args23[0] : {};
3048
+ _context23.next = 3;
3000
3049
  return this.getClient().post(this.getClient().baseURL + '/moderation/mute/channel', _objectSpread$9({
3001
3050
  channel_cid: this.cid
3002
3051
  }, opts));
3003
3052
 
3004
3053
  case 3:
3005
- return _context22.abrupt("return", _context22.sent);
3054
+ return _context23.abrupt("return", _context23.sent);
3006
3055
 
3007
3056
  case 4:
3008
3057
  case "end":
3009
- return _context22.stop();
3058
+ return _context23.stop();
3010
3059
  }
3011
3060
  }
3012
- }, _callee22, this);
3061
+ }, _callee23, this);
3013
3062
  }));
3014
3063
 
3015
3064
  function mute() {
@@ -3030,28 +3079,28 @@ var Channel = /*#__PURE__*/function () {
3030
3079
  }, {
3031
3080
  key: "unmute",
3032
3081
  value: function () {
3033
- var _unmute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23() {
3082
+ var _unmute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24() {
3034
3083
  var opts,
3035
- _args23 = arguments;
3036
- return _regeneratorRuntime.wrap(function _callee23$(_context23) {
3084
+ _args24 = arguments;
3085
+ return _regeneratorRuntime.wrap(function _callee24$(_context24) {
3037
3086
  while (1) {
3038
- switch (_context23.prev = _context23.next) {
3087
+ switch (_context24.prev = _context24.next) {
3039
3088
  case 0:
3040
- opts = _args23.length > 0 && _args23[0] !== undefined ? _args23[0] : {};
3041
- _context23.next = 3;
3089
+ opts = _args24.length > 0 && _args24[0] !== undefined ? _args24[0] : {};
3090
+ _context24.next = 3;
3042
3091
  return this.getClient().post(this.getClient().baseURL + '/moderation/unmute/channel', _objectSpread$9({
3043
3092
  channel_cid: this.cid
3044
3093
  }, opts));
3045
3094
 
3046
3095
  case 3:
3047
- return _context23.abrupt("return", _context23.sent);
3096
+ return _context24.abrupt("return", _context24.sent);
3048
3097
 
3049
3098
  case 4:
3050
3099
  case "end":
3051
- return _context23.stop();
3100
+ return _context24.stop();
3052
3101
  }
3053
3102
  }
3054
- }, _callee23, this);
3103
+ }, _callee24, this);
3055
3104
  }));
3056
3105
 
3057
3106
  function unmute() {
@@ -3098,18 +3147,18 @@ var Channel = /*#__PURE__*/function () {
3098
3147
  }, {
3099
3148
  key: "keystroke",
3100
3149
  value: function () {
3101
- var _keystroke = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24(parent_id, options) {
3150
+ var _keystroke = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25(parent_id, options) {
3102
3151
  var now, diff;
3103
- return _regeneratorRuntime.wrap(function _callee24$(_context24) {
3152
+ return _regeneratorRuntime.wrap(function _callee25$(_context25) {
3104
3153
  while (1) {
3105
- switch (_context24.prev = _context24.next) {
3154
+ switch (_context25.prev = _context25.next) {
3106
3155
  case 0:
3107
3156
  if (this._isTypingIndicatorsEnabled()) {
3108
- _context24.next = 2;
3157
+ _context25.next = 2;
3109
3158
  break;
3110
3159
  }
3111
3160
 
3112
- return _context24.abrupt("return");
3161
+ return _context25.abrupt("return");
3113
3162
 
3114
3163
  case 2:
3115
3164
  now = new Date();
@@ -3118,12 +3167,12 @@ var Channel = /*#__PURE__*/function () {
3118
3167
  this.isTyping = true; // send a typing.start every 2 seconds
3119
3168
 
3120
3169
  if (!(diff === null || diff > 2000)) {
3121
- _context24.next = 10;
3170
+ _context25.next = 10;
3122
3171
  break;
3123
3172
  }
3124
3173
 
3125
3174
  this.lastTypingEvent = new Date();
3126
- _context24.next = 10;
3175
+ _context25.next = 10;
3127
3176
  return this.sendEvent(_objectSpread$9({
3128
3177
  type: 'typing.start',
3129
3178
  parent_id: parent_id
@@ -3131,13 +3180,13 @@ var Channel = /*#__PURE__*/function () {
3131
3180
 
3132
3181
  case 10:
3133
3182
  case "end":
3134
- return _context24.stop();
3183
+ return _context25.stop();
3135
3184
  }
3136
3185
  }
3137
- }, _callee24, this);
3186
+ }, _callee25, this);
3138
3187
  }));
3139
3188
 
3140
- function keystroke(_x25, _x26) {
3189
+ function keystroke(_x27, _x28) {
3141
3190
  return _keystroke.apply(this, arguments);
3142
3191
  }
3143
3192
 
@@ -3152,22 +3201,22 @@ var Channel = /*#__PURE__*/function () {
3152
3201
  }, {
3153
3202
  key: "stopTyping",
3154
3203
  value: function () {
3155
- var _stopTyping = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25(parent_id, options) {
3156
- return _regeneratorRuntime.wrap(function _callee25$(_context25) {
3204
+ var _stopTyping = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee26(parent_id, options) {
3205
+ return _regeneratorRuntime.wrap(function _callee26$(_context26) {
3157
3206
  while (1) {
3158
- switch (_context25.prev = _context25.next) {
3207
+ switch (_context26.prev = _context26.next) {
3159
3208
  case 0:
3160
3209
  if (this._isTypingIndicatorsEnabled()) {
3161
- _context25.next = 2;
3210
+ _context26.next = 2;
3162
3211
  break;
3163
3212
  }
3164
3213
 
3165
- return _context25.abrupt("return");
3214
+ return _context26.abrupt("return");
3166
3215
 
3167
3216
  case 2:
3168
3217
  this.lastTypingEvent = null;
3169
3218
  this.isTyping = false;
3170
- _context25.next = 6;
3219
+ _context26.next = 6;
3171
3220
  return this.sendEvent(_objectSpread$9({
3172
3221
  type: 'typing.stop',
3173
3222
  parent_id: parent_id
@@ -3175,13 +3224,13 @@ var Channel = /*#__PURE__*/function () {
3175
3224
 
3176
3225
  case 6:
3177
3226
  case "end":
3178
- return _context25.stop();
3227
+ return _context26.stop();
3179
3228
  }
3180
3229
  }
3181
- }, _callee25, this);
3230
+ }, _callee26, this);
3182
3231
  }));
3183
3232
 
3184
- function stopTyping(_x27, _x28) {
3233
+ function stopTyping(_x29, _x30) {
3185
3234
  return _stopTyping.apply(this, arguments);
3186
3235
  }
3187
3236
 
@@ -3233,39 +3282,39 @@ var Channel = /*#__PURE__*/function () {
3233
3282
  }, {
3234
3283
  key: "markRead",
3235
3284
  value: function () {
3236
- var _markRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee26() {
3285
+ var _markRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27() {
3237
3286
  var _this$getConfig2;
3238
3287
 
3239
3288
  var data,
3240
- _args26 = arguments;
3241
- return _regeneratorRuntime.wrap(function _callee26$(_context26) {
3289
+ _args27 = arguments;
3290
+ return _regeneratorRuntime.wrap(function _callee27$(_context27) {
3242
3291
  while (1) {
3243
- switch (_context26.prev = _context26.next) {
3292
+ switch (_context27.prev = _context27.next) {
3244
3293
  case 0:
3245
- data = _args26.length > 0 && _args26[0] !== undefined ? _args26[0] : {};
3294
+ data = _args27.length > 0 && _args27[0] !== undefined ? _args27[0] : {};
3246
3295
 
3247
3296
  this._checkInitialized();
3248
3297
 
3249
3298
  if (!(!((_this$getConfig2 = this.getConfig()) !== null && _this$getConfig2 !== void 0 && _this$getConfig2.read_events) && !this.getClient()._isUsingServerAuth())) {
3250
- _context26.next = 4;
3299
+ _context27.next = 4;
3251
3300
  break;
3252
3301
  }
3253
3302
 
3254
- return _context26.abrupt("return", Promise.resolve(null));
3303
+ return _context27.abrupt("return", Promise.resolve(null));
3255
3304
 
3256
3305
  case 4:
3257
- _context26.next = 6;
3306
+ _context27.next = 6;
3258
3307
  return this.getClient().post(this._channelURL() + '/read', _objectSpread$9({}, data));
3259
3308
 
3260
3309
  case 6:
3261
- return _context26.abrupt("return", _context26.sent);
3310
+ return _context27.abrupt("return", _context27.sent);
3262
3311
 
3263
3312
  case 7:
3264
3313
  case "end":
3265
- return _context26.stop();
3314
+ return _context27.stop();
3266
3315
  }
3267
3316
  }
3268
- }, _callee26, this);
3317
+ }, _callee27, this);
3269
3318
  }));
3270
3319
 
3271
3320
  function markRead() {
@@ -3284,38 +3333,38 @@ var Channel = /*#__PURE__*/function () {
3284
3333
  }, {
3285
3334
  key: "markUnread",
3286
3335
  value: function () {
3287
- var _markUnread = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27(data) {
3336
+ var _markUnread = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee28(data) {
3288
3337
  var _this$getConfig3;
3289
3338
 
3290
- return _regeneratorRuntime.wrap(function _callee27$(_context27) {
3339
+ return _regeneratorRuntime.wrap(function _callee28$(_context28) {
3291
3340
  while (1) {
3292
- switch (_context27.prev = _context27.next) {
3341
+ switch (_context28.prev = _context28.next) {
3293
3342
  case 0:
3294
3343
  this._checkInitialized();
3295
3344
 
3296
3345
  if (!(!((_this$getConfig3 = this.getConfig()) !== null && _this$getConfig3 !== void 0 && _this$getConfig3.read_events) && !this.getClient()._isUsingServerAuth())) {
3297
- _context27.next = 3;
3346
+ _context28.next = 3;
3298
3347
  break;
3299
3348
  }
3300
3349
 
3301
- return _context27.abrupt("return", Promise.resolve(null));
3350
+ return _context28.abrupt("return", Promise.resolve(null));
3302
3351
 
3303
3352
  case 3:
3304
- _context27.next = 5;
3353
+ _context28.next = 5;
3305
3354
  return this.getClient().post(this._channelURL() + '/unread', _objectSpread$9({}, data));
3306
3355
 
3307
3356
  case 5:
3308
- return _context27.abrupt("return", _context27.sent);
3357
+ return _context28.abrupt("return", _context28.sent);
3309
3358
 
3310
3359
  case 6:
3311
3360
  case "end":
3312
- return _context27.stop();
3361
+ return _context28.stop();
3313
3362
  }
3314
3363
  }
3315
- }, _callee27, this);
3364
+ }, _callee28, this);
3316
3365
  }));
3317
3366
 
3318
- function markUnread(_x29) {
3367
+ function markUnread(_x31) {
3319
3368
  return _markUnread.apply(this, arguments);
3320
3369
  }
3321
3370
 
@@ -3350,11 +3399,11 @@ var Channel = /*#__PURE__*/function () {
3350
3399
  }, {
3351
3400
  key: "watch",
3352
3401
  value: function () {
3353
- var _watch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee28(options) {
3402
+ var _watch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee29(options) {
3354
3403
  var defaultOptions, combined, state;
3355
- return _regeneratorRuntime.wrap(function _callee28$(_context28) {
3404
+ return _regeneratorRuntime.wrap(function _callee29$(_context29) {
3356
3405
  while (1) {
3357
- switch (_context28.prev = _context28.next) {
3406
+ switch (_context29.prev = _context29.next) {
3358
3407
  case 0:
3359
3408
  defaultOptions = {
3360
3409
  state: true,
@@ -3362,7 +3411,7 @@ var Channel = /*#__PURE__*/function () {
3362
3411
  presence: false
3363
3412
  }; // Make sure we wait for the connect promise if there is a pending one
3364
3413
 
3365
- _context28.next = 3;
3414
+ _context29.next = 3;
3366
3415
  return this.getClient().wsPromise;
3367
3416
 
3368
3417
  case 3:
@@ -3371,11 +3420,11 @@ var Channel = /*#__PURE__*/function () {
3371
3420
  }
3372
3421
 
3373
3422
  combined = _objectSpread$9(_objectSpread$9({}, defaultOptions), options);
3374
- _context28.next = 7;
3423
+ _context29.next = 7;
3375
3424
  return this.query(combined, 'latest');
3376
3425
 
3377
3426
  case 7:
3378
- state = _context28.sent;
3427
+ state = _context29.sent;
3379
3428
  this.initialized = true;
3380
3429
  this.data = state.channel;
3381
3430
 
@@ -3384,17 +3433,17 @@ var Channel = /*#__PURE__*/function () {
3384
3433
  channel: this
3385
3434
  });
3386
3435
 
3387
- return _context28.abrupt("return", state);
3436
+ return _context29.abrupt("return", state);
3388
3437
 
3389
3438
  case 12:
3390
3439
  case "end":
3391
- return _context28.stop();
3440
+ return _context29.stop();
3392
3441
  }
3393
3442
  }
3394
- }, _callee28, this);
3443
+ }, _callee29, this);
3395
3444
  }));
3396
3445
 
3397
- function watch(_x30) {
3446
+ function watch(_x32) {
3398
3447
  return _watch.apply(this, arguments);
3399
3448
  }
3400
3449
 
@@ -3409,31 +3458,31 @@ var Channel = /*#__PURE__*/function () {
3409
3458
  }, {
3410
3459
  key: "stopWatching",
3411
3460
  value: function () {
3412
- var _stopWatching = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee29() {
3461
+ var _stopWatching = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30() {
3413
3462
  var response;
3414
- return _regeneratorRuntime.wrap(function _callee29$(_context29) {
3463
+ return _regeneratorRuntime.wrap(function _callee30$(_context30) {
3415
3464
  while (1) {
3416
- switch (_context29.prev = _context29.next) {
3465
+ switch (_context30.prev = _context30.next) {
3417
3466
  case 0:
3418
- _context29.next = 2;
3467
+ _context30.next = 2;
3419
3468
  return this.getClient().post(this._channelURL() + '/stop-watching', {});
3420
3469
 
3421
3470
  case 2:
3422
- response = _context29.sent;
3471
+ response = _context30.sent;
3423
3472
 
3424
3473
  this._client.logger('info', "channel:watch() - stopped watching channel ".concat(this.cid), {
3425
3474
  tags: ['channel'],
3426
3475
  channel: this
3427
3476
  });
3428
3477
 
3429
- return _context29.abrupt("return", response);
3478
+ return _context30.abrupt("return", response);
3430
3479
 
3431
3480
  case 5:
3432
3481
  case "end":
3433
- return _context29.stop();
3482
+ return _context30.stop();
3434
3483
  }
3435
3484
  }
3436
- }, _callee29, this);
3485
+ }, _callee30, this);
3437
3486
  }));
3438
3487
 
3439
3488
  function stopWatching() {
@@ -3456,37 +3505,37 @@ var Channel = /*#__PURE__*/function () {
3456
3505
  }, {
3457
3506
  key: "getReplies",
3458
3507
  value: function () {
3459
- var _getReplies = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30(parent_id, options, sort) {
3508
+ var _getReplies = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31(parent_id, options, sort) {
3460
3509
  var normalizedSort, data;
3461
- return _regeneratorRuntime.wrap(function _callee30$(_context30) {
3510
+ return _regeneratorRuntime.wrap(function _callee31$(_context31) {
3462
3511
  while (1) {
3463
- switch (_context30.prev = _context30.next) {
3512
+ switch (_context31.prev = _context31.next) {
3464
3513
  case 0:
3465
3514
  normalizedSort = sort ? normalizeQuerySort(sort) : undefined;
3466
- _context30.next = 3;
3515
+ _context31.next = 3;
3467
3516
  return this.getClient().get(this.getClient().baseURL + "/messages/".concat(encodeURIComponent(parent_id), "/replies"), _objectSpread$9({
3468
3517
  sort: normalizedSort
3469
3518
  }, options));
3470
3519
 
3471
3520
  case 3:
3472
- data = _context30.sent;
3521
+ data = _context31.sent;
3473
3522
 
3474
3523
  // add any messages to our thread state
3475
3524
  if (data.messages) {
3476
3525
  this.state.addMessagesSorted(data.messages);
3477
3526
  }
3478
3527
 
3479
- return _context30.abrupt("return", data);
3528
+ return _context31.abrupt("return", data);
3480
3529
 
3481
3530
  case 6:
3482
3531
  case "end":
3483
- return _context30.stop();
3532
+ return _context31.stop();
3484
3533
  }
3485
3534
  }
3486
- }, _callee30, this);
3535
+ }, _callee31, this);
3487
3536
  }));
3488
3537
 
3489
- function getReplies(_x31, _x32, _x33) {
3538
+ function getReplies(_x33, _x34, _x35) {
3490
3539
  return _getReplies.apply(this, arguments);
3491
3540
  }
3492
3541
 
@@ -3504,15 +3553,15 @@ var Channel = /*#__PURE__*/function () {
3504
3553
  }, {
3505
3554
  key: "getPinnedMessages",
3506
3555
  value: function () {
3507
- var _getPinnedMessages = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31(options) {
3556
+ var _getPinnedMessages = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee32(options) {
3508
3557
  var sort,
3509
- _args31 = arguments;
3510
- return _regeneratorRuntime.wrap(function _callee31$(_context31) {
3558
+ _args32 = arguments;
3559
+ return _regeneratorRuntime.wrap(function _callee32$(_context32) {
3511
3560
  while (1) {
3512
- switch (_context31.prev = _context31.next) {
3561
+ switch (_context32.prev = _context32.next) {
3513
3562
  case 0:
3514
- sort = _args31.length > 1 && _args31[1] !== undefined ? _args31[1] : [];
3515
- _context31.next = 3;
3563
+ sort = _args32.length > 1 && _args32[1] !== undefined ? _args32[1] : [];
3564
+ _context32.next = 3;
3516
3565
  return this.getClient().get(this._channelURL() + '/pinned_messages', {
3517
3566
  payload: _objectSpread$9(_objectSpread$9({}, options), {}, {
3518
3567
  sort: normalizeQuerySort(sort)
@@ -3520,17 +3569,17 @@ var Channel = /*#__PURE__*/function () {
3520
3569
  });
3521
3570
 
3522
3571
  case 3:
3523
- return _context31.abrupt("return", _context31.sent);
3572
+ return _context32.abrupt("return", _context32.sent);
3524
3573
 
3525
3574
  case 4:
3526
3575
  case "end":
3527
- return _context31.stop();
3576
+ return _context32.stop();
3528
3577
  }
3529
3578
  }
3530
- }, _callee31, this);
3579
+ }, _callee32, this);
3531
3580
  }));
3532
3581
 
3533
- function getPinnedMessages(_x34) {
3582
+ function getPinnedMessages(_x36) {
3534
3583
  return _getPinnedMessages.apply(this, arguments);
3535
3584
  }
3536
3585
 
@@ -3666,7 +3715,7 @@ var Channel = /*#__PURE__*/function () {
3666
3715
  * @return {Promise<QueryChannelAPIResponse<StreamChatGenerics>>} Returns a query response
3667
3716
  */
3668
3717
  function () {
3669
- var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee32(options) {
3718
+ var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee33(options) {
3670
3719
  var _options$messages$lim, _options$messages, _this$data6, _this$data7;
3671
3720
 
3672
3721
  var messageSetToAddToIfDoesNotExist,
@@ -3677,14 +3726,14 @@ var Channel = /*#__PURE__*/function () {
3677
3726
  _this$_initializeStat,
3678
3727
  messageSet,
3679
3728
  areCapabilitiesChanged,
3680
- _args32 = arguments;
3729
+ _args33 = arguments;
3681
3730
 
3682
- return _regeneratorRuntime.wrap(function _callee32$(_context32) {
3731
+ return _regeneratorRuntime.wrap(function _callee33$(_context33) {
3683
3732
  while (1) {
3684
- switch (_context32.prev = _context32.next) {
3733
+ switch (_context33.prev = _context33.next) {
3685
3734
  case 0:
3686
- messageSetToAddToIfDoesNotExist = _args32.length > 1 && _args32[1] !== undefined ? _args32[1] : 'current';
3687
- _context32.next = 3;
3735
+ messageSetToAddToIfDoesNotExist = _args33.length > 1 && _args33[1] !== undefined ? _args33[1] : 'current';
3736
+ _context33.next = 3;
3688
3737
  return this.getClient().wsPromise;
3689
3738
 
3690
3739
  case 3:
@@ -3694,14 +3743,14 @@ var Channel = /*#__PURE__*/function () {
3694
3743
  queryURL += "/".concat(encodeURIComponent(this.id));
3695
3744
  }
3696
3745
 
3697
- _context32.next = 7;
3746
+ _context33.next = 7;
3698
3747
  return this.getClient().post(queryURL + '/query', _objectSpread$9({
3699
3748
  data: this._data,
3700
3749
  state: true
3701
3750
  }, options));
3702
3751
 
3703
3752
  case 7:
3704
- state = _context32.sent;
3753
+ state = _context33.sent;
3705
3754
 
3706
3755
  // update the channel id if it was missing
3707
3756
  if (!this.id) {
@@ -3756,17 +3805,17 @@ var Channel = /*#__PURE__*/function () {
3756
3805
  isLatestMessageSet: messageSet.isLatest
3757
3806
  }
3758
3807
  });
3759
- return _context32.abrupt("return", state);
3808
+ return _context33.abrupt("return", state);
3760
3809
 
3761
3810
  case 18:
3762
3811
  case "end":
3763
- return _context32.stop();
3812
+ return _context33.stop();
3764
3813
  }
3765
3814
  }
3766
- }, _callee32, this);
3815
+ }, _callee33, this);
3767
3816
  }));
3768
3817
 
3769
- function query(_x35) {
3818
+ function query(_x37) {
3770
3819
  return _query.apply(this, arguments);
3771
3820
  }
3772
3821
 
@@ -3783,31 +3832,31 @@ var Channel = /*#__PURE__*/function () {
3783
3832
  }, {
3784
3833
  key: "banUser",
3785
3834
  value: function () {
3786
- var _banUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee33(targetUserID, options) {
3787
- return _regeneratorRuntime.wrap(function _callee33$(_context33) {
3835
+ var _banUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee34(targetUserID, options) {
3836
+ return _regeneratorRuntime.wrap(function _callee34$(_context34) {
3788
3837
  while (1) {
3789
- switch (_context33.prev = _context33.next) {
3838
+ switch (_context34.prev = _context34.next) {
3790
3839
  case 0:
3791
3840
  this._checkInitialized();
3792
3841
 
3793
- _context33.next = 3;
3842
+ _context34.next = 3;
3794
3843
  return this.getClient().banUser(targetUserID, _objectSpread$9(_objectSpread$9({}, options), {}, {
3795
3844
  type: this.type,
3796
3845
  id: this.id
3797
3846
  }));
3798
3847
 
3799
3848
  case 3:
3800
- return _context33.abrupt("return", _context33.sent);
3849
+ return _context34.abrupt("return", _context34.sent);
3801
3850
 
3802
3851
  case 4:
3803
3852
  case "end":
3804
- return _context33.stop();
3853
+ return _context34.stop();
3805
3854
  }
3806
3855
  }
3807
- }, _callee33, this);
3856
+ }, _callee34, this);
3808
3857
  }));
3809
3858
 
3810
- function banUser(_x36, _x37) {
3859
+ function banUser(_x38, _x39) {
3811
3860
  return _banUser.apply(this, arguments);
3812
3861
  }
3813
3862
 
@@ -3825,34 +3874,34 @@ var Channel = /*#__PURE__*/function () {
3825
3874
  }, {
3826
3875
  key: "hide",
3827
3876
  value: function () {
3828
- var _hide = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee34() {
3877
+ var _hide = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee35() {
3829
3878
  var userId,
3830
3879
  clearHistory,
3831
- _args34 = arguments;
3832
- return _regeneratorRuntime.wrap(function _callee34$(_context34) {
3880
+ _args35 = arguments;
3881
+ return _regeneratorRuntime.wrap(function _callee35$(_context35) {
3833
3882
  while (1) {
3834
- switch (_context34.prev = _context34.next) {
3883
+ switch (_context35.prev = _context35.next) {
3835
3884
  case 0:
3836
- userId = _args34.length > 0 && _args34[0] !== undefined ? _args34[0] : null;
3837
- clearHistory = _args34.length > 1 && _args34[1] !== undefined ? _args34[1] : false;
3885
+ userId = _args35.length > 0 && _args35[0] !== undefined ? _args35[0] : null;
3886
+ clearHistory = _args35.length > 1 && _args35[1] !== undefined ? _args35[1] : false;
3838
3887
 
3839
3888
  this._checkInitialized();
3840
3889
 
3841
- _context34.next = 5;
3890
+ _context35.next = 5;
3842
3891
  return this.getClient().post("".concat(this._channelURL(), "/hide"), {
3843
3892
  user_id: userId,
3844
3893
  clear_history: clearHistory
3845
3894
  });
3846
3895
 
3847
3896
  case 5:
3848
- return _context34.abrupt("return", _context34.sent);
3897
+ return _context35.abrupt("return", _context35.sent);
3849
3898
 
3850
3899
  case 6:
3851
3900
  case "end":
3852
- return _context34.stop();
3901
+ return _context35.stop();
3853
3902
  }
3854
3903
  }
3855
- }, _callee34, this);
3904
+ }, _callee35, this);
3856
3905
  }));
3857
3906
 
3858
3907
  function hide() {
@@ -3871,31 +3920,31 @@ var Channel = /*#__PURE__*/function () {
3871
3920
  }, {
3872
3921
  key: "show",
3873
3922
  value: function () {
3874
- var _show = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee35() {
3923
+ var _show = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee36() {
3875
3924
  var userId,
3876
- _args35 = arguments;
3877
- return _regeneratorRuntime.wrap(function _callee35$(_context35) {
3925
+ _args36 = arguments;
3926
+ return _regeneratorRuntime.wrap(function _callee36$(_context36) {
3878
3927
  while (1) {
3879
- switch (_context35.prev = _context35.next) {
3928
+ switch (_context36.prev = _context36.next) {
3880
3929
  case 0:
3881
- userId = _args35.length > 0 && _args35[0] !== undefined ? _args35[0] : null;
3930
+ userId = _args36.length > 0 && _args36[0] !== undefined ? _args36[0] : null;
3882
3931
 
3883
3932
  this._checkInitialized();
3884
3933
 
3885
- _context35.next = 4;
3934
+ _context36.next = 4;
3886
3935
  return this.getClient().post("".concat(this._channelURL(), "/show"), {
3887
3936
  user_id: userId
3888
3937
  });
3889
3938
 
3890
3939
  case 4:
3891
- return _context35.abrupt("return", _context35.sent);
3940
+ return _context36.abrupt("return", _context36.sent);
3892
3941
 
3893
3942
  case 5:
3894
3943
  case "end":
3895
- return _context35.stop();
3944
+ return _context36.stop();
3896
3945
  }
3897
3946
  }
3898
- }, _callee35, this);
3947
+ }, _callee36, this);
3899
3948
  }));
3900
3949
 
3901
3950
  function show() {
@@ -3914,31 +3963,31 @@ var Channel = /*#__PURE__*/function () {
3914
3963
  }, {
3915
3964
  key: "unbanUser",
3916
3965
  value: function () {
3917
- var _unbanUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee36(targetUserID) {
3918
- return _regeneratorRuntime.wrap(function _callee36$(_context36) {
3966
+ var _unbanUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee37(targetUserID) {
3967
+ return _regeneratorRuntime.wrap(function _callee37$(_context37) {
3919
3968
  while (1) {
3920
- switch (_context36.prev = _context36.next) {
3969
+ switch (_context37.prev = _context37.next) {
3921
3970
  case 0:
3922
3971
  this._checkInitialized();
3923
3972
 
3924
- _context36.next = 3;
3973
+ _context37.next = 3;
3925
3974
  return this.getClient().unbanUser(targetUserID, {
3926
3975
  type: this.type,
3927
3976
  id: this.id
3928
3977
  });
3929
3978
 
3930
3979
  case 3:
3931
- return _context36.abrupt("return", _context36.sent);
3980
+ return _context37.abrupt("return", _context37.sent);
3932
3981
 
3933
3982
  case 4:
3934
3983
  case "end":
3935
- return _context36.stop();
3984
+ return _context37.stop();
3936
3985
  }
3937
3986
  }
3938
- }, _callee36, this);
3987
+ }, _callee37, this);
3939
3988
  }));
3940
3989
 
3941
- function unbanUser(_x38) {
3990
+ function unbanUser(_x40) {
3942
3991
  return _unbanUser.apply(this, arguments);
3943
3992
  }
3944
3993
 
@@ -3955,31 +4004,31 @@ var Channel = /*#__PURE__*/function () {
3955
4004
  }, {
3956
4005
  key: "shadowBan",
3957
4006
  value: function () {
3958
- var _shadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee37(targetUserID, options) {
3959
- return _regeneratorRuntime.wrap(function _callee37$(_context37) {
4007
+ var _shadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee38(targetUserID, options) {
4008
+ return _regeneratorRuntime.wrap(function _callee38$(_context38) {
3960
4009
  while (1) {
3961
- switch (_context37.prev = _context37.next) {
4010
+ switch (_context38.prev = _context38.next) {
3962
4011
  case 0:
3963
4012
  this._checkInitialized();
3964
4013
 
3965
- _context37.next = 3;
4014
+ _context38.next = 3;
3966
4015
  return this.getClient().shadowBan(targetUserID, _objectSpread$9(_objectSpread$9({}, options), {}, {
3967
4016
  type: this.type,
3968
4017
  id: this.id
3969
4018
  }));
3970
4019
 
3971
4020
  case 3:
3972
- return _context37.abrupt("return", _context37.sent);
4021
+ return _context38.abrupt("return", _context38.sent);
3973
4022
 
3974
4023
  case 4:
3975
4024
  case "end":
3976
- return _context37.stop();
4025
+ return _context38.stop();
3977
4026
  }
3978
4027
  }
3979
- }, _callee37, this);
4028
+ }, _callee38, this);
3980
4029
  }));
3981
4030
 
3982
- function shadowBan(_x39, _x40) {
4031
+ function shadowBan(_x41, _x42) {
3983
4032
  return _shadowBan.apply(this, arguments);
3984
4033
  }
3985
4034
 
@@ -3995,31 +4044,31 @@ var Channel = /*#__PURE__*/function () {
3995
4044
  }, {
3996
4045
  key: "removeShadowBan",
3997
4046
  value: function () {
3998
- var _removeShadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee38(targetUserID) {
3999
- return _regeneratorRuntime.wrap(function _callee38$(_context38) {
4047
+ var _removeShadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee39(targetUserID) {
4048
+ return _regeneratorRuntime.wrap(function _callee39$(_context39) {
4000
4049
  while (1) {
4001
- switch (_context38.prev = _context38.next) {
4050
+ switch (_context39.prev = _context39.next) {
4002
4051
  case 0:
4003
4052
  this._checkInitialized();
4004
4053
 
4005
- _context38.next = 3;
4054
+ _context39.next = 3;
4006
4055
  return this.getClient().removeShadowBan(targetUserID, {
4007
4056
  type: this.type,
4008
4057
  id: this.id
4009
4058
  });
4010
4059
 
4011
4060
  case 3:
4012
- return _context38.abrupt("return", _context38.sent);
4061
+ return _context39.abrupt("return", _context39.sent);
4013
4062
 
4014
4063
  case 4:
4015
4064
  case "end":
4016
- return _context38.stop();
4065
+ return _context39.stop();
4017
4066
  }
4018
4067
  }
4019
- }, _callee38, this);
4068
+ }, _callee39, this);
4020
4069
  }));
4021
4070
 
4022
- function removeShadowBan(_x41) {
4071
+ function removeShadowBan(_x43) {
4023
4072
  return _removeShadowBan.apply(this, arguments);
4024
4073
  }
4025
4074
 
@@ -4035,26 +4084,26 @@ var Channel = /*#__PURE__*/function () {
4035
4084
  }, {
4036
4085
  key: "createCall",
4037
4086
  value: function () {
4038
- var _createCall = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee39(options) {
4039
- return _regeneratorRuntime.wrap(function _callee39$(_context39) {
4087
+ var _createCall = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee40(options) {
4088
+ return _regeneratorRuntime.wrap(function _callee40$(_context40) {
4040
4089
  while (1) {
4041
- switch (_context39.prev = _context39.next) {
4090
+ switch (_context40.prev = _context40.next) {
4042
4091
  case 0:
4043
- _context39.next = 2;
4092
+ _context40.next = 2;
4044
4093
  return this.getClient().post(this._channelURL() + '/call', options);
4045
4094
 
4046
4095
  case 2:
4047
- return _context39.abrupt("return", _context39.sent);
4096
+ return _context40.abrupt("return", _context40.sent);
4048
4097
 
4049
4098
  case 3:
4050
4099
  case "end":
4051
- return _context39.stop();
4100
+ return _context40.stop();
4052
4101
  }
4053
4102
  }
4054
- }, _callee39, this);
4103
+ }, _callee40, this);
4055
4104
  }));
4056
4105
 
4057
- function createCall(_x42) {
4106
+ function createCall(_x44) {
4058
4107
  return _createCall.apply(this, arguments);
4059
4108
  }
4060
4109
 
@@ -4070,26 +4119,26 @@ var Channel = /*#__PURE__*/function () {
4070
4119
  }, {
4071
4120
  key: "vote",
4072
4121
  value: function () {
4073
- var _vote2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee40(messageId, pollId, _vote) {
4074
- return _regeneratorRuntime.wrap(function _callee40$(_context40) {
4122
+ var _vote2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee41(messageId, pollId, _vote) {
4123
+ return _regeneratorRuntime.wrap(function _callee41$(_context41) {
4075
4124
  while (1) {
4076
- switch (_context40.prev = _context40.next) {
4125
+ switch (_context41.prev = _context41.next) {
4077
4126
  case 0:
4078
- _context40.next = 2;
4127
+ _context41.next = 2;
4079
4128
  return this.getClient().castPollVote(messageId, pollId, _vote);
4080
4129
 
4081
4130
  case 2:
4082
- return _context40.abrupt("return", _context40.sent);
4131
+ return _context41.abrupt("return", _context41.sent);
4083
4132
 
4084
4133
  case 3:
4085
4134
  case "end":
4086
- return _context40.stop();
4135
+ return _context41.stop();
4087
4136
  }
4088
4137
  }
4089
- }, _callee40, this);
4138
+ }, _callee41, this);
4090
4139
  }));
4091
4140
 
4092
- function vote(_x43, _x44, _x45) {
4141
+ function vote(_x45, _x46, _x47) {
4093
4142
  return _vote2.apply(this, arguments);
4094
4143
  }
4095
4144
 
@@ -4098,26 +4147,26 @@ var Channel = /*#__PURE__*/function () {
4098
4147
  }, {
4099
4148
  key: "removeVote",
4100
4149
  value: function () {
4101
- var _removeVote = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee41(messageId, pollId, voteId) {
4102
- return _regeneratorRuntime.wrap(function _callee41$(_context41) {
4150
+ var _removeVote = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42(messageId, pollId, voteId) {
4151
+ return _regeneratorRuntime.wrap(function _callee42$(_context42) {
4103
4152
  while (1) {
4104
- switch (_context41.prev = _context41.next) {
4153
+ switch (_context42.prev = _context42.next) {
4105
4154
  case 0:
4106
- _context41.next = 2;
4155
+ _context42.next = 2;
4107
4156
  return this.getClient().removePollVote(messageId, pollId, voteId);
4108
4157
 
4109
4158
  case 2:
4110
- return _context41.abrupt("return", _context41.sent);
4159
+ return _context42.abrupt("return", _context42.sent);
4111
4160
 
4112
4161
  case 3:
4113
4162
  case "end":
4114
- return _context41.stop();
4163
+ return _context42.stop();
4115
4164
  }
4116
4165
  }
4117
- }, _callee41, this);
4166
+ }, _callee42, this);
4118
4167
  }));
4119
4168
 
4120
- function removeVote(_x46, _x47, _x48) {
4169
+ function removeVote(_x48, _x49, _x50) {
4121
4170
  return _removeVote.apply(this, arguments);
4122
4171
  }
4123
4172
 
@@ -4658,13 +4707,7 @@ var Channel = /*#__PURE__*/function () {
4658
4707
  }
4659
4708
 
4660
4709
  if (state.members) {
4661
- this.state.members = state.members.reduce(function (acc, member) {
4662
- if (member.user) {
4663
- acc[member.user.id] = member;
4664
- }
4665
-
4666
- return acc;
4667
- }, {});
4710
+ this._hydrateMembers(state.members);
4668
4711
  }
4669
4712
 
4670
4713
  return {
@@ -4684,6 +4727,17 @@ var Channel = /*#__PURE__*/function () {
4684
4727
  event.message.own_reactions = message.own_reactions;
4685
4728
  }
4686
4729
  }
4730
+ }, {
4731
+ key: "_hydrateMembers",
4732
+ value: function _hydrateMembers(members) {
4733
+ this.state.members = members.reduce(function (acc, member) {
4734
+ if (member.user) {
4735
+ acc[member.user.id] = member;
4736
+ }
4737
+
4738
+ return acc;
4739
+ }, {});
4740
+ }
4687
4741
  }, {
4688
4742
  key: "_disconnect",
4689
4743
  value: function _disconnect() {
@@ -7835,9 +7889,17 @@ var Thread = /*#__PURE__*/function () {
7835
7889
  };
7836
7890
  }());
7837
7891
 
7892
+ var _channel = client.channel(threadData.channel.type, threadData.channel.id, {
7893
+ name: threadData.channel.name
7894
+ });
7895
+
7896
+ if (threadData.channel.members) {
7897
+ _channel._hydrateMembers(threadData.channel.members);
7898
+ }
7899
+
7838
7900
  this.state = new StateStore({
7839
7901
  active: false,
7840
- channel: client.channel(threadData.channel.type, threadData.channel.id),
7902
+ channel: _channel,
7841
7903
  createdAt: new Date(threadData.created_at),
7842
7904
  deletedAt: threadData.deleted_at ? new Date(threadData.deleted_at) : null,
7843
7905
  isLoading: false,
@@ -13269,7 +13331,7 @@ var StreamChat = /*#__PURE__*/function () {
13269
13331
  }, {
13270
13332
  key: "getUserAgent",
13271
13333
  value: function getUserAgent() {
13272
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.40.2");
13334
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.40.4");
13273
13335
  }
13274
13336
  }, {
13275
13337
  key: "setUserAgent",