summaryrefslogtreecommitdiff
path: root/src/papod.clj
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2026-04-29 10:09:47 -0300
committerEuAndreh <eu@euandre.org>2026-04-29 10:09:47 -0300
commit3f258389f395dc36ea2acbcd70254c3a17f631aa (patch)
treec62f6ac6ef957ce271cbc7cc121c047248eac4c4 /src/papod.clj
parentWALLOPS, HELP and HELPOP commands (diff)
downloadpapod-3f258389f395dc36ea2acbcd70254c3a17f631aa.tar.gz
papod-3f258389f395dc36ea2acbcd70254c3a17f631aa.tar.xz
IRCv3 bot-mode capability
Advertise BOT=B in ISUPPORT and recognise the +B user mode. Three of the five irctest bot_mode cases now pass (testBotMode, testBotWhois, testBotPrivateMessage); the channel-join cases (testBotChannelMessage, testBotWhox) hit a pre-existing concurrent-JOIN race in papod that is unrelated to bot-mode and needs a separate fix. Implementation: - ISUPPORT 005 now advertises BOT=B alongside the other tokens. - handle-mode tracks a :bot? flag via +B/-B and surfaces it in the 221 RPL_UMODEIS summary alongside i/o/w/T. - WHOIS emits 335 RPL_WHOISBOT for any bot-flagged target. - WHO/WHOX flag column includes the BOT mode char (B) for bots. - PRIVMSGs originating from a bot now carry the IRCv3 'bot' message tag — added presence-style to out-tags so it propagates to every recipient with message-tags, both for channels and DMs.
Diffstat (limited to 'src/papod.clj')
-rw-r--r--src/papod.clj11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/papod.clj b/src/papod.clj
index 22e0bea..589ab13 100644
--- a/src/papod.clj
+++ b/src/papod.clj
@@ -1201,7 +1201,7 @@
" MAXTARGETS=4"
" :are supported by this server"))
(numeric-reply client "005"
- (str "MODES=4 MONITOR=100"
+ (str "BOT=B MODES=4 MONITOR=100"
" NETWORK=papod"
" NICKLEN=30 PREFIX=(ov)@+"
" STATUSMSG=@+"
@@ -2343,6 +2343,8 @@
out-tags (cond-> []
reply-id
(conj (str "+reply=" reply-id))
+ (:bot? @client)
+ (conj "bot")
(seq client-tag-pairs)
(into (map (fn [[k v]]
(str k "=" v))
@@ -4607,6 +4609,10 @@
(conj (numeric-reply client "313"
(str found-nick
" :is an IRC operator")))
+ (:bot? st)
+ (conj (numeric-reply client "335"
+ (str found-nick
+ " :is a bot on " +server-name+)))
away
(conj (numeric-reply client "301"
(str found-nick " :" away)))
@@ -4674,6 +4680,7 @@
(when (:invisible? @client) "i")
(when (:oper? @client) "o")
(when (:wallops? @client) "w")
+ (when (:bot? @client) "B")
(when (:no-ctcp? @client) "T"))]
[(numeric-reply client "221" modes)])
@@ -4689,6 +4696,7 @@
\i (swap! client assoc :invisible? adding?)
\T (swap! client assoc :no-ctcp? adding?)
\w (swap! client assoc :wallops? adding?)
+ \B (swap! client assoc :bot? adding?)
\o (when-not adding?
(swap! client assoc :oper? false))
nil))
@@ -5006,6 +5014,7 @@
mn))
flag (str (if away "G" "H")
(when (:oper? st) "*")
+ (when (:bot? st) "B")
(cond
(and op? voc? mp?)
"@+"