stream-chat 5.1.1 → 5.1.2

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/index.es.js CHANGED
@@ -312,6 +312,12 @@ var ChannelState = /*#__PURE__*/function () {
312
312
  for (var i = 0; i < newMessages.length; i += 1) {
313
313
  var _this$_channel;
314
314
 
315
+ var isFromShadowBannedUser = newMessages[i].shadowed;
316
+
317
+ if (isFromShadowBannedUser) {
318
+ continue;
319
+ }
320
+
315
321
  var message = this.formatMessage(newMessages[i]);
316
322
 
317
323
  if (message.user && (_this$_channel = this._channel) !== null && _this$_channel !== void 0 && _this$_channel.cid) {
@@ -804,6 +810,10 @@ function isFileWebAPI(uri) {
804
810
  return typeof window !== 'undefined' && 'File' in window && uri instanceof File;
805
811
  }
806
812
 
813
+ function isBlobWebAPI(uri) {
814
+ return typeof window !== 'undefined' && 'Blob' in window && uri instanceof Blob;
815
+ }
816
+
807
817
  function isOwnUser(user) {
808
818
  return (user === null || user === void 0 ? void 0 : user.total_unread_count) !== undefined;
809
819
  }
@@ -823,7 +833,7 @@ function isOwnUserBaseProperty(property) {
823
833
  function addFileToFormData(uri, name, contentType) {
824
834
  var data = new FormData();
825
835
 
826
- if (isReadableStream(uri) || isBuffer(uri) || isFileWebAPI(uri)) {
836
+ if (isReadableStream(uri) || isBuffer(uri) || isFileWebAPI(uri) || isBlobWebAPI(uri)) {
827
837
  if (name) data.append('file', uri, name);else data.append('file', uri);
828
838
  } else {
829
839
  data.append('file', {
@@ -9040,7 +9050,7 @@ var StreamChat = /*#__PURE__*/function () {
9040
9050
  }, {
9041
9051
  key: "getUserAgent",
9042
9052
  value: function getUserAgent() {
9043
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "5.1.1");
9053
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "5.1.2");
9044
9054
  }
9045
9055
  }, {
9046
9056
  key: "setUserAgent",