-
Notifications
You must be signed in to change notification settings - Fork 20
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
base: u2_10_12_branch
Are you sure you want to change the base?
Conversation
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) |
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.
Could you revise this to not touch whitespace on lines that don't have text changes?
if (is_silenced(source, dest)) | ||
return 0; | ||
|
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.
... although I think this whitespace cleanup is fine.
if (IsServer(source) || IsChannelService(source)) | ||
return 0; | ||
|
||
return IsBlockUnauthUsers(dest) && !IsAccount(source); |
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'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));
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.