-
Notifications
You must be signed in to change notification settings - Fork 78
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
Add @+channel-context #498
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
--- | ||
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=<channel> | ||
|
||
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. | ||
|
||
To prevent abuse, client implementations might allow users to hide these messages when the sender does not belong to the specified channel. | ||
|
||
## 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. |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the use case of the tag, would it make sense to add a constraint for the clients to only perform this when the recipient for the PRIVMSG target is the current nick. To prevent abuse from a sender using this tag in other channels?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It already says "a private PRIVMSG"