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.
@@ -7619,6 +7619,7 @@ var Thread = class extends WithSubscriptions {
7619
7619
  this.addUnsubscribeFunction(this.subscribeMarkThreadStale());
7620
7620
  this.addUnsubscribeFunction(this.subscribeNewReplies());
7621
7621
  this.addUnsubscribeFunction(this.subscribeRepliesRead());
7622
+ this.addUnsubscribeFunction(this.subscribeRepliesUnread());
7622
7623
  this.addUnsubscribeFunction(this.subscribeMessageDeleted());
7623
7624
  this.addUnsubscribeFunction(this.subscribeMessageUpdated());
7624
7625
  };
@@ -7660,6 +7661,26 @@ var Thread = class extends WithSubscriptions {
7660
7661
  }
7661
7662
  this.state.partialNext({ isStateStale: true });
7662
7663
  }).unsubscribe;
7664
+ this.subscribeRepliesUnread = () => this.client.on("notification.mark_unread", (event) => {
7665
+ if (!event.user || !event.created_at || !event.thread_id) return;
7666
+ if (event.thread_id !== this.id) return;
7667
+ const userId = event.user.id;
7668
+ const createdAt = event.created_at;
7669
+ const user = event.user;
7670
+ this.state.next((current) => ({
7671
+ ...current,
7672
+ read: {
7673
+ ...current.read,
7674
+ [userId]: {
7675
+ ...current.read[userId],
7676
+ lastReadAt: typeof event.last_read_at !== "undefined" ? new Date(event.last_read_at) : new Date(createdAt),
7677
+ user,
7678
+ firstUnreadMessageId: event.first_unread_message_id,
7679
+ unreadMessageCount: event.unread_messages ?? 0
7680
+ }
7681
+ }
7682
+ }));
7683
+ }).unsubscribe;
7663
7684
  this.subscribeNewReplies = () => this.client.on("message.new", (event) => {
7664
7685
  if (!this.client.userID || event.message?.parent_id !== this.id) {
7665
7686
  return;
@@ -12587,6 +12608,7 @@ var ThreadManager = class extends WithSubscriptions {
12587
12608
  const unsubscribeFunctions = [
12588
12609
  "health.check",
12589
12610
  "notification.mark_read",
12611
+ "notification.mark_unread",
12590
12612
  "notification.thread_message_new",
12591
12613
  "notification.channel_deleted"
12592
12614
  ].map(
@@ -16721,7 +16743,7 @@ var StreamChat = class _StreamChat {
16721
16743
  if (this.userAgent) {
16722
16744
  return this.userAgent;
16723
16745
  }
16724
- const version = "9.47.1";
16746
+ const version = "9.48.0";
16725
16747
  const clientBundle = "node-cjs";
16726
16748
  let userAgentString = "";
16727
16749
  if (this.sdkIdentifier) {