polfan-server-js-client 0.2.88 → 0.2.89
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 +13 -13
- package/build/index.cjs.js +8 -9
- 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 +9 -5
package/package.json
CHANGED
|
@@ -369,11 +369,15 @@ export class RoomsManager {
|
|
|
369
369
|
}
|
|
370
370
|
|
|
371
371
|
private handleMessagesRedacted(ev: MessagesRedacted): void {
|
|
372
|
-
// Remove redacted messages from topic
|
|
372
|
+
// Remove redacted messages from topic and update metadata
|
|
373
373
|
const topics = this.topics.get(ev.location.roomId);
|
|
374
|
-
const
|
|
375
|
-
|
|
376
|
-
.
|
|
377
|
-
|
|
374
|
+
const topic = topics?.get(ev.location.topicId);
|
|
375
|
+
if (topic) {
|
|
376
|
+
topics.set({
|
|
377
|
+
...topic,
|
|
378
|
+
messageCount: Math.max(topic.messageCount - ev.ids.length, 0),
|
|
379
|
+
lastMessage: ev.ids.includes(topic.lastMessage?.id) ? null : topic.lastMessage,
|
|
380
|
+
} as Topic);
|
|
381
|
+
}
|
|
378
382
|
}
|
|
379
383
|
}
|