summaryrefslogtreecommitdiff
path: root/src/protocol/viagra.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/protocol/viagra.c')
-rw-r--r--src/protocol/viagra.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/protocol/viagra.c b/src/protocol/viagra.c
index cd9fbe991..56d922887 100644
--- a/src/protocol/viagra.c
+++ b/src/protocol/viagra.c
@@ -157,9 +157,13 @@ void viagra_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 '+':
@@ -886,15 +890,11 @@ void viagra_cmd_quit(char *source, char *buf)
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_ping(char *source, int ac, char **av)
@@ -1131,7 +1131,7 @@ int anope_event_motd(char *source, int ac, char **av)
void viagra_cmd_notice_ops(char *source, char *dest, char *buf)
{
- if (!buf) {
+ if (buf) {
send_cmd(NULL, "NOTICE @%s :%s", dest, buf);
}
return;