messages-recv,encode: Implement proper fixes

This commit is contained in:
Rajeh Taher
2025-01-31 23:59:04 +02:00
parent fcbae0e3f2
commit b1fcab0216
2 changed files with 9 additions and 12 deletions

View File

@@ -171,7 +171,7 @@ const encodeBinaryNodeInner = (
for(const char of str) {
const isInNibbleRange = char >= '0' && char <= '9'
if(!isInNibbleRange && !(char >= 'A' && char <= 'F') && !(char >= 'a' && char <= 'f')) {
if(!isInNibbleRange && !(char >= 'A' && char <= 'F')) {
return false
}
}
@@ -189,6 +189,8 @@ const encodeBinaryNodeInner = (
pushByte(tokenIndex.index)
} else if(isNibble(str)) {
writePackedBytes(str, 'nibble')
} else if(isHex(str)) {
writePackedBytes(str, 'hex')
} else if(str) {
const decodedJid = jidDecode(str)
if(decodedJid) {