mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-04 12:14:12 +00:00 
			
		
		
		
	Auto-close conversation chat on user removal
This commit is contained in:
		@@ -1486,3 +1486,17 @@ document.addEventListener("deletedConvMessage", (e) => {
 | 
				
			|||||||
	
 | 
						
 | 
				
			||||||
	target.style.display = "none";
 | 
						target.style.display = "none";
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Register to conversation removal
 | 
				
			||||||
 | 
					document.addEventListener("removedUserFromConv", e => {
 | 
				
			||||||
 | 
						const msg = e.detail;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (msg.user_id != userID())
 | 
				
			||||||
 | 
							return;
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						if(!ConvService.__serviceCache.hasOwnProperty("conversation-" + msg.conv_id))
 | 
				
			||||||
 | 
							return;
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						ConvChatWindow.__conversationsCache["conversation-"+msg.conv_id].box.closeFunction();
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
		Reference in New Issue
	
	Block a user