stream-chat 9.48.0 → 9.49.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.
@@ -14827,6 +14827,31 @@ var StreamChat = class _StreamChat {
14827
14827
  * @return {Promise<APIResponse>}
14828
14828
  */
14829
14829
  this.markAllRead = this.markChannelsRead;
14830
+ this.getUserAgent = () => {
14831
+ if (this.userAgent) {
14832
+ return this.userAgent;
14833
+ }
14834
+ if (!this.cachedUserAgent) {
14835
+ const version = "9.49.0";
14836
+ const { name: sdkName, version: sdkVersion } = this.sdkIdentifier ?? {};
14837
+ const { name: appName, version: appVersion } = this.appIdentifier ?? {};
14838
+ const { os, model: deviceModel } = this.deviceIdentifier ?? {};
14839
+ const head = sdkName ? `stream-chat-${sdkName}-v${sdkVersion}-llc-v${version}` : `stream-chat-js-v${version}-${this.node ? "node" : "browser"}`;
14840
+ this.cachedUserAgent = [
14841
+ head,
14842
+ // reports the host app, the device OS, the device model, and the picked
14843
+ // exports bundle, each only when a value is present
14844
+ ...Object.entries({
14845
+ app: appName,
14846
+ app_version: appVersion,
14847
+ os,
14848
+ device_model: deviceModel,
14849
+ client_bundle: "browser-cjs"
14850
+ }).filter(([, value]) => value && value.length > 0).map(([key, value]) => `${key}=${value}`)
14851
+ ].join("|");
14852
+ }
14853
+ return this.cachedUserAgent;
14854
+ };
14830
14855
  /**
14831
14856
  * _isUsingServerAuth - Returns true if we're using server side auth
14832
14857
  */
@@ -15279,6 +15304,13 @@ var StreamChat = class _StreamChat {
15279
15304
  delete this.activeChannels[cid];
15280
15305
  });
15281
15306
  }
15307
+ if (event.type === "notification.removed_from_channel" && event.cid) {
15308
+ const { cid } = event;
15309
+ this.activeChannels[cid]?._disconnect();
15310
+ postListenerCallbacks.push(() => {
15311
+ delete this.activeChannels[cid];
15312
+ });
15313
+ }
15282
15314
  return postListenerCallbacks;
15283
15315
  }
15284
15316
  _muteStatus(cid) {
@@ -16770,31 +16802,6 @@ var StreamChat = class _StreamChat {
16770
16802
  partialThreadObject
16771
16803
  );
16772
16804
  }
16773
- getUserAgent() {
16774
- if (this.userAgent) {
16775
- return this.userAgent;
16776
- }
16777
- const version = "9.48.0";
16778
- const clientBundle = "browser-cjs";
16779
- let userAgentString = "";
16780
- if (this.sdkIdentifier) {
16781
- userAgentString = `stream-chat-${this.sdkIdentifier.name}-v${this.sdkIdentifier.version}-llc-v${version}`;
16782
- } else {
16783
- userAgentString = `stream-chat-js-v${version}-${this.node ? "node" : "browser"}`;
16784
- }
16785
- const { os, model } = this.deviceIdentifier ?? {};
16786
- return [
16787
- // reports the device OS, if provided
16788
- ["os", os],
16789
- // reports the device model, if provided
16790
- ["device_model", model],
16791
- // reports which bundle is being picked from the exports
16792
- ["client_bundle", clientBundle]
16793
- ].reduce(
16794
- (withArguments, [key, value]) => value && value.length > 0 ? withArguments.concat(`|${key}=${value}`) : withArguments,
16795
- userAgentString
16796
- );
16797
- }
16798
16805
  /**
16799
16806
  * @deprecated use sdkIdentifier instead
16800
16807
  * @param userAgent