|
|
|
@ -596,7 +596,10 @@ class LokiPublicChannelAPI {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async getMessengerData(adnMessage) {
|
|
|
|
|
if (!Array.isArray(adnMessage.annotations) || adnMessage.annotations.length === 0) {
|
|
|
|
|
if (
|
|
|
|
|
!Array.isArray(adnMessage.annotations) ||
|
|
|
|
|
adnMessage.annotations.length === 0
|
|
|
|
|
) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
const noteValue = adnMessage.annotations[0].value;
|
|
|
|
@ -627,9 +630,7 @@ class LokiPublicChannelAPI {
|
|
|
|
|
verifyObj.reply_to = adnMessage.reply_to;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const pubKeyBin = StringView.hexToArrayBuffer(
|
|
|
|
|
adnMessage.user.username
|
|
|
|
|
);
|
|
|
|
|
const pubKeyBin = StringView.hexToArrayBuffer(adnMessage.user.username);
|
|
|
|
|
const sigBin = StringView.hexToArrayBuffer(sig);
|
|
|
|
|
try {
|
|
|
|
|
await libsignal.Curve.async.verifySignature(
|
|
|
|
@ -668,7 +669,7 @@ class LokiPublicChannelAPI {
|
|
|
|
|
return {
|
|
|
|
|
timestamp,
|
|
|
|
|
quote,
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// get channel messages
|
|
|
|
@ -706,7 +707,6 @@ class LokiPublicChannelAPI {
|
|
|
|
|
if (!res.err && res.response) {
|
|
|
|
|
let receivedAt = new Date().getTime();
|
|
|
|
|
res.response.data.reverse().forEach(async adnMessage => {
|
|
|
|
|
|
|
|
|
|
// still update our last received if deleted, not signed or not valid
|
|
|
|
|
this.lastGot = !this.lastGot
|
|
|
|
|
? adnMessage.id
|
|
|
|
@ -802,7 +802,6 @@ class LokiPublicChannelAPI {
|
|
|
|
|
|
|
|
|
|
// now process any user meta data updates
|
|
|
|
|
// - update their conversation with a potentially new avatar
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
this.conversation.setLastRetrievedMessage(this.lastGot);
|
|
|
|
|
}
|
|
|
|
|