mirror of
https://github.com/status-im/status-react.git
synced 2025-01-11 03:26:31 +00:00
[#11160] Hide blocked users from mention suggestions
This commit is contained in:
parent
80faac0ca7
commit
1009b71908
@ -94,7 +94,7 @@
|
|||||||
:as message}]
|
:as message}]
|
||||||
(cond-> acc
|
(cond-> acc
|
||||||
(and alias (not= alias ""))
|
(and alias (not= alias ""))
|
||||||
(update :users assoc alias {:alias alias
|
(update :users assoc from {:alias alias
|
||||||
:name (or name alias)
|
:name (or name alias)
|
||||||
:identicon identicon
|
:identicon identicon
|
||||||
:public-key from})
|
:public-key from})
|
||||||
|
@ -72,7 +72,7 @@
|
|||||||
[{:keys [db]} {:keys [chat-id alias name identicon from]}]
|
[{:keys [db]} {:keys [chat-id alias name identicon from]}]
|
||||||
(when (and alias (not= alias ""))
|
(when (and alias (not= alias ""))
|
||||||
{:db (update-in db [:chats chat-id :users] assoc
|
{:db (update-in db [:chats chat-id :users] assoc
|
||||||
alias
|
from
|
||||||
{:alias alias
|
{:alias alias
|
||||||
:name (or name alias)
|
:name (or name alias)
|
||||||
:identicon identicon
|
:identicon identicon
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
"00000000000000000000000000000000000000000000000000090x0000000000000000000000000000000000000000000000000000000000000000",
|
"00000000000000000000000000000000000000000000000000090x0000000000000000000000000000000000000000000000000000000000000000",
|
||||||
:cursor-clock-value 9,
|
:cursor-clock-value 9,
|
||||||
:users
|
:users
|
||||||
{"alias" {:alias "alias",
|
{"from" {:alias "alias",
|
||||||
:name "name",
|
:name "name",
|
||||||
:identicon "identicon",
|
:identicon "identicon",
|
||||||
:public-key "from"}}}}}}
|
:public-key "from"}}}}}}
|
||||||
@ -67,7 +67,7 @@
|
|||||||
"00000000000000000000000000000000000000000000000000090x0000000000000000000000000000000000000000000000000000000000000000",
|
"00000000000000000000000000000000000000000000000000090x0000000000000000000000000000000000000000000000000000000000000000",
|
||||||
:cursor-clock-value 9,
|
:cursor-clock-value 9,
|
||||||
:users
|
:users
|
||||||
{"alias" {:alias "alias",
|
{"from" {:alias "alias",
|
||||||
:name "name",
|
:name "name",
|
||||||
:identicon "identicon",
|
:identicon "identicon",
|
||||||
:public-key "from"}}}}}}
|
:public-key "from"}}}}}}
|
||||||
|
@ -150,6 +150,8 @@
|
|||||||
(reg-root-key-sub :contacts/current-contact-identity :contacts/identity)
|
(reg-root-key-sub :contacts/current-contact-identity :contacts/identity)
|
||||||
(reg-root-key-sub :contacts/new-identity :contacts/new-identity)
|
(reg-root-key-sub :contacts/new-identity :contacts/new-identity)
|
||||||
(reg-root-key-sub :group/selected-contacts :group/selected-contacts)
|
(reg-root-key-sub :group/selected-contacts :group/selected-contacts)
|
||||||
|
(reg-root-key-sub :contacts/blocked-set :contacts/blocked)
|
||||||
|
|
||||||
;;wallet
|
;;wallet
|
||||||
(reg-root-key-sub :wallet :wallet)
|
(reg-root-key-sub :wallet :wallet)
|
||||||
(reg-root-key-sub :prices :prices)
|
(reg-root-key-sub :prices :prices)
|
||||||
@ -161,6 +163,7 @@
|
|||||||
(reg-root-key-sub :wallet/prepare-transaction :wallet/prepare-transaction)
|
(reg-root-key-sub :wallet/prepare-transaction :wallet/prepare-transaction)
|
||||||
(reg-root-key-sub :wallet-service/manual-setting :wallet-service/manual-setting)
|
(reg-root-key-sub :wallet-service/manual-setting :wallet-service/manual-setting)
|
||||||
(reg-root-key-sub :wallet-service/state :wallet-service/state)
|
(reg-root-key-sub :wallet-service/state :wallet-service/state)
|
||||||
|
|
||||||
;;commands
|
;;commands
|
||||||
(reg-root-key-sub :commands/select-account :commands/select-account)
|
(reg-root-key-sub :commands/select-account :commands/select-account)
|
||||||
|
|
||||||
@ -856,10 +859,14 @@
|
|||||||
:<- [:contacts/contacts]
|
:<- [:contacts/contacts]
|
||||||
(fn [contacts]
|
(fn [contacts]
|
||||||
(reduce
|
(reduce
|
||||||
(fn [acc [key {:keys [alias name identicon]}]]
|
(fn [acc [key {:keys [alias name identicon public-key] :as contact}]]
|
||||||
(if (and alias (not= alias ""))
|
(println :foo alias (contact.db/blocked? contact))
|
||||||
|
(if (and alias
|
||||||
|
(not= alias "")
|
||||||
|
(not (contact.db/blocked? contact)))
|
||||||
(let [name (utils/safe-replace name ".stateofus.eth" "")]
|
(let [name (utils/safe-replace name ".stateofus.eth" "")]
|
||||||
(assoc acc alias {:alias alias
|
(assoc acc public-key
|
||||||
|
{:alias alias
|
||||||
:name (or name alias)
|
:name (or name alias)
|
||||||
:identicon identicon
|
:identicon identicon
|
||||||
:public-key key}))
|
:public-key key}))
|
||||||
@ -871,14 +878,17 @@
|
|||||||
:chats/mentionable-users
|
:chats/mentionable-users
|
||||||
:<- [:chats/current-chat]
|
:<- [:chats/current-chat]
|
||||||
:<- [:chats/mentionable-contacts]
|
:<- [:chats/mentionable-contacts]
|
||||||
|
:<- [:contacts/blocked-set]
|
||||||
:<- [:multiaccount]
|
:<- [:multiaccount]
|
||||||
(fn [[{:keys [users]} contacts {:keys [name preferred-name photo-path public-key]}]]
|
(fn [[{:keys [users]} contacts blocked {:keys [name preferred-name photo-path public-key]}]]
|
||||||
|
(apply dissoc
|
||||||
(-> users
|
(-> users
|
||||||
(merge contacts)
|
(merge contacts)
|
||||||
(assoc public-key {:alias name
|
(assoc public-key {:alias name
|
||||||
:name (or preferred-name name)
|
:name (or preferred-name name)
|
||||||
:identicon photo-path
|
:identicon photo-path
|
||||||
:public-key public-key}))))
|
:public-key public-key}))
|
||||||
|
blocked)))
|
||||||
|
|
||||||
(re-frame/reg-sub
|
(re-frame/reg-sub
|
||||||
:chat/mention-suggestions
|
:chat/mention-suggestions
|
||||||
|
Loading…
x
Reference in New Issue
Block a user