You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			19 lines
		
	
	
		
			646 B
		
	
	
	
		
			TypeScript
		
	
			
		
		
	
	
			19 lines
		
	
	
		
			646 B
		
	
	
	
		
			TypeScript
		
	
| import { ConversationController } from '../session/conversations';
 | |
| 
 | |
| export async function handleEndSession(number: string): Promise<void> {
 | |
|   window.log.info('got end session');
 | |
| 
 | |
|   try {
 | |
|     const conversation = ConversationController.getInstance().get(number);
 | |
|     if (conversation) {
 | |
|       // this just marks the conversation as being waiting for a new session
 | |
|       // it does trigger a message to be sent. (the message is sent from handleSessionRequestMessage())
 | |
|       await conversation.onSessionResetReceived();
 | |
|     } else {
 | |
|       throw new Error();
 | |
|     }
 | |
|   } catch (e) {
 | |
|     window.log.error('Error getting conversation: ', number);
 | |
|   }
 | |
| }
 |