show client service status in users list

This commit is contained in:
Evgeny Poberezkin
2025-12-30 08:18:12 +00:00
parent e68dec2896
commit 14bf02135a
2 changed files with 4 additions and 1 deletions

View File

@@ -588,13 +588,14 @@ viewUsersList us =
in if null ss then ["no users"] else ss
where
ldn (UserInfo User {localDisplayName = n} _) = T.toLower n
userInfo (UserInfo User {localDisplayName = n, profile = LocalProfile {fullName, shortDescr, peerType}, activeUser, showNtfs, viewPwdHash} count)
userInfo (UserInfo User {localDisplayName = n, profile = LocalProfile {fullName, shortDescr, peerType}, activeUser, showNtfs, viewPwdHash, clientService} count)
| activeUser || isNothing viewPwdHash = Just $ ttyFullName n fullName shortDescr <> infoStr <> bot
| otherwise = Nothing
where
infoStr = if null info then "" else " (" <> mconcat (intersperse ", " info) <> ")"
info =
[highlight' "active" | activeUser]
<> [highlight' "service" | isTrue clientService]
<> [highlight' "hidden" | isJust viewPwdHash]
<> ["muted" | not showNtfs]
<> [plain ("unread: " <> show count) | count /= 0]

View File

@@ -4201,6 +4201,8 @@ testClientService ps =
alice <##> service
service ##> "/set client service 1:service_user off"
service <## "error: chat not stopped"
service ##> "/users"
service <## "service_user (Service user) (active, service)"
-- connect as service
withTestChat ps "service" $ \service -> do
subscribeClientService service 1