feat: add support for FB and Interop JID encoding/decoding and empty strings (#2189)
This commit is contained in:
@@ -182,6 +182,11 @@ const encodeBinaryNodeInner = (
|
||||
return
|
||||
}
|
||||
|
||||
if (str === '') {
|
||||
writeStringRaw(str)
|
||||
return
|
||||
}
|
||||
|
||||
const tokenIndex = TOKEN_MAP[str]
|
||||
if (tokenIndex) {
|
||||
if (typeof tokenIndex.dict === 'number') {
|
||||
@@ -193,7 +198,7 @@ const encodeBinaryNodeInner = (
|
||||
writePackedBytes(str, 'nibble')
|
||||
} else if (isHex(str)) {
|
||||
writePackedBytes(str, 'hex')
|
||||
} else if (str) {
|
||||
} else {
|
||||
const decodedJid = jidDecode(str)
|
||||
if (decodedJid) {
|
||||
writeJid(decodedJid)
|
||||
|
||||
Reference in New Issue
Block a user