From 8782ecc06d6c1460a5a798c522de6889d7e30dc3 Mon Sep 17 00:00:00 2001 From: Eric Dvorsak Date: Fri, 1 Jun 2018 00:47:45 +0200 Subject: [PATCH] [fix 4574] do not send updates to pending contacts fixes #4574 updates were sent to all pending contacts fixes that by filtering on the pending? key --- src/status_im/transport/message/v1/contact.cljs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/status_im/transport/message/v1/contact.cljs b/src/status_im/transport/message/v1/contact.cljs index 331530d844..42a03dbbe7 100644 --- a/src/status_im/transport/message/v1/contact.cljs +++ b/src/status_im/transport/message/v1/contact.cljs @@ -68,7 +68,13 @@ (defrecord ContactUpdate [name profile-image] message/StatusMessage (send [this _ {:keys [db] :as cofx}] - (let [public-keys (into #{} (remove nil? (map :public-key (vals (:contacts/contacts db))))) + (let [public-keys (reduce (fn [acc [_ {:keys [public-key pending?]}]] + (if (and public-key + (not pending?)) + (conj acc public-key) + acc)) + #{} + (:contacts/contacts db)) recipients (filter #(public-keys (first %)) (:transport/chats db))] (handlers-macro/merge-effects cofx