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

Introduce a usermode +R (block unauthed user messages) #33

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

Conversation

jhoneycutt
Copy link

If a client sets mode +R, unauthenticated clients will receive an error when trying to privmsg, cprivmsg, notice, cnotice, or invite them. The message will be something like:

:London.UK.Eu.UnderNet.org 477 charlie alice :You need to be identified to a
registered account to contact this user -- you can obtain an account from
http://cservice.undernet.org/live/

This is the same numeric used when unauthed users try to join a +r channel, matching InspIRCd.

If a client sets mode +R, unauthenticated clients will receive an error when
trying to privmsg, cprivmsg, notice, cnotice, or invite them. The message will
be something like:

:London.UK.Eu.UnderNet.org 477 charlie alice :You need to be identified to a
  registered account to contact this user -- you can obtain an account from
  http://cservice.undernet.org/live/

This is the same numeric used when unauthed users try to join a +r channel,
matching InspIRCd.
@@ -646,35 +651,37 @@ struct Client {
|| HasPriv(sptr, PRIV_SEE_OPERS)))

/** Clear the client's net.burst in-progress flag. */
#define ClearBurst(x) ClrFlag(x, FLAG_BURST)
#define ClearBurst(x) ClrFlag(x, FLAG_BURST)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you revise this to not touch whitespace on lines that don't have text changes?

if (is_silenced(source, dest))
return 0;

Copy link
Contributor

Choose a reason for hiding this comment

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

... although I think this whitespace cleanup is fine.

if (IsServer(source) || IsChannelService(source))
return 0;

return IsBlockUnauthUsers(dest) && !IsAccount(source);
Copy link
Contributor

Choose a reason for hiding this comment

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

It's probably a little clearer and faster to write this whole function as (with line wrapping where appropriate):

return IsBlockUnauthUsers(dest) && !(IsAccount(source) || IsChannelService(source) || IsServer(source));

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.

2 participants