stream-chat-angular 4.45.1 → 4.46.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/assets/version.d.ts +1 -1
- package/bundles/stream-chat-angular.umd.js +67 -1
- package/bundles/stream-chat-angular.umd.js.map +1 -1
- package/esm2015/assets/version.js +2 -2
- package/esm2015/lib/channel.service.js +33 -1
- package/esm2015/lib/chat-client.service.js +38 -2
- package/fesm2015/stream-chat-angular.js +75 -7
- package/fesm2015/stream-chat-angular.js.map +1 -1
- package/lib/channel.service.d.ts +2 -1
- package/lib/chat-client.service.d.ts +2 -1
- package/package.json +1 -1
- package/src/assets/version.ts +1 -1
package/assets/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "4.
|
|
1
|
+
export declare const version = "4.46.0";
|
|
@@ -356,7 +356,7 @@
|
|
|
356
356
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
357
357
|
}
|
|
358
358
|
|
|
359
|
-
var version = '4.
|
|
359
|
+
var version = '4.46.0';
|
|
360
360
|
|
|
361
361
|
/**
|
|
362
362
|
* The `NotificationService` can be used to add or remove notifications. By default the [`NotificationList`](../components/NotificationListComponent.mdx) component displays the currently active notifications.
|
|
@@ -521,6 +521,7 @@
|
|
|
521
521
|
this.pendingInvitesSubject.next(channels);
|
|
522
522
|
this.appSettingsSubject.next(undefined);
|
|
523
523
|
this.subscriptions.push(this.chatClient.on(function (e) {
|
|
524
|
+
_this.updateUser(e);
|
|
524
525
|
_this.updatePendingInvites(e);
|
|
525
526
|
_this.notificationSubject.next({
|
|
526
527
|
eventType: e.type,
|
|
@@ -648,6 +649,41 @@
|
|
|
648
649
|
}
|
|
649
650
|
}
|
|
650
651
|
};
|
|
652
|
+
ChatClientService.prototype.updateUser = function (e) {
|
|
653
|
+
var _a;
|
|
654
|
+
if (typeof e.total_unread_count !== 'undefined') {
|
|
655
|
+
var user_1;
|
|
656
|
+
this.userSubject.pipe(rxjs.take(1)).subscribe(function (u) {
|
|
657
|
+
user_1 = u;
|
|
658
|
+
});
|
|
659
|
+
if (user_1 && user_1.total_unread_count !== e.total_unread_count) {
|
|
660
|
+
this.userSubject.next(Object.assign(Object.assign({}, user_1), { total_unread_count: e.total_unread_count }));
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
if (typeof e.unread_channels !== 'undefined') {
|
|
664
|
+
var user_2;
|
|
665
|
+
this.userSubject.pipe(rxjs.take(1)).subscribe(function (u) {
|
|
666
|
+
user_2 = u;
|
|
667
|
+
});
|
|
668
|
+
if (user_2 && user_2.unread_channels !== e.unread_channels) {
|
|
669
|
+
this.userSubject.next(Object.assign(Object.assign({}, user_2), { unread_channels: e.unread_channels }));
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
if (typeof e.unread_count !== 'undefined') {
|
|
673
|
+
var user_3;
|
|
674
|
+
this.userSubject.pipe(rxjs.take(1)).subscribe(function (u) {
|
|
675
|
+
user_3 = u;
|
|
676
|
+
});
|
|
677
|
+
if (user_3 && user_3.unread_count !== e.unread_count) {
|
|
678
|
+
this.userSubject.next(Object.assign(Object.assign({}, user_3), { unread_count: e.unread_count }));
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
if (e.type === 'user.updated' &&
|
|
682
|
+
this.chatClient.user &&
|
|
683
|
+
((_a = e.user) === null || _a === void 0 ? void 0 : _a.id) === this.chatClient.user.id) {
|
|
684
|
+
this.userSubject.next(Object.assign({}, this.chatClient.user));
|
|
685
|
+
}
|
|
686
|
+
};
|
|
651
687
|
return ChatClientService;
|
|
652
688
|
}());
|
|
653
689
|
ChatClientService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChatClientService, deps: [{ token: i0__namespace.NgZone }, { token: NotificationService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
@@ -1594,6 +1630,36 @@
|
|
|
1594
1630
|
_this.handleRemovedFromChannelNotification(clientEvent);
|
|
1595
1631
|
}
|
|
1596
1632
|
});
|
|
1633
|
+
break;
|
|
1634
|
+
}
|
|
1635
|
+
case 'user.updated': {
|
|
1636
|
+
this.ngZone.run(function () {
|
|
1637
|
+
var _a;
|
|
1638
|
+
var updatedChannels = (_a = _this.channelsSubject.getValue()) === null || _a === void 0 ? void 0 : _a.map(function (c) {
|
|
1639
|
+
if (_this.chatClientService.chatClient.activeChannels[c.cid]) {
|
|
1640
|
+
return _this.chatClientService.chatClient.activeChannels[c.cid];
|
|
1641
|
+
}
|
|
1642
|
+
else {
|
|
1643
|
+
return c;
|
|
1644
|
+
}
|
|
1645
|
+
});
|
|
1646
|
+
_this.channelsSubject.next(updatedChannels);
|
|
1647
|
+
var activeChannel = _this.activeChannelSubject.getValue();
|
|
1648
|
+
if (activeChannel) {
|
|
1649
|
+
_this.activeChannelSubject.next(_this.chatClientService.chatClient.activeChannels[activeChannel.cid] || activeChannel);
|
|
1650
|
+
_this.activeChannelMessagesSubject.next(activeChannel.state.messages.map(function (m) {
|
|
1651
|
+
m.readBy = getReadBy(m, activeChannel);
|
|
1652
|
+
return Object.assign({}, m);
|
|
1653
|
+
}));
|
|
1654
|
+
var activeParentMessage = _this.activeParentMessageIdSubject.getValue();
|
|
1655
|
+
if (activeParentMessage) {
|
|
1656
|
+
var messages = activeChannel.state.threads[activeParentMessage];
|
|
1657
|
+
_this.activeThreadMessagesSubject.next(__spreadArray([], __read(messages)));
|
|
1658
|
+
}
|
|
1659
|
+
_this.activeChannelPinnedMessagesSubject.next(__spreadArray([], __read(activeChannel.state.pinnedMessages)));
|
|
1660
|
+
}
|
|
1661
|
+
});
|
|
1662
|
+
break;
|
|
1597
1663
|
}
|
|
1598
1664
|
}
|
|
1599
1665
|
};
|