mirror of
https://github.com/status-im/status-react.git
synced 2025-02-19 22:28:40 +00:00
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
|
(defn- send-message
|
||||||
[{:keys [web3 network-status local-storage chats]
|
[{:keys [web3 network-status local-storage chats]
|
||||||
:contacts/keys [contacts]
|
:contacts/keys [contacts]
|
||||||
|
:accounts/keys [accounts current-account-id]
|
||||||
:as db}
|
:as db}
|
||||||
{:keys [message-type content from chat-id to] :as message}]
|
{:keys [message-type content from chat-id to] :as message}]
|
||||||
(let [{:keys [dapp? fcm-token]} (get contacts chat-id)
|
(let [{:keys [dapp? fcm-token]} (get contacts chat-id)
|
||||||
{:keys [public-key private-key]} (get chats 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,
|
;; 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
|
;; so we are just calling jail `on-message-send` function
|
||||||
(when message
|
(when message
|
||||||
|
@ -24,12 +24,12 @@
|
|||||||
|
|
||||||
(def window-width (:width (react/get-dimensions "window")))
|
(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]
|
(letsubs [current-account [:get-current-account]
|
||||||
incoming-name [:contact-name-by-identity from]]
|
incoming-name [:contact-name-by-identity from]]
|
||||||
(when-let [name (if outgoing
|
(when-let [name (if outgoing
|
||||||
(:name current-account)
|
(:name current-account)
|
||||||
(or incoming-name (gfycat/generate-gfy from)))]
|
(or incoming-name username (gfycat/generate-gfy from)))]
|
||||||
[react/text {:style style/author} name])))
|
[react/text {:style style/author} name])))
|
||||||
|
|
||||||
(defview message-content-status []
|
(defview message-content-status []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user