stream-chat 9.47.1 → 9.48.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.
@@ -7435,6 +7435,7 @@ var Thread = class extends WithSubscriptions {
7435
7435
  this.addUnsubscribeFunction(this.subscribeMarkThreadStale());
7436
7436
  this.addUnsubscribeFunction(this.subscribeNewReplies());
7437
7437
  this.addUnsubscribeFunction(this.subscribeRepliesRead());
7438
+ this.addUnsubscribeFunction(this.subscribeRepliesUnread());
7438
7439
  this.addUnsubscribeFunction(this.subscribeMessageDeleted());
7439
7440
  this.addUnsubscribeFunction(this.subscribeMessageUpdated());
7440
7441
  };
@@ -7476,6 +7477,26 @@ var Thread = class extends WithSubscriptions {
7476
7477
  }
7477
7478
  this.state.partialNext({ isStateStale: true });
7478
7479
  }).unsubscribe;
7480
+ this.subscribeRepliesUnread = () => this.client.on("notification.mark_unread", (event) => {
7481
+ if (!event.user || !event.created_at || !event.thread_id) return;
7482
+ if (event.thread_id !== this.id) return;
7483
+ const userId = event.user.id;
7484
+ const createdAt = event.created_at;
7485
+ const user = event.user;
7486
+ this.state.next((current) => ({
7487
+ ...current,
7488
+ read: {
7489
+ ...current.read,
7490
+ [userId]: {
7491
+ ...current.read[userId],
7492
+ lastReadAt: typeof event.last_read_at !== "undefined" ? new Date(event.last_read_at) : new Date(createdAt),
7493
+ user,
7494
+ firstUnreadMessageId: event.first_unread_message_id,
7495
+ unreadMessageCount: event.unread_messages ?? 0
7496
+ }
7497
+ }
7498
+ }));
7499
+ }).unsubscribe;
7479
7500
  this.subscribeNewReplies = () => this.client.on("message.new", (event) => {
7480
7501
  if (!this.client.userID || event.message?.parent_id !== this.id) {
7481
7502
  return;
@@ -12403,6 +12424,7 @@ var ThreadManager = class extends WithSubscriptions {
12403
12424
  const unsubscribeFunctions = [
12404
12425
  "health.check",
12405
12426
  "notification.mark_read",
12427
+ "notification.mark_unread",
12406
12428
  "notification.thread_message_new",
12407
12429
  "notification.channel_deleted"
12408
12430
  ].map(
@@ -16537,7 +16559,7 @@ var StreamChat = class _StreamChat {
16537
16559
  if (this.userAgent) {
16538
16560
  return this.userAgent;
16539
16561
  }
16540
- const version = "9.47.1";
16562
+ const version = "9.48.0";
16541
16563
  const clientBundle = "browser-esm";
16542
16564
  let userAgentString = "";
16543
16565
  if (this.sdkIdentifier) {