Skip to content

Commit

Permalink
fix contacts
Browse files Browse the repository at this point in the history
  • Loading branch information
cammellos committed Jun 24, 2019
1 parent 7137090 commit 252ab1a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/status_im/pairing/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@
(map #(transport.pairing/SyncInstallation. {} {} %))))

(defn sync-installation-messages [{:keys [db] :as cofx}]
(let [contacts (:contacts/contacts db)
contact-batches (partition-all contact-batch-n (vals contacts))]
(let [contacts (contact.db/get-active-contacts (:contacts/contacts db))
contact-batches (partition-all contact-batch-n contacts)]
(concat (mapv contact-batch->sync-installation-message contact-batches)
[(sync-installation-account-message cofx)]
(chats->sync-installation-messages cofx))))
Expand Down
26 changes: 17 additions & 9 deletions test/cljs/status_im/test/pairing/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -252,35 +252,43 @@
:chat-id "status"}}
:contacts/contacts {"contact-1" {:name "contact-1"
:public-key "contact-1"
:system-tags #{}}
:system-tags #{:contact/added}}
"contact-2" {:name "contact-2"
:public-key "contact-2"
:system-tags #{}}
:system-tags #{:contact/added}}
"contact-3" {:name "contact-3"
:public-key "contact-3"
:system-tags #{}}
:system-tags #{:contact/added}}
"contact-4" {:name "contact-4"
:public-key "contact-4"
:system-tags #{}}
:system-tags #{:contact/added}}
"contact-5" {:name "contact-5"
:public-key "contact-5"
:system-tags #{:contact/added}}
"contact-6" {:name "contact-6"
:public-key "contact-6"
:system-tags #{:contact/blocked}}}}}
expected [(transport.pairing/SyncInstallation. {"contact-1" {:name "contact-1"
:public-key "contact-1"
:system-tags #{}}
:pending? false
:system-tags #{:contact/added}}
"contact-2" {:name "contact-2"
:pending? false
:public-key "contact-2"
:system-tags #{}}
:system-tags #{:contact/added}}
"contact-3" {:name "contact-3"
:pending? false
:public-key "contact-3"
:system-tags #{}}
:system-tags #{:contact/added}}
"contact-4" {:name "contact-4"
:pending? false
:public-key "contact-4"
:system-tags #{}}}
:system-tags #{:contact/added}}}
{} {})
(transport.pairing/SyncInstallation. {"contact-5" {:name "contact-5"
:public-key "contact-5"
:system-tags #{}}} {} {})
:pending? false
:system-tags #{:contact/added}}} {} {})
(transport.pairing/SyncInstallation. {} {:photo-path "photo-path"
:name "name"
:last-updated 1} {})
Expand Down

0 comments on commit 252ab1a

Please sign in to comment.