stream-chat 9.34.0 → 9.35.1
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 +30 -7
- package/dist/cjs/index.browser.js.map +2 -2
- package/dist/cjs/index.node.js +30 -7
- package/dist/cjs/index.node.js.map +2 -2
- package/dist/esm/index.mjs +30 -7
- package/dist/esm/index.mjs.map +2 -2
- package/dist/types/client.d.ts +4 -0
- package/package.json +1 -1
- package/src/client.ts +31 -5
- package/src/messageComposer/messageComposer.ts +6 -1
- package/src/types.ts +1 -0
|
@@ -7545,7 +7545,7 @@ var _MessageComposer = class _MessageComposer extends WithSubscriptions {
|
|
|
7545
7545
|
}
|
|
7546
7546
|
get hasSendableData() {
|
|
7547
7547
|
if (this.client.offlineDb) {
|
|
7548
|
-
return !this.
|
|
7548
|
+
return !this.textComposer.textIsEmpty || !!this.attachmentManager.attachments.length || !!this.pollId || !!this.locationComposer.validLocation;
|
|
7549
7549
|
}
|
|
7550
7550
|
return !!(!this.attachmentManager.uploadsInProgressCount && (!this.textComposer.textIsEmpty || this.attachmentManager.successfulUploadsCount > 0) || this.pollId || !!this.locationComposer.validLocation);
|
|
7551
7551
|
}
|
|
@@ -13375,6 +13375,7 @@ var StreamChat = class _StreamChat {
|
|
|
13375
13375
|
this.state = new ClientState({ client: this });
|
|
13376
13376
|
this.mutedChannels = [];
|
|
13377
13377
|
this.mutedUsers = [];
|
|
13378
|
+
this.blockedUsers = new StateStore({ userIds: [] });
|
|
13378
13379
|
this.moderation = new Moderation(this);
|
|
13379
13380
|
this.notifications = options?.notifications ?? new NotificationManager();
|
|
13380
13381
|
if (secretOrOptions && isString2(secretOrOptions)) {
|
|
@@ -13775,6 +13776,7 @@ var StreamChat = class _StreamChat {
|
|
|
13775
13776
|
client.state.updateUser(event.me);
|
|
13776
13777
|
client.mutedChannels = event.me.channel_mutes;
|
|
13777
13778
|
client.mutedUsers = event.me.mutes;
|
|
13779
|
+
client.blockedUsers.partialNext({ userIds: event.me.blocked_user_ids ?? [] });
|
|
13778
13780
|
}
|
|
13779
13781
|
if (event.channel && event.type === "notification.message_new") {
|
|
13780
13782
|
const { channel } = event;
|
|
@@ -14475,21 +14477,42 @@ var StreamChat = class _StreamChat {
|
|
|
14475
14477
|
});
|
|
14476
14478
|
}
|
|
14477
14479
|
async blockUser(blockedUserID, user_id) {
|
|
14478
|
-
|
|
14480
|
+
const result = await this.post(this.baseURL + "/users/block", {
|
|
14479
14481
|
blocked_user_id: blockedUserID,
|
|
14480
14482
|
...user_id ? { user_id } : {}
|
|
14481
14483
|
});
|
|
14484
|
+
if (this._cacheEnabled()) {
|
|
14485
|
+
this.blockedUsers.next(({ userIds }) => ({
|
|
14486
|
+
userIds: userIds.concat(blockedUserID)
|
|
14487
|
+
}));
|
|
14488
|
+
}
|
|
14489
|
+
return result;
|
|
14482
14490
|
}
|
|
14483
14491
|
async getBlockedUsers(user_id) {
|
|
14484
|
-
|
|
14485
|
-
|
|
14486
|
-
|
|
14492
|
+
const result = await this.get(
|
|
14493
|
+
this.baseURL + "/users/block",
|
|
14494
|
+
{
|
|
14495
|
+
...user_id ? { user_id } : {}
|
|
14496
|
+
}
|
|
14497
|
+
);
|
|
14498
|
+
if (this._cacheEnabled()) {
|
|
14499
|
+
this.blockedUsers.partialNext({
|
|
14500
|
+
userIds: result.blocks.map(({ blocked_user_id }) => blocked_user_id)
|
|
14501
|
+
});
|
|
14502
|
+
}
|
|
14503
|
+
return result;
|
|
14487
14504
|
}
|
|
14488
14505
|
async unBlockUser(blockedUserID, userID) {
|
|
14489
|
-
|
|
14506
|
+
const result = await this.post(this.baseURL + "/users/unblock", {
|
|
14490
14507
|
blocked_user_id: blockedUserID,
|
|
14491
14508
|
...userID ? { user_id: userID } : {}
|
|
14492
14509
|
});
|
|
14510
|
+
if (this._cacheEnabled()) {
|
|
14511
|
+
this.blockedUsers.next(({ userIds }) => ({
|
|
14512
|
+
userIds: userIds.filter((id) => id !== blockedUserID)
|
|
14513
|
+
}));
|
|
14514
|
+
}
|
|
14515
|
+
return result;
|
|
14493
14516
|
}
|
|
14494
14517
|
/** getSharedLocations
|
|
14495
14518
|
*
|
|
@@ -15111,7 +15134,7 @@ var StreamChat = class _StreamChat {
|
|
|
15111
15134
|
if (this.userAgent) {
|
|
15112
15135
|
return this.userAgent;
|
|
15113
15136
|
}
|
|
15114
|
-
const version = "9.
|
|
15137
|
+
const version = "9.35.1";
|
|
15115
15138
|
const clientBundle = "browser-cjs";
|
|
15116
15139
|
let userAgentString = "";
|
|
15117
15140
|
if (this.sdkIdentifier) {
|