stream-chat 8.29.0 → 8.31.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/browser.es.js +25 -17
- package/dist/browser.es.js.map +1 -1
- package/dist/browser.full-bundle.min.js +1 -1
- package/dist/browser.full-bundle.min.js.map +1 -1
- package/dist/browser.js +25 -17
- package/dist/browser.js.map +1 -1
- package/dist/index.es.js +25 -17
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +25 -17
- package/dist/index.js.map +1 -1
- package/dist/types/channel.d.ts +1 -0
- package/dist/types/channel.d.ts.map +1 -1
- package/dist/types/client.d.ts +0 -12
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/types.d.ts +14 -0
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/channel.ts +9 -2
- package/src/types.ts +15 -0
- package/src/utils.ts +1 -0
package/dist/browser.es.js
CHANGED
|
@@ -161,6 +161,7 @@ function isOwnUserBaseProperty(property) {
|
|
|
161
161
|
unread_count: true,
|
|
162
162
|
unread_threads: true,
|
|
163
163
|
invisible: true,
|
|
164
|
+
privacy_settings: true,
|
|
164
165
|
roles: true
|
|
165
166
|
};
|
|
166
167
|
return ownUserBaseProperties[property];
|
|
@@ -2798,14 +2799,12 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2798
2799
|
key: "keystroke",
|
|
2799
2800
|
value: function () {
|
|
2800
2801
|
var _keystroke = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24(parent_id, options) {
|
|
2801
|
-
var _this$getConfig;
|
|
2802
|
-
|
|
2803
2802
|
var now, diff;
|
|
2804
2803
|
return _regeneratorRuntime.wrap(function _callee24$(_context24) {
|
|
2805
2804
|
while (1) {
|
|
2806
2805
|
switch (_context24.prev = _context24.next) {
|
|
2807
2806
|
case 0:
|
|
2808
|
-
if (
|
|
2807
|
+
if (this._isTypingIndicatorsEnabled()) {
|
|
2809
2808
|
_context24.next = 2;
|
|
2810
2809
|
break;
|
|
2811
2810
|
}
|
|
@@ -2854,13 +2853,11 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2854
2853
|
key: "stopTyping",
|
|
2855
2854
|
value: function () {
|
|
2856
2855
|
var _stopTyping = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25(parent_id, options) {
|
|
2857
|
-
var _this$getConfig2;
|
|
2858
|
-
|
|
2859
2856
|
return _regeneratorRuntime.wrap(function _callee25$(_context25) {
|
|
2860
2857
|
while (1) {
|
|
2861
2858
|
switch (_context25.prev = _context25.next) {
|
|
2862
2859
|
case 0:
|
|
2863
|
-
if (
|
|
2860
|
+
if (this._isTypingIndicatorsEnabled()) {
|
|
2864
2861
|
_context25.next = 2;
|
|
2865
2862
|
break;
|
|
2866
2863
|
}
|
|
@@ -2890,6 +2887,17 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2890
2887
|
|
|
2891
2888
|
return stopTyping;
|
|
2892
2889
|
}()
|
|
2890
|
+
}, {
|
|
2891
|
+
key: "_isTypingIndicatorsEnabled",
|
|
2892
|
+
value: function _isTypingIndicatorsEnabled() {
|
|
2893
|
+
var _this$getConfig, _this$getClient$user$, _this$getClient$user, _this$getClient$user$2, _this$getClient$user$3;
|
|
2894
|
+
|
|
2895
|
+
if (!((_this$getConfig = this.getConfig()) !== null && _this$getConfig !== void 0 && _this$getConfig.typing_events)) {
|
|
2896
|
+
return false;
|
|
2897
|
+
}
|
|
2898
|
+
|
|
2899
|
+
return (_this$getClient$user$ = (_this$getClient$user = this.getClient().user) === null || _this$getClient$user === void 0 ? void 0 : (_this$getClient$user$2 = _this$getClient$user.privacy_settings) === null || _this$getClient$user$2 === void 0 ? void 0 : (_this$getClient$user$3 = _this$getClient$user$2.typing_indicators) === null || _this$getClient$user$3 === void 0 ? void 0 : _this$getClient$user$3.enabled) !== null && _this$getClient$user$ !== void 0 ? _this$getClient$user$ : true;
|
|
2900
|
+
}
|
|
2893
2901
|
/**
|
|
2894
2902
|
* lastMessage - return the last message, takes into account that last few messages might not be perfectly sorted
|
|
2895
2903
|
*
|
|
@@ -2926,7 +2934,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2926
2934
|
key: "markRead",
|
|
2927
2935
|
value: function () {
|
|
2928
2936
|
var _markRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee26() {
|
|
2929
|
-
var _this$
|
|
2937
|
+
var _this$getConfig2;
|
|
2930
2938
|
|
|
2931
2939
|
var data,
|
|
2932
2940
|
_args26 = arguments;
|
|
@@ -2938,7 +2946,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2938
2946
|
|
|
2939
2947
|
this._checkInitialized();
|
|
2940
2948
|
|
|
2941
|
-
if (!(!((_this$
|
|
2949
|
+
if (!(!((_this$getConfig2 = this.getConfig()) !== null && _this$getConfig2 !== void 0 && _this$getConfig2.read_events) && !this.getClient()._isUsingServerAuth())) {
|
|
2942
2950
|
_context26.next = 4;
|
|
2943
2951
|
break;
|
|
2944
2952
|
}
|
|
@@ -2977,7 +2985,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2977
2985
|
key: "markUnread",
|
|
2978
2986
|
value: function () {
|
|
2979
2987
|
var _markUnread = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27(data) {
|
|
2980
|
-
var _this$
|
|
2988
|
+
var _this$getConfig3;
|
|
2981
2989
|
|
|
2982
2990
|
return _regeneratorRuntime.wrap(function _callee27$(_context27) {
|
|
2983
2991
|
while (1) {
|
|
@@ -2985,7 +2993,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2985
2993
|
case 0:
|
|
2986
2994
|
this._checkInitialized();
|
|
2987
2995
|
|
|
2988
|
-
if (!(!((_this$
|
|
2996
|
+
if (!(!((_this$getConfig3 = this.getConfig()) !== null && _this$getConfig3 !== void 0 && _this$getConfig3.read_events) && !this.getClient()._isUsingServerAuth())) {
|
|
2989
2997
|
_context27.next = 3;
|
|
2990
2998
|
break;
|
|
2991
2999
|
}
|
|
@@ -3905,7 +3913,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3905
3913
|
|
|
3906
3914
|
case 'message.read':
|
|
3907
3915
|
if ((_event$user3 = event.user) !== null && _event$user3 !== void 0 && _event$user3.id && event.created_at) {
|
|
3908
|
-
var _event$user4, _this$getClient$
|
|
3916
|
+
var _event$user4, _this$getClient$user2;
|
|
3909
3917
|
|
|
3910
3918
|
channelState.read[event.user.id] = {
|
|
3911
3919
|
last_read: new Date(event.created_at),
|
|
@@ -3914,7 +3922,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3914
3922
|
unread_messages: 0
|
|
3915
3923
|
};
|
|
3916
3924
|
|
|
3917
|
-
if (((_event$user4 = event.user) === null || _event$user4 === void 0 ? void 0 : _event$user4.id) === ((_this$getClient$
|
|
3925
|
+
if (((_event$user4 = event.user) === null || _event$user4 === void 0 ? void 0 : _event$user4.id) === ((_this$getClient$user2 = this.getClient().user) === null || _this$getClient$user2 === void 0 ? void 0 : _this$getClient$user2.id)) {
|
|
3918
3926
|
channelState.unreadCount = 0;
|
|
3919
3927
|
}
|
|
3920
3928
|
}
|
|
@@ -3952,10 +3960,10 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3952
3960
|
|
|
3953
3961
|
case 'message.new':
|
|
3954
3962
|
if (event.message) {
|
|
3955
|
-
var _event$user7, _this$getClient$
|
|
3963
|
+
var _event$user7, _this$getClient$user3, _event$user8;
|
|
3956
3964
|
|
|
3957
3965
|
/* if message belongs to current user, always assume timestamp is changed to filter it out and add again to avoid duplication */
|
|
3958
|
-
var ownMessage = ((_event$user7 = event.user) === null || _event$user7 === void 0 ? void 0 : _event$user7.id) === ((_this$getClient$
|
|
3966
|
+
var ownMessage = ((_event$user7 = event.user) === null || _event$user7 === void 0 ? void 0 : _event$user7.id) === ((_this$getClient$user3 = this.getClient().user) === null || _this$getClient$user3 === void 0 ? void 0 : _this$getClient$user3.id);
|
|
3959
3967
|
var isThreadMessage = event.message.parent_id && !event.message.show_in_channel;
|
|
3960
3968
|
|
|
3961
3969
|
if (this.state.isUpToDate || isThreadMessage) {
|
|
@@ -4062,9 +4070,9 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4062
4070
|
|
|
4063
4071
|
case 'notification.mark_unread':
|
|
4064
4072
|
{
|
|
4065
|
-
var _event$user10, _this$getClient$
|
|
4073
|
+
var _event$user10, _this$getClient$user4, _event$unread_message;
|
|
4066
4074
|
|
|
4067
|
-
var _ownMessage = ((_event$user10 = event.user) === null || _event$user10 === void 0 ? void 0 : _event$user10.id) === ((_this$getClient$
|
|
4075
|
+
var _ownMessage = ((_event$user10 = event.user) === null || _event$user10 === void 0 ? void 0 : _event$user10.id) === ((_this$getClient$user4 = this.getClient().user) === null || _this$getClient$user4 === void 0 ? void 0 : _this$getClient$user4.id);
|
|
4068
4076
|
|
|
4069
4077
|
if (!(_ownMessage && event.user)) break;
|
|
4070
4078
|
var unreadCount = (_event$unread_message = event.unread_messages) !== null && _event$unread_message !== void 0 ? _event$unread_message : 0;
|
|
@@ -11418,7 +11426,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11418
11426
|
}, {
|
|
11419
11427
|
key: "getUserAgent",
|
|
11420
11428
|
value: function getUserAgent() {
|
|
11421
|
-
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.
|
|
11429
|
+
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.31.0");
|
|
11422
11430
|
}
|
|
11423
11431
|
}, {
|
|
11424
11432
|
key: "setUserAgent",
|