summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/bs_fantasy_kick.c15
-rw-r--r--src/core/bs_fantasy_kickban.c13
2 files changed, 16 insertions, 12 deletions
diff --git a/src/core/bs_fantasy_kick.c b/src/core/bs_fantasy_kick.c
index 0129c9d1c..e2819d178 100644
--- a/src/core/bs_fantasy_kick.c
+++ b/src/core/bs_fantasy_kick.c
@@ -75,14 +75,17 @@ int do_fantasy(int argc, char **argv)
if (!target && check_access(u, ci, CA_KICKME)) {
bot_raw_kick(u, ci, u->nick, "Requested");
} else if (target && check_access(u, ci, CA_KICK)) {
- u2 = finduser(target);
-
if (!stricmp(target, ci->bi->nick))
bot_raw_kick(u, ci, u->nick, "Oops!");
- else if (u2 && !reason && !is_protected(u2))
- bot_raw_kick(u, ci, target, "Requested");
- else if (u2 && !is_protected(u2))
- bot_raw_kick(u, ci, target, reason);
+ else {
+ u2 = finduser(target);
+ if (u2 && ci->c && is_on_chan(ci->c, u2)) {
+ else if (!reason && !is_protected(u2))
+ bot_raw_kick(u, ci, target, "Requested");
+ else if (!is_protected(u2))
+ bot_raw_kick(u, ci, target, reason);
+ }
+ }
}
}
diff --git a/src/core/bs_fantasy_kickban.c b/src/core/bs_fantasy_kickban.c
index 79b2622b4..37528a331 100644
--- a/src/core/bs_fantasy_kickban.c
+++ b/src/core/bs_fantasy_kickban.c
@@ -79,12 +79,13 @@ int do_fantasy(int argc, char **argv)
if (stricmp(target, ci->bi->nick) == 0) {
bot_raw_ban(u, ci, u->nick, "Oops!");
} else {
- u2 = finduser(target);
-
- if (u2 && !reason && !is_protected(u2))
- bot_raw_ban(u, ci, target, "Requested");
- else if (u2 && !is_protected(u2))
- bot_raw_ban(u, ci, target, reason);
+ u2 = finduser(target);
+ if (u2 && ci->c && is_on_chan(ci->c, u2)) {
+ if (!reason && !is_protected(u2))
+ bot_raw_ban(u, ci, target, "Requested");
+ else if (!is_protected(u2))
+ bot_raw_ban(u, ci, target, reason);
+ }
}
}
}