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

libathemecore/ptasks: handle status-prefixed channel messages #823

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aaronmdjones
Copy link
Member

If a channel message comes in with a status prefix, we should still treat it as a channel message.

This does not raise concerns about chanops hiding the usage of fantasy commands because they can always private message services directly and the output of potentially-abusive commands (for example, KICK) is signed off with their account name anyway (which will not change).

Under the solanum family of IRCds, there exists a channel mode +z, which will transform messages to #channel into messages to @#channel if the message would have been blocked by +m/+b/+q. This is to clearly distinguish to channel operators that the only reason they are seeing the message is that they are operators, and that other channel users will not have seen it.

ChanServ is also a channel operator, but it would not have received the message, because services ignored status-prefixed channel messages. This prevented users using fantasy commands if they are affected by +z; for example, by the channel being +m. Confusingly, this would have allowed "!deop" to work, but not "!op".

Reported by juggs on IRC, who did not respond to a request for the proper attribution in Reported-by.

If a channel message comes in with a status prefix, we should still
treat it as a channel message.

This does not raise concerns about chanops hiding the usage of fantasy
commands because they can always private message services directly and
the output of potentially-abusive commands (for example, kick) is
signed off with their account name anyway (which will not change).

Under the solanum family of IRCds, there exists a channel mode +z,
which will transform messages to #channel into messages to @#channel
if the message would have been blocked by +m/+b/+q. This is to clearly
distinguish to channel operators that the only reason they are seeing
the message is that they are operators, and that other channel users
will not have seen it.

ChanServ is also a channel operator, but it would not have received
the message, because services ignored status-prefixed channel messages.
This prevented users using fantasy commands if they are affected by +z;
for example, by the channel being +m. Confusingly, this would have
allowed "!deop" to work, but not "!op".

Reported by juggs on IRC, who did not respond to a request for the
proper attribution in Reported-by.
@kaniini
Copy link
Contributor

kaniini commented Sep 1, 2021

Looks fine to me.

*/
bool is_status_prefixed = false;

for (unsigned int i = 0; p == (target + 1) && prefix_mode_list && prefix_mode_list[i].mode; i++)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i feel like the inclusion of static logic in a for condition is needlessly abstruce. this took me 5 minutes to understand

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there much at risk to just do

if ((p = strchr(target, '#')) != NULL)
{
    (void) handle_channel_message(si, p, is_notice, message);
    return;
}

?

it feels like having an octothorpe in a target name when it's not ultimately a channel is a protocol framing issue

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was proposed about a decade ago, but there was something wrong with it. I forget what it was now, though.

Honestly, it seems fine, we were probably bikeshedding about a non-practical issue.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there much at risk to just do

if ((p = strchr(target, '#')) != NULL)
{
    (void) handle_channel_message(si, p, is_notice, message);
    return;
}

Think of charybdis-family IRCds where you send a PRIVMSG to $#some.mask and #some.mask happens to be an extant channel.

@ilbelkyr
Copy link
Member

hm, for solanum (via ts6-generic) we don't currently advertise support for CHW so simply won't receive statusmsg in the first place afaict; we'll want to start advertising that if this is merged

we do advertise EOPMOD, which appears to be a no-op without CHW; if we keep advertising that, we'll be sent messages affected by +z to a =#channel target which we'd need to specifically support. @aaronmdjones thoughts on that bit?

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.

None yet

4 participants