export class MessageTimer { private readonly conversationLevelTimers : Map < string , number > ; private readonly messageLevelTimers : Map < string , number > ; constructor ( ) { this . conversationLevelTimers = new Map ( ) ; this . messageLevelTimers = new Map ( ) ; } public getConversationLevelTimer ( conversationId ) { return this . conversationLevelTimers . get ( conversationId ) || 0 ; } public getMessageLevelTimer ( conversationId ) { return this . messageLevelTimers . get ( conversationId ) || 0 ; } public getMessageTimer ( conversationId ) { return this . getConversationLevelTimer ( conversationId ) || this . getMessageLevelTimer ( conversationId ) ; } public setConversationLevelTimer ( conversationId , messageTimer ) { if ( messageTimer === 0 ) { this . conversationLevelTimers . delete ( conversationId ) ; } else { this . conversationLevelTimers . set ( conversationId , messageTimer ) ; } } public setMessageLevelTimer ( conversationId , messageTimer ) { if ( messageTimer === 0 ) { this . messageLevelTimers . delete ( conversationId ) ; } else { this . messageLevelTimers . set ( conversationId , messageTimer ) ; } } }