cli: do not log events for hidden user profiles (#4658)

* cli: do not log events for hidden user profiles

* fix
This commit is contained in:
Evgeny
2024-08-12 08:45:11 +01:00
committed by GitHub
parent 1d9c5b7a0b
commit 02c404593c
2 changed files with 4 additions and 2 deletions

View File

@@ -415,8 +415,8 @@ responseToView hu@(currentRH, user_) ChatConfig {logLevel, showReactions, showRe
CRCustomChatResponse u r -> ttyUser' u $ map plain $ T.lines r
where
ttyUser :: User -> [StyledString] -> [StyledString]
ttyUser user@User {showNtfs, activeUser} ss
| showNtfs || activeUser = ttyUserPrefix user ss
ttyUser user@User {showNtfs, activeUser, viewPwdHash} ss
| (showNtfs && isNothing viewPwdHash) || activeUser = ttyUserPrefix user ss
| otherwise = []
ttyUserPrefix :: User -> [StyledString] -> [StyledString]
ttyUserPrefix _ [] = []

View File

@@ -2032,6 +2032,8 @@ testUserPrivacy =
bob <# "alisa> hello"
bob #> "@alisa hey"
alice <# "bob> hey"
bob #> "@alice hey"
(alice, "[user: alice] ") ^<# "bob> hey"
-- hide user profile
alice ##> "/hide user my_password"
userHidden alice "current "