Auto-close conversation chat on user removal

This commit is contained in:
Pierre HUBERT 2021-03-07 19:49:34 +01:00
parent ce0397d5be
commit 2e1dc48671

View File

@ -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();
});