Moved implicit channel and user context clears to the populate packet handlers.

This commit is contained in:
flash 2024-03-01 19:11:57 +00:00
parent bc859a042d
commit f50785a209

View file

@ -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;