Skip to content

Forward client-only message tags on server links - #113

Open
MrIron-no wants to merge 1 commit into
UndernetIRC:mainfrom
MrIron-no:fix/s2s-client-tags
Open

MrIron-no wants to merge 1 commit into
UndernetIRC:mainfrom
MrIron-no:fix/s2s-client-tags

Conversation

@MrIron-no

Copy link
Copy Markdown
Contributor

Problem

msg_tag_format_s2s() dropped every client-only (+) tag before it even consulted CLIENTTAGDENY, so client tags never crossed a server link. A TAGMSG relayed to another server arrived as a bare TM #chan, and a PRIVMSG lost its client tags at the first hop. Only clients on the sending server ever saw them.

This has been the behaviour since the original message-tags commit (a060b5d). It went unnoticed because every tag test in the suite observed two clients on the same server; the only leaf-side assertions were for @time.

Fix

Forward client-only tags that pass this server's CLIENTTAGDENY. Tags from a local client were already filtered at parse time, and the receiving server filters again on delivery, so the deny list still applies on both edges. Only msg_tag.c and its header comment change.

Tests

New tests/pr_msgtags_compat/test_s2s_client_tags.py on the hub + leaf topology (the docker configs allow exactly +example.com/foo):

  • A client on leaf1 receives the allowed tag on a channel PRIVMSG, a TAGMSG, and a private PRIVMSG from a hub client. A denied tag on the same line is stripped while the allowed one still arrives.
  • A P10 peer on the hub sees the allowed tag in the outgoing P line's tag prefix, after @time=, with the denied tag absent.

Both tests fail on the unfixed formatter (tag missing on the leaf and on the wire) and pass with the fix.

msg_tag_format_s2s() dropped every client-only (+) tag, so a TAGMSG
relayed to another server arrived as a bare TM and a PRIVMSG lost its
client tags at the first hop.  Only clients on the sending server ever
saw them; every existing tag test observed two clients on one server.

Forward client-only tags that pass this server's CLIENTTAGDENY.  Tags
from a local client were already filtered at parse time, and the
receiving server filters again on delivery, so the deny list applies on
both edges.

Add tests: a leaf-side observer receives the tag on channel PRIVMSG,
TAGMSG and private PRIVMSG while a denied tag on the same line is
stripped, and the allowed tag is present on the P10 line leaving the
hub.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant