mirror of
https://github.com/osmarks/ngircd.git
synced 2025-01-20 20:36:53 +00:00
Allow "DefaultUserModes" to set all possible modes
Let IRC_MODE() detect that the "fake" MODE command originated on the local sever, which enables all modes to be settable using "DefaultUserModes" that can be set by regular MODE commands, including modes only settable by IRC Operators.
This commit is contained in:
parent
5009ab3e8c
commit
d314c75a37
@ -172,8 +172,8 @@
|
|||||||
;ConnectIPv4 = yes
|
;ConnectIPv4 = yes
|
||||||
|
|
||||||
# Default user mode(s) to set on new local clients. Please note that
|
# Default user mode(s) to set on new local clients. Please note that
|
||||||
# only modes can be set that the client could set on itself, you can't
|
# only modes can be set that the client could set using regular MODE
|
||||||
# set "a" (away) or "o" (IRC Op), for example! Default: none.
|
# commands, you can't set "a" (away) for example! Default: none.
|
||||||
;DefaultUserModes = i
|
;DefaultUserModes = i
|
||||||
|
|
||||||
# Do DNS lookups when a client connects to the server.
|
# Do DNS lookups when a client connects to the server.
|
||||||
|
@ -267,8 +267,8 @@ Default: yes.
|
|||||||
.TP
|
.TP
|
||||||
\fBDefaultUserModes\fR (string)
|
\fBDefaultUserModes\fR (string)
|
||||||
Default user mode(s) to set on new local clients. Please note that only modes
|
Default user mode(s) to set on new local clients. Please note that only modes
|
||||||
can be set that the client could set on itself, you can't set "a" (away) or
|
can be set that the client could set using regular MODE commands, you can't
|
||||||
"o" (IRC Op), for example!
|
set "a" (away) for example!
|
||||||
Default: none.
|
Default: none.
|
||||||
.TP
|
.TP
|
||||||
\fBDNS\fR (boolean)
|
\fBDNS\fR (boolean)
|
||||||
|
@ -68,6 +68,13 @@ IRC_MODE( CLIENT *Client, REQUEST *Req )
|
|||||||
|
|
||||||
_IRC_GET_SENDER_OR_RETURN_(origin, Req, Client)
|
_IRC_GET_SENDER_OR_RETURN_(origin, Req, Client)
|
||||||
|
|
||||||
|
/* Test for "fake" MODE commands injected by this local instance,
|
||||||
|
* for example when handling the "DefaultUserModes" settings.
|
||||||
|
* This doesn't harm real commands, because prefixes of regular
|
||||||
|
* clients are checked in Validate_Prefix() and can't be faked. */
|
||||||
|
if (Req->prefix && Client_Search(Req->prefix) == Client_ThisServer())
|
||||||
|
Client = Client_Search(Req->prefix);
|
||||||
|
|
||||||
/* Channel or user mode? */
|
/* Channel or user mode? */
|
||||||
cl = NULL; chan = NULL;
|
cl = NULL; chan = NULL;
|
||||||
if (Client_IsValidNick(Req->argv[0]))
|
if (Client_IsValidNick(Req->argv[0]))
|
||||||
|
@ -192,7 +192,7 @@ Login_User_PostAuth(CLIENT *Client)
|
|||||||
/* Set default user modes */
|
/* Set default user modes */
|
||||||
if (Conf_DefaultUserModes[0]) {
|
if (Conf_DefaultUserModes[0]) {
|
||||||
snprintf(modes, sizeof(modes), "+%s", Conf_DefaultUserModes);
|
snprintf(modes, sizeof(modes), "+%s", Conf_DefaultUserModes);
|
||||||
Req.prefix = Client_ThisServer();
|
Req.prefix = Client_ID(Client_ThisServer());
|
||||||
Req.command = "MODE";
|
Req.command = "MODE";
|
||||||
Req.argc = 2;
|
Req.argc = 2;
|
||||||
Req.argv[0] = Client_ID(Client);
|
Req.argv[0] = Client_ID(Client);
|
||||||
|
Loading…
Reference in New Issue
Block a user