polfan-server-js-client 0.1.99913 → 0.1.99914
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/build/index.js +12 -16
- package/build/index.js.map +1 -1
- package/build/types/state-tracker/TopicHistoryWindow.d.ts +2 -2
- package/build/types/types/src/index.d.ts +1 -2
- package/build/types/types/src/schemes/Message.d.ts +3 -7
- package/build/types/types/src/schemes/Topic.d.ts +1 -2
- package/build/types/types/src/schemes/commands/CreateTopic.d.ts +1 -5
- package/build/types/types/src/schemes/events/NewMessage.d.ts +0 -2
- package/package.json +1 -1
- package/src/state-tracker/MessagesManager.ts +2 -2
- package/src/state-tracker/RoomMessagesHistory.ts +3 -7
- package/src/state-tracker/RoomsManager.ts +2 -2
- package/src/state-tracker/TopicHistoryWindow.ts +6 -6
- package/src/types/src/index.ts +0 -2
- package/src/types/src/schemes/Message.ts +3 -7
- package/src/types/src/schemes/Topic.ts +1 -2
- package/src/types/src/schemes/commands/CreateTopic.ts +1 -6
- package/src/types/src/schemes/events/NewMessage.ts +0 -2
package/build/index.js
CHANGED
|
@@ -974,13 +974,13 @@ var TopicHistoryWindow = /*#__PURE__*/function (_TraversableRemoteCol) {
|
|
|
974
974
|
* @internal
|
|
975
975
|
*/
|
|
976
976
|
TopicHistoryWindow_createClass(TopicHistoryWindow, [{
|
|
977
|
-
key: "
|
|
978
|
-
value: function
|
|
979
|
-
var refMessage = this.get(
|
|
977
|
+
key: "_updateMessageReference",
|
|
978
|
+
value: function _updateMessageReference(refTopic) {
|
|
979
|
+
var refMessage = this.get(refTopic.refMessage.id);
|
|
980
980
|
if (refMessage) {
|
|
981
981
|
// Update referenced topic ID in message
|
|
982
982
|
this.set(_objectSpread(_objectSpread({}, refMessage), {}, {
|
|
983
|
-
topicRef:
|
|
983
|
+
topicRef: refTopic.id
|
|
984
984
|
}));
|
|
985
985
|
}
|
|
986
986
|
}
|
|
@@ -992,7 +992,7 @@ var TopicHistoryWindow = /*#__PURE__*/function (_TraversableRemoteCol) {
|
|
|
992
992
|
while (1) {
|
|
993
993
|
switch (_context5.prev = _context5.next) {
|
|
994
994
|
case 0:
|
|
995
|
-
if ([WindowState.LATEST, WindowState.LIVE].includes(this.state) && ev.location.roomId === this.roomId && ev.location.topicId === this.topicId) {
|
|
995
|
+
if ([WindowState.LATEST, WindowState.LIVE].includes(this.state) && ev.message.location.roomId === this.roomId && ev.message.location.topicId === this.topicId) {
|
|
996
996
|
this.addItems([ev.message], 'tail');
|
|
997
997
|
}
|
|
998
998
|
case 1:
|
|
@@ -1342,13 +1342,9 @@ var RoomMessagesHistory = /*#__PURE__*/function () {
|
|
|
1342
1342
|
this.historyWindows.set([topic.id, new TopicHistoryWindow(this.room.id, topic.id, this.tracker)]);
|
|
1343
1343
|
|
|
1344
1344
|
// If new topic refers to some message from this room, update other structures
|
|
1345
|
-
if (topic.
|
|
1346
|
-
var refHistoryWindow = this.historyWindows.get(topic.
|
|
1347
|
-
refHistoryWindow.
|
|
1348
|
-
topicId: topic.id,
|
|
1349
|
-
// Reverse the reference
|
|
1350
|
-
messageId: topic.messageRef.messageId
|
|
1351
|
-
});
|
|
1345
|
+
if (topic.refMessage) {
|
|
1346
|
+
var refHistoryWindow = this.historyWindows.get(topic.refMessage.location.topicId);
|
|
1347
|
+
refHistoryWindow === null || refHistoryWindow === void 0 ? void 0 : refHistoryWindow._updateMessageReference(topic);
|
|
1352
1348
|
}
|
|
1353
1349
|
}
|
|
1354
1350
|
}]);
|
|
@@ -1813,8 +1809,8 @@ var MessagesManager = /*#__PURE__*/function () {
|
|
|
1813
1809
|
key: "updateLocallyFollowedTopicOnNewMessage",
|
|
1814
1810
|
value: function updateLocallyFollowedTopicOnNewMessage(ev) {
|
|
1815
1811
|
var _this$tracker$me;
|
|
1816
|
-
var roomFollowedTopics = this.followedTopics.get(ev.location.roomId);
|
|
1817
|
-
var followedTopic = roomFollowedTopics === null || roomFollowedTopics === void 0 ? void 0 : roomFollowedTopics.get(ev.location.topicId);
|
|
1812
|
+
var roomFollowedTopics = this.followedTopics.get(ev.message.location.roomId);
|
|
1813
|
+
var followedTopic = roomFollowedTopics === null || roomFollowedTopics === void 0 ? void 0 : roomFollowedTopics.get(ev.message.location.topicId);
|
|
1818
1814
|
if (!roomFollowedTopics || !followedTopic) {
|
|
1819
1815
|
// Skip if we don't follow this room or targeted topic
|
|
1820
1816
|
return;
|
|
@@ -2388,8 +2384,8 @@ var RoomsManager = /*#__PURE__*/function () {
|
|
|
2388
2384
|
}, {
|
|
2389
2385
|
key: "handleNewMessage",
|
|
2390
2386
|
value: function handleNewMessage(ev) {
|
|
2391
|
-
var topics = this.topics.get(ev.location.roomId);
|
|
2392
|
-
var topic = topics === null || topics === void 0 ? void 0 : topics.get(ev.location.topicId);
|
|
2387
|
+
var topics = this.topics.get(ev.message.location.roomId);
|
|
2388
|
+
var topic = topics === null || topics === void 0 ? void 0 : topics.get(ev.message.location.topicId);
|
|
2393
2389
|
if (topic) {
|
|
2394
2390
|
topics.set(RoomsManager_objectSpread(RoomsManager_objectSpread({}, topic), {}, {
|
|
2395
2391
|
messageCount: topic.messageCount + 1,
|