summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changes1
-rw-r--r--docs/EVENTS15
-rw-r--r--include/events.h1
-rw-r--r--src/botserv.c13
-rw-r--r--version.log6
5 files changed, 30 insertions, 6 deletions
diff --git a/Changes b/Changes
index ff2d9a4b8..28724d018 100644
--- a/Changes
+++ b/Changes
@@ -1,6 +1,7 @@
Anope Version S V N
--------------------
Provided by Anope Dev. <dev@anope.org> - 2005
+09/28 A Event for fantasy commands triggered without channel access. [ #00]
Anope Version 1.7.11
---------------------
diff --git a/docs/EVENTS b/docs/EVENTS
index e67510e24..47a168387 100644
--- a/docs/EVENTS
+++ b/docs/EVENTS
@@ -200,6 +200,21 @@ Anope Internal Events
command. If none are present, this will not exist, and argc will
will be 3.
+ EVENT_BOT_FANTASY_NO_ACCESS
+ A fantasy command of the bot has been triggered by someone without
+ access to BotServ FANTASY commands on the channel. This will NOT
+ trigger if someone with access has triggered a fantasy command; use
+ EVENT_BOT_FANTASY for those. Hook to both events to catch both event
+ triggers.
+ av[0] The fantasy command that has been triggered with leading '!'.
+ av[1] The nickname of the user that has triggered the fantasy
+ command.
+ av[2] The name of the channel the fantasy command has been triggered
+ on.
+ av[3] Contains any optional paramenters passed after the fantasy
+ command. If none are present, this will not exist, and argc will
+ will be 3.
+
EVENT_BOT_JOIN
A BotServ bot has joined a channel and opped itself.
av[0] The channel name the bot has just joined.
diff --git a/include/events.h b/include/events.h
index 480c88e3e..42f2c03d0 100644
--- a/include/events.h
+++ b/include/events.h
@@ -23,6 +23,7 @@
#define EVENT_BOT_CREATE "bot_create"
#define EVENT_BOT_CHANGE "bot_change"
#define EVENT_BOT_FANTASY "bot_command"
+#define EVENT_BOT_FANTASY_NO_ACCESS "bot_command_no_access"
#define EVENT_BOT_DEL "bot_del"
#define EVENT_BOT_ASSIGN "bot_assign"
#define EVENT_TOPIC_UPDATED "chan_topic_updated"
diff --git a/src/botserv.c b/src/botserv.c
index 6570a75d5..f1a89578d 100644
--- a/src/botserv.c
+++ b/src/botserv.c
@@ -400,17 +400,20 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf)
/* Fantaisist commands */
- if (buf && (ci->botflags & BS_FANTASY) && *buf == '!'
- && check_access(u, ci, CA_FANTASIA)) {
+ if (buf && (ci->botflags & BS_FANTASY) && *buf == '!') {
cmd = strtok(buf, " ");
if (cmd && (cmd[0] == '!')) {
char *params = strtok(NULL, "");
+ char *event_name = EVENT_BOT_FANTASY_NO_ACCESS;
+
+ if (check_access(u, ci, CA_FANTASIA))
+ event_name = EVENT_BOT_FANTASY;
+
if (params)
- send_event(EVENT_BOT_FANTASY, 4, cmd, u->nick, ci->name,
- params);
+ send_event(event_name, 4, cmd, u->nick, ci->name, params);
else
- send_event(EVENT_BOT_FANTASY, 3, cmd, u->nick, ci->name);
+ send_event(event_name, 3, cmd, u->nick, ci->name);
}
}
}
diff --git a/version.log b/version.log
index cec3eb5bf..526f8ce31 100644
--- a/version.log
+++ b/version.log
@@ -9,10 +9,14 @@ VERSION_MAJOR="1"
VERSION_MINOR="7"
VERSION_PATCH="11"
VERSION_EXTRA="-svn"
-VERSION_BUILD="899"
+VERSION_BUILD="900"
# $Log$
#
+# BUILD : 1.7.11 (900)
+# BUGS :
+# NOTES : Added an event for fantasy commands triggered by people without CA_FANTASY access on the channel
+#
# BUILD : 1.7.11 (899)
# BUGS :
# NOTES : Development Framework