polfan-server-js-client 0.2.35 → 0.2.36
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/.idea/workspace.xml +10 -1
- package/build/index.cjs.js +14 -5
- package/build/index.cjs.js.map +1 -1
- package/build/index.umd.js +1 -1
- package/build/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/state-tracker/RoomsManager.ts +15 -6
package/.idea/workspace.xml
CHANGED
|
@@ -100,6 +100,7 @@
|
|
|
100
100
|
<workItem from="1751060147554" duration="143000" />
|
|
101
101
|
<workItem from="1751159757238" duration="782000" />
|
|
102
102
|
<workItem from="1751539766803" duration="1251000" />
|
|
103
|
+
<workItem from="1751551622570" duration="125000" />
|
|
103
104
|
</task>
|
|
104
105
|
<task id="LOCAL-00001" summary="Emoticons objects">
|
|
105
106
|
<option name="closed" value="true" />
|
|
@@ -397,7 +398,15 @@
|
|
|
397
398
|
<option name="project" value="LOCAL" />
|
|
398
399
|
<updated>1751547708628</updated>
|
|
399
400
|
</task>
|
|
400
|
-
<
|
|
401
|
+
<task id="LOCAL-00038" summary="Dedicated event for user status change">
|
|
402
|
+
<option name="closed" value="true" />
|
|
403
|
+
<created>1751551734548</created>
|
|
404
|
+
<option name="number" value="00038" />
|
|
405
|
+
<option name="presentableId" value="LOCAL-00038" />
|
|
406
|
+
<option name="project" value="LOCAL" />
|
|
407
|
+
<updated>1751551734548</updated>
|
|
408
|
+
</task>
|
|
409
|
+
<option name="localTasksCounter" value="39" />
|
|
401
410
|
<servers />
|
|
402
411
|
</component>
|
|
403
412
|
<component name="TypeScriptGeneratedFilesManager">
|
package/build/index.cjs.js
CHANGED
|
@@ -1179,11 +1179,20 @@ class RoomsManager {
|
|
|
1179
1179
|
handleNewMessage(ev) {
|
|
1180
1180
|
const topics = this.topics.get(ev.message.location.roomId);
|
|
1181
1181
|
const topic = topics?.get(ev.message.location.topicId);
|
|
1182
|
-
if (topic) {
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1182
|
+
if (!topic) {
|
|
1183
|
+
return; // No topic found, nothing to update
|
|
1184
|
+
}
|
|
1185
|
+
const newTopic = {
|
|
1186
|
+
...topic,
|
|
1187
|
+
messageCount: topic.messageCount + 1,
|
|
1188
|
+
lastMessage: ev.message
|
|
1189
|
+
};
|
|
1190
|
+
topics.set(newTopic);
|
|
1191
|
+
const room = this.list.get(ev.message.location.roomId);
|
|
1192
|
+
if (room.defaultTopic?.id === ev.message.location.topicId) {
|
|
1193
|
+
this.list.set({
|
|
1194
|
+
...room,
|
|
1195
|
+
defaultTopic: newTopic
|
|
1187
1196
|
});
|
|
1188
1197
|
}
|
|
1189
1198
|
}
|