Skip to content

Commit

Permalink
FindAndMatch fix regarding hashing.
Browse files Browse the repository at this point in the history
  • Loading branch information
jq-rs committed Sep 9, 2020
1 parent e6c1365 commit 6e8bcf2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/mlestalk.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ function uidQueueGet(uid, channel) {
return gUidQueue[get_uniq(uid, channel)];
}

function queueFindAndMatch(msgTimestamp, uid, channel, message) {
function queueFindAndMatch(msgTimestamp, uid, channel, message, isFull) {
let q = uidQueueGet(uid, channel);
if (q) {
let lastSeen = -1;
Expand All @@ -142,7 +142,7 @@ function queueFindAndMatch(msgTimestamp, uid, channel, message) {
continue;
}
if(message.length > 0) {
let hash = hashMessage(uid, message);
let hash = hashMessage(uid, isFull ? msgTimestamp + message + '\n' : msgTimestamp + message);
if (obj[2] == hash) {
lastSeen = i + 1;
break;
Expand Down Expand Up @@ -620,7 +620,7 @@ function processData(uid, channel, msgTimestamp,
resync(uid, channel);
}
if ((isFull && message.length > 0) || (!isFull && message.length == 0)) /* Full or presence message */
queueFindAndMatch(msgTimestamp, uid, channel, message);
queueFindAndMatch(msgTimestamp, uid, channel, message, isFull);
}
else if (gOwnId > 0 && message.length >= 0 && gLastWrittenMsg.length > 0) {
let end = "</li></div>";
Expand Down

0 comments on commit 6e8bcf2

Please sign in to comment.