lint pass 1

pull/517/head
Ryan Tharp 6 years ago committed by GitHub
parent 6ac6d656a4
commit 8bfb7f297d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -536,7 +536,9 @@ class LokiPublicChannelAPI {
} }
async getMessengerData(adnMessage) { async getMessengerData(adnMessage) {
if (!Array.isArray(adnMessage.annotations) || adnMessage.annotations.length === 0) return false; if (!Array.isArray(adnMessage.annotations) || adnMessage.annotations.length === 0) {
return false;
}
const noteValue = adnMessage.annotations[0].value; const noteValue = adnMessage.annotations[0].value;
// signatures now required // signatures now required
@ -544,17 +546,11 @@ class LokiPublicChannelAPI {
return false; return false;
} }
let timetstamp = 0;
let quote = null;
// timestamp is the only required field we've had since the first deployed version // timestamp is the only required field we've had since the first deployed version
({ timestamp } = noteValue); let { timestamp, quote } = noteValue;
if (noteValue.quote) { if (quote) {
({ quote } = noteValue); quote.attachments = [];
if (quote) {
quote.attachments = [];
}
} }
// try to verify signature // try to verify signature
@ -611,7 +607,7 @@ class LokiPublicChannelAPI {
return { return {
timestamp, timestamp,
quote quote,
} }
} }
@ -672,7 +668,7 @@ class LokiPublicChannelAPI {
return; return;
} }
const timestamp = messengerData.timestamp; const { timestamp, quote } = messengerData;
if (!timestamp) { if (!timestamp) {
return; // Invalid message return; // Invalid message
} }
@ -704,14 +700,12 @@ class LokiPublicChannelAPI {
timestamp, timestamp,
}, },
].splice(-5); ].splice(-5);
const quote = messengerData.quote;
const from = adnMessage.user.name; // profileName const from = adnMessage.user.name; // profileName
const messageData = { const messageData = {
serverId: adnMessage.id, serverId: adnMessage.id,
clientVerified: sigValid, clientVerified: true,
friendRequest: false, friendRequest: false,
source: adnMessage.user.username, source: adnMessage.user.username,
sourceDevice: 1, sourceDevice: 1,

Loading…
Cancel
Save