summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2026-04-26 11:33:04 -0300
committerEuAndreh <eu@euandre.org>2026-04-26 11:33:04 -0300
commitc501e810c3cdce2a6a262d75341c18e5f3971c08 (patch)
tree8575ac6e9bc8568c2c2ac4b4e92a734e81b92d79 /src
parentReject overlong input with ERR_INPUTTOOLONG (diff)
downloadpapod-c501e810c3cdce2a6a262d75341c18e5f3971c08.tar.gz
papod-c501e810c3cdce2a6a262d75341c18e5f3971c08.tar.xz
Forward client tags through PRIVMSG to recipients
Client-supplied tags starting with '+' (other than the special +reply tag) are now propagated to recipients in the relayed PRIVMSG and to the sender in the echoed PRIVMSG, matching the IRCv3 client-only message tags spec.
Diffstat (limited to 'src')
-rw-r--r--src/papod.clj14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/papod.clj b/src/papod.clj
index 8b7d4d5..860e7ef 100644
--- a/src/papod.clj
+++ b/src/papod.clj
@@ -2026,9 +2026,19 @@
(-> (update 0 assoc
:papod.event/target-nick target))))))
;; DELIVER
- (let [out-tags (cond-> []
+ (let [client-tag-pairs
+ (->> (or tags {})
+ (filter (fn [[k _]]
+ (and (string/starts-with? k "+")
+ (not= k "+reply"))))
+ (sort-by first))
+ out-tags (cond-> []
reply-id
- (conj (str "+reply=" reply-id)))
+ (conj (str "+reply=" reply-id))
+ (seq client-tag-pairs)
+ (into (map (fn [[k v]]
+ (str k "=" v))
+ client-tag-pairs)))
raw (str ":" nick " PRIVMSG "
target " " content)
tagged (tag-line-with msg-id out-tags raw)