nandi/frqpublic Fork 0
e8f0b5f
Commits
Clone
git clone https://git.rickub.com/nandi/frq.git
git clone ssh://git@rickub.com/nandi/frq.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Read an empty tag value as no value

IRCv3 says a tag written `key=` and a tag written `key` say the same thing:
nothing. This disagreed. The bare form fell out of `some` as nil and the
empty one came back as "", which is a string, which is truthy — so a
`+reply=` on a line that answered nothing put a reply chip above it, and the
chip pointed at a message no id could ever find. What the reader saw was
"↩ replying to an earlier message" over lines that were replying to nothing,
on every one of freeq's frontends at once, and the way back to the quoted
line went with it: the fallback is a dim label, and a label is not a link.

Both halves read tags through here, so both were wrong the same way and are
right again together. It also stops an empty `+freeq.at/unreact` from taking
a reaction off and an empty `+react` from putting one on.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
nandi committed 2026-09-13T11:17:03-07:00 Browse files
e8f0b5f parent: c6ce105
modified common/frq/irc/parse.cljc +9 -2
@@ -81,12 +81,19 @@
8181 (str/replace "\n" "\\n")))
8282
8383 (defn tag-value
84- "One IRCv3 tag's value, unescaped, or nil."
84+ "One IRCv3 tag's value, unescaped, or nil.
85+
86+ A tag written with no value at all and one written `key=` say the same
87+ thing, which IRCv3 spells out and which this used to disagree with: the
88+ bare form fell through as nil and the empty one came back as `\"\"`. A
89+ caller asks `tag-value` whether a fact is there, and an empty string is a
90+ fact that is there — which is how a `+reply=` on a line answering nothing
91+ put a reply chip above it, pointing at a message no id could find."
8592 [tags key]
8693 (when tags
8794 (some (fn [pair]
8895 (let [[k v] (str/split pair #"=" 2)]
89- (when (= k key) (unescape-tag v))))
96+ (when (= k key) (not-empty (unescape-tag v)))))
9097 (str/split tags #";"))))
9198
9299 (defn nick-of
@@ -81,12 +81,19 @@
81 (str/replace "\n" "\\n")))81 (str/replace "\n" "\\n")))
82 82
83 (defn tag-value83 (defn tag-value
84- "One IRCv3 tag's value, unescaped, or nil."84+ "One IRCv3 tag's value, unescaped, or nil.
85+
86+ A tag written with no value at all and one written `key=` say the same
87+ thing, which IRCv3 spells out and which this used to disagree with: the
88+ bare form fell through as nil and the empty one came back as `\"\"`. A
89+ caller asks `tag-value` whether a fact is there, and an empty string is a
90+ fact that is there — which is how a `+reply=` on a line answering nothing
91+ put a reply chip above it, pointing at a message no id could find."
85 [tags key]92 [tags key]
86 (when tags93 (when tags
87 (some (fn [pair]94 (some (fn [pair]
88 (let [[k v] (str/split pair #"=" 2)]95 (let [[k v] (str/split pair #"=" 2)]
89- (when (= k key) (unescape-tag v))))96+ (when (= k key) (not-empty (unescape-tag v)))))
90 (str/split tags #";"))))97 (str/split tags #";"))))
91 98
92 (defn nick-of99 (defn nick-of