diff --git a/src/status_im/pairing/core.cljs b/src/status_im/pairing/core.cljs index cec49720cf..7e95da9f69 100644 --- a/src/status_im/pairing/core.cljs +++ b/src/status_im/pairing/core.cljs @@ -124,17 +124,20 @@ (select-keys account-mergeable-keys))] (transport.pairing/SyncInstallation. {} account {}))) +(defn- contact->pairing [contact] + (cond-> (-> contact + (dissoc :photo-path) + (update :system-tags disj :contact/blocked)) + ;; for compatibility with version < contact.v7 + (contact.db/added? contact) (assoc :pending? false) + (contact.db/legacy-pending? contact) (assoc :pending? true))) + (defn- contact-batch->sync-installation-message [batch] (let [contacts-to-sync (reduce (fn [acc {:keys [public-key system-tags] :as contact}] (assoc acc public-key - (cond-> (-> contact - (dissoc :photo-path) - (update :system-tags disj :contact/blocked)) - ;; for compatibility with version < contact.v7 - (contact.db/added? contact) (assoc :pending? false) - (contact.db/legacy-pending? contact) (assoc :pending? true)))) + (contact->pairing contact))) {} batch)] (transport.pairing/SyncInstallation. contacts-to-sync {} {}))) diff --git a/src/status_im/transport/impl/send.cljs b/src/status_im/transport/impl/send.cljs index 2ff6613cfe..9df5878d80 100644 --- a/src/status_im/transport/impl/send.cljs +++ b/src/status_im/transport/impl/send.cljs @@ -29,9 +29,8 @@ protocol/StatusMessage (send [this chat-id cofx] (let [sync-message (transport.pairing/SyncInstallation. - (select-keys - (get-in cofx [:db :contacts/contacts]) - [chat-id]) + {chat-id (pairing/contact->pairing + (get-in cofx [:db :contacts/contacts chat-id]))} nil nil)] (fx/merge cofx diff --git a/translations/en.json b/translations/en.json index a62dd0d826..d9229bf274 100644 --- a/translations/en.json +++ b/translations/en.json @@ -194,7 +194,7 @@ "devices": "Devices", "learn-more": "Learn more", "pair": "Pair devices", - "pair-this-device": "Pair this device", + "pair-this-device": "Advertise device", "pair-this-device-description": "Pair your devices to sync contacts and chats between them", "you": "you", "syncing-enabled": "Syncing enabled",