| 2 |
|
* ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) |
| 3 |
|
* |
| 4 |
|
* Copyright (c) 1999 Bahamut development team. |
| 5 |
< |
* Copyright (c) 2011-2014 ircd-hybrid development team |
| 5 |
> |
* Copyright (c) 2011-2015 ircd-hybrid development team |
| 6 |
|
* |
| 7 |
|
* This program is free software; you can redistribute it and/or modify |
| 8 |
|
* it under the terms of the GNU General Public License as published by |
| 54 |
|
static int |
| 55 |
|
ms_svsmode(struct Client *source_p, int parc, char *parv[]) |
| 56 |
|
{ |
| 57 |
+ |
const struct user_modes *tab = NULL; |
| 58 |
|
struct Client *target_p = NULL; |
| 59 |
|
int what = MODE_ADD; |
| 60 |
< |
unsigned int flag = 0, setmodes = 0; |
| 60 |
> |
const unsigned int setmodes = target_p->umodes; |
| 61 |
|
const char *modes = NULL, *extarg = NULL; |
| 62 |
|
time_t ts = 0; |
| 63 |
|
|
| 74 |
|
if (ts && (ts != target_p->tsinfo)) |
| 75 |
|
return 0; |
| 76 |
|
|
| 76 |
– |
setmodes = target_p->umodes; |
| 77 |
– |
|
| 77 |
|
for (const char *m = modes; *m; ++m) |
| 78 |
|
{ |
| 79 |
|
switch (*m) |
| 136 |
|
break; |
| 137 |
|
|
| 138 |
|
default: |
| 139 |
< |
if ((flag = user_modes[(unsigned char)*m])) |
| 139 |
> |
if ((tab = umode_map[(unsigned char)*m])) |
| 140 |
|
{ |
| 141 |
|
if (what == MODE_ADD) |
| 142 |
< |
AddUMode(target_p, flag); |
| 142 |
> |
AddUMode(target_p, tab->flag); |
| 143 |
|
else |
| 144 |
< |
DelUMode(target_p, flag); |
| 144 |
> |
DelUMode(target_p, tab->flag); |
| 145 |
|
} |
| 146 |
|
|
| 147 |
|
break; |