| 28 |
|
#include "stdinc.h" |
| 29 |
|
#include "client.h" |
| 30 |
|
#include "ircd.h" |
| 31 |
– |
#include "numeric.h" |
| 31 |
|
#include "s_serv.h" |
| 32 |
|
#include "send.h" |
| 33 |
|
#include "channel_mode.h" |
| 36 |
|
#include "irc_string.h" |
| 37 |
|
#include "s_user.h" |
| 38 |
|
#include "conf.h" |
| 40 |
– |
#include "hook.h" |
| 39 |
|
|
| 40 |
|
|
| 41 |
|
/*! \brief SVSMODE command handler (called by services) |
| 60 |
|
{ |
| 61 |
|
struct Client *target_p = NULL; |
| 62 |
|
int what = MODE_ADD; |
| 63 |
< |
unsigned int flag = 0, setflags = 0; |
| 64 |
< |
char *m = NULL, *modes = NULL, *extarg = NULL; |
| 63 |
> |
unsigned int flag = 0, setmodes = 0; |
| 64 |
> |
const char *m = NULL, *modes = NULL, *extarg = NULL; |
| 65 |
|
time_t ts = 0; |
| 66 |
|
|
| 67 |
|
if (!HasFlag(source_p, FLAGS_SERVICE)) |
| 85 |
|
if (ts && (ts != target_p->tsinfo)) |
| 86 |
|
return; |
| 87 |
|
|
| 88 |
< |
setflags = target_p->umodes; |
| 88 |
> |
setmodes = target_p->umodes; |
| 89 |
|
|
| 90 |
|
for (m = modes; *m; ++m) |
| 91 |
|
{ |
| 103 |
|
strlcpy(target_p->svid, extarg, sizeof(target_p->svid)); |
| 104 |
|
break; |
| 105 |
|
|
| 106 |
+ |
case 'x': |
| 107 |
+ |
if (!EmptyString(extarg) && valid_hostname(extarg)) |
| 108 |
+ |
user_set_hostmask(target_p, extarg, what); |
| 109 |
+ |
break; |
| 110 |
+ |
|
| 111 |
|
case 'o': |
| 112 |
|
if (what == MODE_DEL && HasUMode(target_p, UMODE_OPER)) |
| 113 |
|
{ |
| 144 |
|
|
| 145 |
|
break; |
| 146 |
|
|
| 147 |
< |
case ' ': |
| 148 |
< |
case '\n': |
| 146 |
< |
case '\r': |
| 147 |
< |
case '\t': |
| 147 |
> |
case 'S': /* Only servers may set +S in a burst */ |
| 148 |
> |
case 'W': /* Only servers may set +W in a burst */ |
| 149 |
|
break; |
| 150 |
+ |
|
| 151 |
|
default: |
| 152 |
|
if ((flag = user_modes[(unsigned char)*m])) |
| 153 |
< |
execute_callback(umode_cb, client_p, target_p, what, flag); |
| 153 |
> |
{ |
| 154 |
> |
if (what == MODE_ADD) |
| 155 |
> |
AddUMode(target_p, flag); |
| 156 |
> |
else |
| 157 |
> |
DelUMode(target_p, flag); |
| 158 |
> |
} |
| 159 |
> |
|
| 160 |
|
break; |
| 161 |
|
} |
| 162 |
|
} |
| 180 |
|
target_p->name, (unsigned long)target_p->tsinfo, modes); |
| 181 |
|
} |
| 182 |
|
|
| 183 |
< |
if (MyConnect(target_p) && (setflags != target_p->umodes)) |
| 183 |
> |
if (MyConnect(target_p) && (setmodes != target_p->umodes)) |
| 184 |
|
{ |
| 185 |
|
char modebuf[IRCD_BUFSIZE]; |
| 186 |
|
|
| 187 |
< |
send_umode(target_p, target_p, setflags, 0xffffffff, modebuf); |
| 187 |
> |
send_umode(target_p, target_p, setmodes, 0xffffffff, modebuf); |
| 188 |
|
} |
| 189 |
|
} |
| 190 |
|
|