From a0a79595ce52ea7139ae5d91c9c4b70675e25631 Mon Sep 17 00:00:00 2001 From: Eric Dvorsak Date: Fri, 11 May 2018 23:52:45 +0200 Subject: [PATCH] Rename multi-send-with-pubkey into multi-send-by-pub-key previous naming was confusing because it actually sends using the symkey of each chat whose simkey is passed as an argument Signed-off-by: Eric Dvorsak --- src/status_im/transport/message/v1/contact.cljs | 4 ++-- src/status_im/transport/message/v1/group_chat.cljs | 9 ++++----- src/status_im/transport/message/v1/protocol.cljs | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/status_im/transport/message/v1/contact.cljs b/src/status_im/transport/message/v1/contact.cljs index f6d6d37894..530cca414b 100644 --- a/src/status_im/transport/message/v1/contact.cljs +++ b/src/status_im/transport/message/v1/contact.cljs @@ -76,8 +76,8 @@ (let [message-id (transport.utils/message-id this) public-keys (remove nil? (map :public-key (vals (:contacts/contacts db))))] (handlers-macro/merge-fx cofx - (protocol/multi-send-with-pubkey {:public-keys public-keys - :payload this})))) + (protocol/multi-send-by-pubkey {:public-keys public-keys + :payload this})))) (receive [this chat-id signature cofx] (let [message-id (transport.utils/message-id this)] (when (protocol/is-new? message-id) diff --git a/src/status_im/transport/message/v1/group_chat.cljs b/src/status_im/transport/message/v1/group_chat.cljs index 622bb209b2..7775ce2cd6 100644 --- a/src/status_im/transport/message/v1/group_chat.cljs +++ b/src/status_im/transport/message/v1/group_chat.cljs @@ -20,10 +20,10 @@ message/StatusMessage (send [this _ cofx] (let [public-keys (get-in cofx [:db :chats chat-id :contacts])] - (protocol/multi-send-with-pubkey {:public-keys public-keys - :chat-id chat-id - :payload this} - cofx))) + (protocol/multi-send-by-pubkey {:public-keys public-keys + :chat-id chat-id + :payload this} + cofx))) (receive [this _ signature {:keys [db] :as cofx}] (handlers-macro/merge-fx cofx {:shh/add-new-sym-key {:web3 (:web3 db) @@ -129,4 +129,3 @@ (str participant-leaving-name " " (i18n/label :t/left)))) (group/participants-removed chat-id #{signature}) (send-new-group-key nil chat-id)))))) - diff --git a/src/status_im/transport/message/v1/protocol.cljs b/src/status_im/transport/message/v1/protocol.cljs index 2fe5dc9fbe..baacc8f624 100644 --- a/src/status_im/transport/message/v1/protocol.cljs +++ b/src/status_im/transport/message/v1/protocol.cljs @@ -65,7 +65,7 @@ (select-keys (get-in db [:transport/chats public-key]) [:topic :sym-key-id])) public-keys)) -(defn multi-send-with-pubkey +(defn multi-send-by-pubkey "Sends payload to multiple participants selected by `:public-keys` key. " [{:keys [payload public-keys success-event]} {:keys [db] :as cofx}] (let [{:keys [current-public-key web3]} db