-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MVP for message tags #355
Draft
RaitoBezarius
wants to merge
13
commits into
solanum-ircd:main
Choose a base branch
from
RaitoBezarius:message-tags
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
MVP for message tags #355
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RaitoBezarius
force-pushed
the
message-tags
branch
from
July 19, 2022 14:26
ce34e37
to
b37d22f
Compare
RaitoBezarius
force-pushed
the
message-tags
branch
4 times, most recently
from
July 19, 2022 21:48
cd3825b
to
185a710
Compare
This introduces an handler to accept or not the propagation of a tag. Basic sketch API is provided for modules to hook for providing their own policy for specific tag propagation.
RaitoBezarius
force-pushed
the
message-tags
branch
2 times, most recently
from
July 20, 2022 22:03
a45bada
to
5c7df7b
Compare
It provides for hook facilities to client-only tags: - messages can be dropped silently ; - messages can be edited ; - messages can be stripped from a client-only tag
RaitoBezarius
force-pushed
the
message-tags
branch
from
July 24, 2022 14:19
5c7df7b
to
d25e9ab
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This enables very basic support of message tags specification.
It has been discussed on
#solanum@libera.chat
with edk and others (thank you a lot for the guidance).I open this for discussion and having as much feedback as possible.
Implementation plan
CLIENTTAGDENY
ISUPPORT table.message-tags
CAP announcecap_message_tags
module which propagate no tags from incoming message (based on the server time machinery).Open questions
Advanced feature degradation
The issue is that when
m_message
module takes the decision to send a message, it provides a Msgbuf buffer structure and pass most of its arguments in a VA list which is not in the Msgbuf structure, therefore, it is impossible to operate on it and convert, let's say, a TAGMSG into a PRIVMSG to degrade it.Maybe, we could hack for outbound_msgbuf to support getting a pointer to the va_list so we can operate on the arguments and change the current message, but it looks like heavily hacky and dangerous, plus, it's arbitrary string operations because there is no structure at this point in the message saying this is a PRIVMSG, etc. So a quick'n'dirty solution is to
msgbuf_parse
(more: partially parse, ignore the tags, they are not serialized at this point) thebuf
.What I noticed is this mechanism of Msgbuf cache which I do not understand well, which seems to replace progressively the
vsprintf
into a buffer stuff.I assume the intention here is to replace everything with Msgbuf mechanisms.
The only issue I see is that: it still requires to move the outbound msgbuf hook after finalization of the buffer.
Once we can do this, we can tamper with the buf and do nice degradation, plus we can also drop messages silently (e.g. a spammer using
TAGMSG +draft/typing=active
on all channels.)Another way would be to slow down the serialization and keep structure at this point or to move the outbound msgbuf hook earlier where there is still structure.
Non-goals
Remarks
At some point, we would like to get capabilities for client-only tags so that server can degrade them for unsupported clients (on the basis they creates precious discussion contexts). A suggestion while ircv3/ircv3-ideas#97 is discussed is to use vendor-prefixed capabilities for client-only tags such as
solanum.chat/reacts
as a capability to test the ideas and implementations.Nevertheless, any non trivial client-only tag relies on replies client tag and message-ids. Therefore, this is out of scope for this PR for now.
Though, there is a need for filtering client-only tags based on channels (modes?) which will also require specification I suppose and ultimately implementation, this seems to be independant from message-ids and replies client tag.
Based on #283.