Fix broken contact syncing
Signed-off-by: Igor Mandrigin <i@mandrigin.ru>
This commit is contained in:
parent
bdb672e131
commit
494772a35d
|
@ -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 {} {})))
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue