diff options
Diffstat (limited to 'src/protocol/ultimate2.c')
-rw-r--r-- | src/protocol/ultimate2.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/protocol/ultimate2.c b/src/protocol/ultimate2.c index eb8d29462..cdd7016d5 100644 --- a/src/protocol/ultimate2.c +++ b/src/protocol/ultimate2.c @@ -154,9 +154,13 @@ void ultiamte2_set_umode(User * user, int ac, char **av) while (*modes) { - add ? (user->mode |= umodes[(int) *modes]) : (user->mode &= - ~umodes[(int) - *modes]); + /* This looks better, much better than "add ? (do_add) : (do_remove)". + * At least this is readable without paying much attention :) -GD + */ + if (add) + user->mode |= umodes[(int) *modes]; + else + user->mode &= ~umodes[(int) *modes]; switch (*modes++) { case '+': @@ -1111,15 +1115,11 @@ int anope_event_ping(char *source, int ac, char **av) int anope_event_away(char *source, int ac, char **av) { - if (ac) { - return MOD_CONT; - } - if (!source) { return MOD_CONT; } - m_away(source, av[0]); - return MOD_CONT; + m_away(source, (ac ? av[0] : NULL)); + return MOD_CONT; } int anope_event_topic(char *source, int ac, char **av) @@ -1407,7 +1407,7 @@ void ultimate2_cmd_guest_nick(char *nick, char *user, char *host, { send_cmd(NULL, "NICK %s 1 %ld %s %s %s 0 :%s", nick, (long int) time(NULL), user, host, ServerName, real); - anope_cmd_mode(nick, "MODE %s %s", nick, modes); + anope_cmd_mode(nick, nick, "MODE %s %s", modes); } |