Merge pull request #1244 from Bilb/fix-sending-errors-handling

pull/1248/head
Audric Ackermann 5 years ago committed by GitHub
commit 4e56ad2419
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1087,8 +1087,10 @@
}
const { body, attachments, preview, quote } = await this.uploadData();
const ourNumber = window.storage.get('primaryDevicePubKey');
const ourConversation = window.ConversationController.get(ourNumber);
const chatMessage = new libsession.Messages.Outgoing.ChatMessage({
const chatParams = {
identifier: this.id,
body,
timestamp: this.get('sent_at'),
@ -1096,8 +1098,14 @@
attachments,
preview,
quote,
lokiProfile: this.conversation.getOurProfile(),
});
};
if (ourConversation) {
chatParams.lokiProfile = ourConversation.getOurProfile();
}
const chatMessage = new libsession.Messages.Outgoing.ChatMessage(
chatParams
);
// Special-case the self-send case - we send only a sync message
if (recipients.length === 1) {

@ -96,8 +96,9 @@ class LokiMessageAPI {
// eslint-disable-next-line more/no-then
snode = await primitives.firstTrue(promises);
} catch (e) {
const snodeStr = snode ? `${snode.ip}:${snode.port}` : 'null';
log.warn(
`loki_message:::sendMessage - ${e.code} ${e.message} to ${pubKey} via ${snode.ip}:${snode.port}`
`loki_message:::sendMessage - ${e.code} ${e.message} to ${pubKey} via snode:${snodeStr}`
);
if (e instanceof textsecure.WrongDifficultyError) {
// Force nonce recalculation

@ -298,8 +298,6 @@ export async function storeOnNode(
return false;
}
const res = snodeRes as any;
const json = JSON.parse(snodeRes.body);
// Make sure we aren't doing too much PoW
const currentDifficulty = window.storage.get('PoWDifficulty', null);

Loading…
Cancel
Save