[#17446] fix: Display name is not shown in chats after sync (#17591)

This commit is contained in:
Mohsen 2023-10-10 14:36:40 +03:00 committed by GitHub
parent bcc175041a
commit 36dd828a55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 6 deletions

View File

@ -41,13 +41,16 @@
(defn contact-two-names-by-identity (defn contact-two-names-by-identity
[contact profile contact-identity] [contact profile contact-identity]
(let [me? (= (:public-key profile) contact-identity)] (let [{:keys [public-key preferred-name display-name]} profile
{:keys [primary-name secondary-name]} contact
me? (= public-key contact-identity)]
(if me? (if me?
[(or (:preferred-name profile) [(cond
(:display-name profile) (not (string/blank? preferred-name)) preferred-name
(:primary-name contact) (not (string/blank? display-name)) display-name
(gfycat/generate-gfy contact-identity))] (not (string/blank? primary-name)) primary-name
[(:primary-name contact) (:secondary-name contact)]))) :else (gfycat/generate-gfy contact-identity))]
[primary-name secondary-name])))
(defn displayed-photo (defn displayed-photo
[{:keys [images]}] [{:keys [images]}]