Skip to content
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

Client-tag for specifying in which shared channel a private NOTICE should be displayed #497

Closed
delthas opened this issue Apr 19, 2022 · 5 comments

Comments

@delthas
Copy link
Contributor

delthas commented Apr 19, 2022

Many IRC bots respond to commands in a channel with a private NOTICE.

>>> PRIVMSG #foo :!help
<<< :bot NOTICE me :i can't help

This is a common practice that is done to prevent flooding a channel with messages that are only useful to a single user. But there is no way for the client to actually know that this message was meant to be sent as a response to a query in #foo.

Most clients have developed heuristics to match incoming NOTICEs with a corresponding channel context that makes the most sense. In some clients this is built-in, in some others these are third-party scripts.

The usual order in which these channels are matched with these heuristics is typically:

  • the current channel shown in the client, if the sender is in that channel
  • a channel in which the sender is present (this could be the last opened channel in the client, the first one by order, the last one in which the client sent a message, ...)
  • optionally, the current channel even if the bot is not in it
  • an actual private buffer with the sender

This is a bit of a hack and is a bit harder to work with on clients that use CHATHISTORY and do not necessarily have a "client context" (which buffer did we open last at the time of receiving) at hand. eg if I connect after 1 week to my bouncer and run CHATHISTORY, my heuristic may not return the same result as if I had just received the message "live".

Now that we have client-only tags, we could make the bot send the actual channel the message refers to, in a client-only tag. This is a client-only tag because it does not require any processing from the server. Client-only tags are blacklisted from some servers/networks, but this is fine because it is a best-effort piece of information.

>>> PRIVMSG #foo :!help
<<< @+channel=#foo :bot NOTICE me :i can't help

The heuristic now becomes:

  • the channel specified in the channel tag, if the sender and the client are in that channel
  • ... (the usual other heuristics)

There is no particular security issue (as long as the client checks that the sender is indeed in the channel it pretends to refer a message to).

The actual tag name is open to discussion. A short list:

  • +channel
  • +channel-context

Thoughts?

Relates to/closes: #163

@progval
Copy link
Contributor

progval commented Apr 20, 2022

On networks which support it, you can use CPRIVMSG/CNOTICE (aka WHISPER) for this: https://github.com/evilnet/nefarious2/blob/master/doc/features.txt#L89

@grawity
Copy link
Contributor

grawity commented Apr 20, 2022

On networks which support it, you can use CPRIVMSG/CNOTICE (aka WHISPER) for this: https://github.com/evilnet/nefarious2/blob/master/doc/features.txt#L89

CNOTICE is not the same thing as WHISPER; it only affects server-side rate limits – the additional context parameter is invisible to the recipient, they just get a regular NOTICE with no context. (Besides that, you need to be a chanop to use it.)

An actual IRCX WHISPER command that is visible to recipients would be great, but every time it comes up, someone says "use a tag instead".

@progval
Copy link
Contributor

progval commented Apr 20, 2022

I see, thanks

delthas added a commit to delthas/ircv3-specifications that referenced this issue Apr 22, 2022
delthas added a commit to delthas/ircv3-specifications that referenced this issue Apr 22, 2022
@delthas delthas mentioned this issue Apr 22, 2022
7 tasks
delthas added a commit to delthas/ircv3-specifications that referenced this issue Apr 22, 2022
@ailin-nemui
Copy link

There is a WHISPER emulation by convention, used by ChanServ and supported in Irssi through /set notice_channel_context, whereas the bot has to send "[#channel] text" in its reply

delthas added a commit to delthas/ircv3-specifications that referenced this issue Apr 27, 2022
delthas added a commit to delthas/ircv3-specifications that referenced this issue Apr 27, 2022
@jwheare
Copy link
Member

jwheare commented May 14, 2022

PR here #498

@jwheare jwheare closed this as completed May 14, 2022
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

No branches or pull requests

5 participants