fix mention turns into unknown in community (#15285)

This commit is contained in:
Parvesh Monu 2023-03-08 20:15:05 +05:30 committed by GitHub
parent 0345871b66
commit e9310a2ace
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -25,7 +25,7 @@
(defn displayed-name
"Use preferred name, display-name, name or alias in that order"
[{:keys [name display-name preferred-name alias public-key ens-verified]}]
[{:keys [name display-name preferred-name alias public-key ens-verified primary-name]}]
(let [display-name (if (string/blank? display-name) nil display-name)
ens-name (or preferred-name
display-name
@ -33,7 +33,7 @@
;; Preferred name is our own otherwise we make sure it's verified
(if (or preferred-name (and ens-verified name))
ens-name
(or display-name alias (gfycat/generate-gfy public-key)))))
(or display-name primary-name alias (gfycat/generate-gfy public-key)))))
(defn contact-by-identity
[contacts identity]

View File

@ -217,11 +217,13 @@
all-contacts (:contacts/contacts db)
chat (get-in db [:chats chat-id])
current-multiaccount (:multiaccount db)
community-members (when (= (:chat-type chat) chat.constants/community-chat-type)
(get-in db [:communities (:community-id chat) :members]))
mentionable-users (mentions/get-mentionable-users
chat
all-contacts
current-multiaccount
nil)
community-members)
hydrated-mentions (map
(fn [[t mention :as e]]
(if (= t :mention)