if messages attachment version Message messages attachment version Pru

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
if (!messages[i].attachment["version.Message"] && !messages[i].attachment["version.PrunablePlainMessage"]) {
try {
decoded = converters.hexStringToString(messages[i].attachment.message);
} catch (err) {
//legacy
if (messages[i].attachment.message.indexOf("feff") === 0) {
decoded = NRS.convertFromHex16(messages[i].attachment.message);
} else {
decoded = NRS.convertFromHex8(messages[i].attachment.message);
}
}
} else {
decoded = String(messages[i].attachment.message);
}