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 <eric@dvorsak.fr>
This commit is contained in:
parent
bd0b447457
commit
a0a79595ce
|
@ -76,8 +76,8 @@
|
||||||
(let [message-id (transport.utils/message-id this)
|
(let [message-id (transport.utils/message-id this)
|
||||||
public-keys (remove nil? (map :public-key (vals (:contacts/contacts db))))]
|
public-keys (remove nil? (map :public-key (vals (:contacts/contacts db))))]
|
||||||
(handlers-macro/merge-fx cofx
|
(handlers-macro/merge-fx cofx
|
||||||
(protocol/multi-send-with-pubkey {:public-keys public-keys
|
(protocol/multi-send-by-pubkey {:public-keys public-keys
|
||||||
:payload this}))))
|
:payload this}))))
|
||||||
(receive [this chat-id signature cofx]
|
(receive [this chat-id signature cofx]
|
||||||
(let [message-id (transport.utils/message-id this)]
|
(let [message-id (transport.utils/message-id this)]
|
||||||
(when (protocol/is-new? message-id)
|
(when (protocol/is-new? message-id)
|
||||||
|
|
|
@ -20,10 +20,10 @@
|
||||||
message/StatusMessage
|
message/StatusMessage
|
||||||
(send [this _ cofx]
|
(send [this _ cofx]
|
||||||
(let [public-keys (get-in cofx [:db :chats chat-id :contacts])]
|
(let [public-keys (get-in cofx [:db :chats chat-id :contacts])]
|
||||||
(protocol/multi-send-with-pubkey {:public-keys public-keys
|
(protocol/multi-send-by-pubkey {:public-keys public-keys
|
||||||
:chat-id chat-id
|
:chat-id chat-id
|
||||||
:payload this}
|
:payload this}
|
||||||
cofx)))
|
cofx)))
|
||||||
(receive [this _ signature {:keys [db] :as cofx}]
|
(receive [this _ signature {:keys [db] :as cofx}]
|
||||||
(handlers-macro/merge-fx cofx
|
(handlers-macro/merge-fx cofx
|
||||||
{:shh/add-new-sym-key {:web3 (:web3 db)
|
{:shh/add-new-sym-key {:web3 (:web3 db)
|
||||||
|
@ -129,4 +129,3 @@
|
||||||
(str participant-leaving-name " " (i18n/label :t/left))))
|
(str participant-leaving-name " " (i18n/label :t/left))))
|
||||||
(group/participants-removed chat-id #{signature})
|
(group/participants-removed chat-id #{signature})
|
||||||
(send-new-group-key nil chat-id))))))
|
(send-new-group-key nil chat-id))))))
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@
|
||||||
(select-keys (get-in db [:transport/chats public-key]) [:topic :sym-key-id]))
|
(select-keys (get-in db [:transport/chats public-key]) [:topic :sym-key-id]))
|
||||||
public-keys))
|
public-keys))
|
||||||
|
|
||||||
(defn multi-send-with-pubkey
|
(defn multi-send-by-pubkey
|
||||||
"Sends payload to multiple participants selected by `:public-keys` key. "
|
"Sends payload to multiple participants selected by `:public-keys` key. "
|
||||||
[{:keys [payload public-keys success-event]} {:keys [db] :as cofx}]
|
[{:keys [payload public-keys success-event]} {:keys [db] :as cofx}]
|
||||||
(let [{:keys [current-public-key web3]} db
|
(let [{:keys [current-public-key web3]} db
|
||||||
|
|
Loading…
Reference in New Issue