Skip to content

Commit

Permalink
Fix Find and Match properly.
Browse files Browse the repository at this point in the history
  • Loading branch information
jq-rs committed Sep 9, 2020
1 parent 6e8bcf2 commit 3966d4b
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions js/mlestalk.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ function queueSweepAndSend(uid, channel) {
let q = uidQueueGet(uid, channel);
let cnt = 0;
if (q) {
for (let i = 0; i < q.getLength(); i++) {
let len = q.getLength();
for (let i = 0; i < len; i++) {
let obj = q.get(i);
let tmp = obj[1];
if (tmp[2] == uid) {
Expand All @@ -179,6 +180,7 @@ function queueSweepAndSend(uid, channel) {
if(fs) {
q.remove(i);
i -= 1;
len -= 1;
}
}
}
Expand Down Expand Up @@ -930,17 +932,7 @@ async function reconnect(uid, channel) {
gIsReconnect = true;
await sleep(gReconnTimeout);
gReconnTimeout *= 2;
gWebWorker.postMessage(["reconnect", null, uid, channel, gIsTokenChannel]);
}

function syncReconnect() {
if (gIsReconnect)
return;

if ('' != gMyName && '' != gMyChannel) {
gWebWorker.postMessage(["reconnect", null, gMyName, gMyChannel, gIsTokenChannel, gPrevBdKey]);
sendInitJoin();
}
gWebWorker.postMessage(["reconnect", null, uid, channel, gIsTokenChannel, gPrevBdKey]);
}

function scrollToBottom() {
Expand Down Expand Up @@ -987,7 +979,7 @@ function sendData(cmd, uid, channel, data, msgtype) {
gWebWorker.postMessage(arr);
}
if (gSipKeyIsOk && msgtype & MSGISFULL && data.length > 0) {
queuePostMsg(uid, channel, [date, arr, mHash, msgtype & MSGISIMAGE ? true : false, gForwardSecrecy]);
queuePostMsg(uid, channel, [msgDate.valueOf(), arr, mHash, msgtype & MSGISIMAGE ? true : false, gForwardSecrecy]);
}
}
}
Expand Down

0 comments on commit 3966d4b

Please sign in to comment.