From c512f1b37b6b92df6d76041d68aac131036f0bcb Mon Sep 17 00:00:00 2001 From: delthas Date: Fri, 22 Apr 2022 11:49:51 +0200 Subject: [PATCH 1/3] Add @+channel-context Fixes: https://github.com/ircv3/ircv3-specifications/issues/497 --- client-tags/channel-context.md | 58 ++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 client-tags/channel-context.md diff --git a/client-tags/channel-context.md b/client-tags/channel-context.md new file mode 100644 index 00000000..75408b94 --- /dev/null +++ b/client-tags/channel-context.md @@ -0,0 +1,58 @@ +--- +title: "`channel-context` client tag" +layout: spec +work-in-progress: true +copyrights: + - + name: "delthas" + period: 2022 + email: "delthas@dille.cc" +--- + +## Notes for implementing work-in-progress version + +This is a work-in-progress specification. + +Software implementing this work-in-progress specification MUST NOT use the +unprefixed `+channel-context` tag name. Instead, implementations SHOULD use the +`+draft/channel-context` tag name to be interoperable with other software +implementing a compatible work-in-progress version. + +The final version of the specification will use an unprefixed tag name. + +## Introduction + +This specification defines a client-only message tag to indicate the channel a private PRIVMSG or NOTICE should be displayed in. + +## Motivation + +Responding to PRIVMSG messages in channels with NOTICE messages in private is a widely-used IRC practice for bots, in order to prevent flooding a channel with messages only useful for a single user. Clients have developed heuristics for matching incoming private NOTICE to their channel context, but these heuristics are error-prone and difficult to implement for past messages with CHATHISTORY. + +This tag enables clients to systematically know in which channel a private PRIVMSG or NOTICE should be displayed, because the sender can now communicate that information in the message. + +## Architecture + +### Dependencies + +Clients wishing to use this tag MUST negotiate the [`message-tags`](../extensions/message-tags.html) capability with the server. + +### Format + +The channel-context tag is sent by a client with the client-only prefix `+`. The value MUST be a valid channel name. + + +draft/channel-context= + +This tag MUST be attached to PRIVMSG and NOTICE messages to users only. Clients MUST ignore this tag if it is not attached to a private PRIVMSG or NOTICE message or if its value is not a valid channel name. + +## Client implementation considerations + +This section is non-normative. + +When clients receive a private PRIVMSG or NOTICE message from a user with this tag, they can display that message in the buffer specified in the tag, as if it was a channel message. + +## Examples + +In this example, user `me` requests documentation from bots in channel `#chan`, then gets the response in private, but in the context of that channel, using `channel-context`. + + C: PRIVMSG #chan :!help + S: @+draft/channel-context=#chan :bot!bot@bot NOTICE me :I'm helping. From f87f5fd157819d9e210cd79ceb62b01458ede4ed Mon Sep 17 00:00:00 2001 From: delthas Date: Mon, 6 Jun 2022 21:33:56 +0200 Subject: [PATCH 2/3] Add non-normative hint for client implementations --- client-tags/channel-context.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client-tags/channel-context.md b/client-tags/channel-context.md index 75408b94..46f6ecd5 100644 --- a/client-tags/channel-context.md +++ b/client-tags/channel-context.md @@ -50,6 +50,8 @@ This section is non-normative. When clients receive a private PRIVMSG or NOTICE message from a user with this tag, they can display that message in the buffer specified in the tag, as if it was a channel message. +Using this client tag, clients can maliciously pretend to send messages in a channel they have not joined, or pretend to send private messages in public. To prevent abuse, client implementations can ignore the tag when the sender does not belong to the specified channel, or explicitly show that the message is only visible to the recipient. + ## Examples In this example, user `me` requests documentation from bots in channel `#chan`, then gets the response in private, but in the context of that channel, using `channel-context`. From eb71535f2684325cd09aa82578a572f9872810f5 Mon Sep 17 00:00:00 2001 From: delthas Date: Fri, 24 Jun 2022 17:28:21 +0200 Subject: [PATCH 3/3] Update comment on abuse & client implementations --- client-tags/channel-context.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client-tags/channel-context.md b/client-tags/channel-context.md index 46f6ecd5..526caaaf 100644 --- a/client-tags/channel-context.md +++ b/client-tags/channel-context.md @@ -50,7 +50,7 @@ This section is non-normative. When clients receive a private PRIVMSG or NOTICE message from a user with this tag, they can display that message in the buffer specified in the tag, as if it was a channel message. -Using this client tag, clients can maliciously pretend to send messages in a channel they have not joined, or pretend to send private messages in public. To prevent abuse, client implementations can ignore the tag when the sender does not belong to the specified channel, or explicitly show that the message is only visible to the recipient. +To prevent abuse, client implementations might allow users to hide these messages when the sender does not belong to the specified channel. ## Examples