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.
- package/dist/cjs/index.browser.js +23 -1
- package/dist/cjs/index.browser.js.map +2 -2
- package/dist/cjs/index.node.js +23 -1
- package/dist/cjs/index.node.js.map +2 -2
- package/dist/esm/index.mjs +23 -1
- package/dist/esm/index.mjs.map +2 -2
- package/dist/types/channel.d.ts +2 -2
- package/dist/types/custom_types.d.ts +2 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/thread.d.ts +2 -0
- package/dist/types/types.d.ts +45 -14
- package/package.json +1 -1
- package/src/channel.ts +2 -2
- package/src/custom_types.ts +1 -0
- package/src/index.ts +1 -0
- package/src/thread.ts +29 -0
- package/src/thread_manager.ts +1 -0
- package/src/types.ts +58 -14
|
@@ -7650,6 +7650,7 @@ var Thread = class extends WithSubscriptions {
|
|
|
7650
7650
|
this.addUnsubscribeFunction(this.subscribeMarkThreadStale());
|
|
7651
7651
|
this.addUnsubscribeFunction(this.subscribeNewReplies());
|
|
7652
7652
|
this.addUnsubscribeFunction(this.subscribeRepliesRead());
|
|
7653
|
+
this.addUnsubscribeFunction(this.subscribeRepliesUnread());
|
|
7653
7654
|
this.addUnsubscribeFunction(this.subscribeMessageDeleted());
|
|
7654
7655
|
this.addUnsubscribeFunction(this.subscribeMessageUpdated());
|
|
7655
7656
|
};
|
|
@@ -7691,6 +7692,26 @@ var Thread = class extends WithSubscriptions {
|
|
|
7691
7692
|
}
|
|
7692
7693
|
this.state.partialNext({ isStateStale: true });
|
|
7693
7694
|
}).unsubscribe;
|
|
7695
|
+
this.subscribeRepliesUnread = () => this.client.on("notification.mark_unread", (event) => {
|
|
7696
|
+
if (!event.user || !event.created_at || !event.thread_id) return;
|
|
7697
|
+
if (event.thread_id !== this.id) return;
|
|
7698
|
+
const userId = event.user.id;
|
|
7699
|
+
const createdAt = event.created_at;
|
|
7700
|
+
const user = event.user;
|
|
7701
|
+
this.state.next((current) => ({
|
|
7702
|
+
...current,
|
|
7703
|
+
read: {
|
|
7704
|
+
...current.read,
|
|
7705
|
+
[userId]: {
|
|
7706
|
+
...current.read[userId],
|
|
7707
|
+
lastReadAt: typeof event.last_read_at !== "undefined" ? new Date(event.last_read_at) : new Date(createdAt),
|
|
7708
|
+
user,
|
|
7709
|
+
firstUnreadMessageId: event.first_unread_message_id,
|
|
7710
|
+
unreadMessageCount: event.unread_messages ?? 0
|
|
7711
|
+
}
|
|
7712
|
+
}
|
|
7713
|
+
}));
|
|
7714
|
+
}).unsubscribe;
|
|
7694
7715
|
this.subscribeNewReplies = () => this.client.on("message.new", (event) => {
|
|
7695
7716
|
if (!this.client.userID || event.message?.parent_id !== this.id) {
|
|
7696
7717
|
return;
|
|
@@ -12618,6 +12639,7 @@ var ThreadManager = class extends WithSubscriptions {
|
|
|
12618
12639
|
const unsubscribeFunctions = [
|
|
12619
12640
|
"health.check",
|
|
12620
12641
|
"notification.mark_read",
|
|
12642
|
+
"notification.mark_unread",
|
|
12621
12643
|
"notification.thread_message_new",
|
|
12622
12644
|
"notification.channel_deleted"
|
|
12623
12645
|
].map(
|
|
@@ -16752,7 +16774,7 @@ var StreamChat = class _StreamChat {
|
|
|
16752
16774
|
if (this.userAgent) {
|
|
16753
16775
|
return this.userAgent;
|
|
16754
16776
|
}
|
|
16755
|
-
const version = "9.
|
|
16777
|
+
const version = "9.48.0";
|
|
16756
16778
|
const clientBundle = "browser-cjs";
|
|
16757
16779
|
let userAgentString = "";
|
|
16758
16780
|
if (this.sdkIdentifier) {
|