From a976388315f9d865e6300ab6543da39f7ef713ca Mon Sep 17 00:00:00 2001 From: Ryan Tharp Date: Tue, 24 Sep 2019 18:36:25 -0700 Subject: [PATCH] Handle annotations omit correctly --- js/modules/loki_public_chat_api.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/modules/loki_public_chat_api.js b/js/modules/loki_public_chat_api.js index f99320fe0..0da4cac2a 100644 --- a/js/modules/loki_public_chat_api.js +++ b/js/modules/loki_public_chat_api.js @@ -559,7 +559,9 @@ class LokiPublicChannelAPI { // try to verify signature const { sig, sigver } = noteValue; - const annoCopy = _.omit(adnMessage.annotations, ['value.sig', 'value.sigver']); + const annoCopy = [ ...adnMessage.annotations ]; + delete annoCopy[0].value.sig; + delete annoCopy[0].value.sigver; const verifyObj = { text: adnMessage.text, version: sigver, @@ -602,6 +604,9 @@ class LokiPublicChannelAPI { // we now only accept valid messages into the public chat return false; } + // any error should cause problem + log.error(`Unhandled message signature validation error ${e.message}`); + return false; } return {