Fix broken contact syncing

Signed-off-by: Igor Mandrigin <i@mandrigin.ru>
This commit is contained in:
Andrea Maria Piana 2019-04-25 09:53:49 +02:00 committed by Igor Mandrigin
parent bdb672e131
commit 494772a35d
No known key found for this signature in database
GPG Key ID: 4A0EDDE26E66BC8B
3 changed files with 12 additions and 10 deletions

View File

@ -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 {} {})))

View File

@ -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

View File

@ -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",