mirror of
https://github.com/status-im/status-react.git
synced 2025-01-11 11:34:45 +00:00
[#11152] Resolve self mentions in group chat
This commit is contained in:
parent
b43f9e0dfd
commit
80faac0ca7
@ -26,7 +26,7 @@
|
|||||||
nil)]
|
nil)]
|
||||||
(reduce
|
(reduce
|
||||||
(fn [acc {:keys [alias public-key identicon name]}]
|
(fn [acc {:keys [alias public-key identicon name]}]
|
||||||
(assoc acc alias
|
(assoc acc public-key
|
||||||
{:alias alias
|
{:alias alias
|
||||||
:identicon identicon
|
:identicon identicon
|
||||||
:public-key public-key
|
:public-key public-key
|
||||||
@ -34,15 +34,23 @@
|
|||||||
{}
|
{}
|
||||||
group-contacts))
|
group-contacts))
|
||||||
|
|
||||||
:else users)]
|
:else users)
|
||||||
|
{:keys [name preferred-name public-key photo-path]}
|
||||||
|
(:multiaccount db)]
|
||||||
(reduce
|
(reduce
|
||||||
(fn [acc [key {:keys [alias name identicon]}]]
|
(fn [acc [key {:keys [alias name identicon]}]]
|
||||||
(let [name (utils/safe-replace name ".stateofus.eth" "")]
|
(let [name (utils/safe-replace name ".stateofus.eth" "")]
|
||||||
(assoc acc alias {:alias alias
|
(assoc acc key
|
||||||
|
{:alias alias
|
||||||
:name (or name alias)
|
:name (or name alias)
|
||||||
:identicon identicon
|
:identicon identicon
|
||||||
:public-key key})))
|
:public-key key})))
|
||||||
chat-specific-suggestions
|
(assoc chat-specific-suggestions
|
||||||
|
public-key
|
||||||
|
{:alias name
|
||||||
|
:name (or preferred-name name)
|
||||||
|
:identicon photo-path
|
||||||
|
:public-key public-key})
|
||||||
contacts)))
|
contacts)))
|
||||||
|
|
||||||
(def ending-chars "[\\s\\.,;:]")
|
(def ending-chars "[\\s\\.,;:]")
|
||||||
|
@ -871,8 +871,14 @@
|
|||||||
:chats/mentionable-users
|
:chats/mentionable-users
|
||||||
:<- [:chats/current-chat]
|
:<- [:chats/current-chat]
|
||||||
:<- [:chats/mentionable-contacts]
|
:<- [:chats/mentionable-contacts]
|
||||||
(fn [[{:keys [users]} contacts]]
|
:<- [:multiaccount]
|
||||||
(merge users contacts)))
|
(fn [[{:keys [users]} contacts {:keys [name preferred-name photo-path public-key]}]]
|
||||||
|
(-> users
|
||||||
|
(merge contacts)
|
||||||
|
(assoc public-key {:alias name
|
||||||
|
:name (or preferred-name name)
|
||||||
|
:identicon photo-path
|
||||||
|
:public-key public-key}))))
|
||||||
|
|
||||||
(re-frame/reg-sub
|
(re-frame/reg-sub
|
||||||
:chat/mention-suggestions
|
:chat/mention-suggestions
|
||||||
|
Loading…
x
Reference in New Issue
Block a user