From f50785a209e81c57d7f44a753352b81e81b4584d Mon Sep 17 00:00:00 2001 From: flashwave Date: Fri, 1 Mar 2024 19:11:57 +0000 Subject: [PATCH] Moved implicit channel and user context clears to the populate packet handlers. --- src/mami.js/sockchat_old.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/mami.js/sockchat_old.js b/src/mami.js/sockchat_old.js index 8e3e197..092a3bb 100644 --- a/src/mami.js/sockchat_old.js +++ b/src/mami.js/sockchat_old.js @@ -102,10 +102,6 @@ Umi.Protocol.SockChat.Protocol = function() { isRestarting = false; - // see if these are neccesary - eventTarget.dispatch('user:clear'); - eventTarget.dispatch('chan:clear'); - eventTarget.dispatch('conn:ready', { wasConnected: wasConnected }); }; @@ -417,6 +413,7 @@ Umi.Protocol.SockChat.Protocol = function() { // existing users handlers['7']['0'] = (count, ...args) => { count = parseInt(count); + eventTarget.dispatch('user:clear'); for(let i = 0; i < count; ++i) { const offset = 5 * i; @@ -477,6 +474,7 @@ Umi.Protocol.SockChat.Protocol = function() { // existing channels handlers['7']['2'] = (count, ...args) => { count = parseInt(count); + eventTarget.dispatch('chan:clear'); for(let i = 0; i < count; ++i) { const offset = 3 * i;