send correct username in public group chat message and show it
This commit is contained in:
parent
5ecdb174e2
commit
c4151534fb
|
@ -34,11 +34,12 @@
|
|||
(defn- send-message
|
||||
[{:keys [web3 network-status local-storage chats]
|
||||
:contacts/keys [contacts]
|
||||
:accounts/keys [accounts current-account-id]
|
||||
:as db}
|
||||
{:keys [message-type content from chat-id to] :as message}]
|
||||
(let [{:keys [dapp? fcm-token]} (get contacts chat-id)
|
||||
{:keys [public-key private-key]} (get chats chat-id)
|
||||
sender-name (get-in contacts [from :name])]
|
||||
sender-name (get-in accounts [current-account-id :name])]
|
||||
;; whenever we are sending message to DApp, we are assuming it's a status bot,
|
||||
;; so we are just calling jail `on-message-send` function
|
||||
(when message
|
||||
|
|
|
@ -24,12 +24,12 @@
|
|||
|
||||
(def window-width (:width (react/get-dimensions "window")))
|
||||
|
||||
(defview message-author-name [{:keys [outgoing from] :as message}]
|
||||
(defview message-author-name [{:keys [outgoing from username] :as message}]
|
||||
(letsubs [current-account [:get-current-account]
|
||||
incoming-name [:contact-name-by-identity from]]
|
||||
(when-let [name (if outgoing
|
||||
(:name current-account)
|
||||
(or incoming-name (gfycat/generate-gfy from)))]
|
||||
(or incoming-name username (gfycat/generate-gfy from)))]
|
||||
[react/text {:style style/author} name])))
|
||||
|
||||
(defview message-content-status []
|
||||
|
|
Loading…
Reference in New Issue