summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2026-04-26 19:40:32 -0300
committerEuAndreh <eu@euandre.org>2026-04-26 19:40:32 -0300
commit8d605645096a3afb46aee4ca71ccf02edeed2150 (patch)
tree1e679749f6a6f298483dc919e521d9aebcb90a84 /src
parentImplement CHATHISTORY subcommands, TOPIC events, REDACT cap filter (diff)
downloadpapod-8d605645096a3afb46aee4ca71ccf02edeed2150.tar.gz
papod-8d605645096a3afb46aee4ca71ccf02edeed2150.tar.xz
WHOIS: send 330 RPL_WHOISACCOUNT, hide channels for invisible users
- Track :account on SASL authentication so WHOIS can return RPL_WHOISACCOUNT - Filter channels in 319 RPL_WHOISCHANNELS by invisibility: hide channels of +i users from non-members
Diffstat (limited to 'src')
-rw-r--r--src/papod.clj18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/papod.clj b/src/papod.clj
index 35dffdc..ded224d 100644
--- a/src/papod.clj
+++ b/src/papod.clj
@@ -1323,7 +1323,8 @@
(swap! client assoc :sasl-state nil)
(if (uuid? result)
(do (swap! client assoc :authenticated? true
- :session-id result)
+ :session-id result
+ :account authcid)
(create-session+logon! (:conn components) client result)
[(numeric-reply client "900"
(str nick "!" nick "@localhost " authcid
@@ -3423,14 +3424,21 @@
uname (or (:username u) found-nick)
rname (or (:realname u) found-nick)
away (:away st)
+ invisible? (boolean (:invisible? st))
+ asker-nick (client-target client)
ops (:ops components)
voiced (:voiced components)
chans
(when (:channels components)
(for [[ch members]
@(:channels components)
- :when (contains? members
- found-nick)
+ :when (and (contains? members
+ found-nick)
+ (or (not invisible?)
+ (= found-nick
+ asker-nick)
+ (contains? members
+ asker-nick)))
:let
[op? (and ops
(contains?
@@ -3463,6 +3471,10 @@
(str found-nick " :"
(string/join " "
chans))))
+ (:account st)
+ (conj (numeric-reply client "330"
+ (str found-nick " " (:account st)
+ " :is logged in as")))
true
(conj (numeric-reply client "317"
(str found-nick " 0 "