add documentation and remove console logs

This commit is contained in:
Peter Maquiran
2024-09-18 15:24:50 +01:00
parent 8d332f73a8
commit a4d81a68e6
6 changed files with 38 additions and 15 deletions
@@ -33,6 +33,10 @@ export class RoomBoldSyncUseCaseService {
this.loadHistory()
}
/**
*
* @description listen to all incoming message and set bold to true
*/
private listenToIncomingMessage() {
return this.MessageSocketRepositoryService.listenToMessages().pipe(
filter((message) => !message?.requestId?.startsWith(InstanceId)),
@@ -51,6 +55,10 @@ export class RoomBoldSyncUseCaseService {
});
}
/**
*
* @description Listen to all update message. If the incoming updated message has readAt my me and is the last message then remove bold
*/
private listenToUpdateMessages() {
return this.MessageSocketRepositoryService.listenToUpdateMessages().pipe(
filter((message) => !message?.requestId?.startsWith(InstanceId)),
@@ -77,6 +85,9 @@ export class RoomBoldSyncUseCaseService {
});
}
/**
* @description set bold base on the last message on load history. If the last message has readAt by me then remove bold in case not set bold
*/
@XTracerAsync({name:'RoomBoldSyncUseCaseService/loadHistory', module:'chat', bugPrint: true})
private loadHistory() {
const regex = new RegExp("Room\\/([0-9a-fA-F]{8})-([0-9a-fA-F]{4})-([0-9a-fA-F]{4})-([0-9a-fA-F]{4})-([0-9a-fA-F]{12})\\/Messages");