Move reinstate_user_modes() and update_user_mode() from funny.c to server.c and parse.c

Move these functions where they belong.
This commit is contained in:
Kevin Easton
2017-12-06 22:13:34 +11:00
parent c4ba093ca5
commit 305cfe2afb
6 changed files with 41 additions and 41 deletions

View File

@@ -408,41 +408,3 @@ void funny_mode(char *from, char **ArgList)
}
}
void update_user_mode(int server, const char *modes)
{
int onoff = 1;
const char *p_umodes = get_possible_umodes(server);
const char *p;
for (; *modes; modes++)
{
char c = *modes;
switch (c)
{
case '-':
onoff = 0;
break;
case '+':
onoff = 1;
break;
case 'o':
case 'O':
set_server_operator(server, onoff);
/* fallthrough */
default:
p = strchr(p_umodes, c);
if (p)
set_server_flag(server, p - p_umodes, onoff);
else
yell("Ignoring invalid user mode '%c' from server", c);
}
}
}
void reinstate_user_modes (void)
{
char *modes = get_umode(from_server);
if (modes && *modes)
send_to_server("MODE %s +%s", get_server_nickname(from_server), modes);
}