diff options
| author | geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2005-07-01 22:19:46 +0000 |
|---|---|---|
| committer | geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2005-07-01 22:19:46 +0000 |
| commit | e31758b72fad9c1db4260b21ed8a9ede7ddf65b9 (patch) | |
| tree | b0a7b7c2323069dbaa056fb1159099554ddd0d9f | |
| parent | 5e079dce4b630cbbd3fcdd3cbc3f87f12dff1b37 (diff) | |
BUILD : 1.7.10 (842) BUGS : NOTES : Added 3 new events for channel access/xop list modifications
git-svn-id: svn://svn.anope.org/anope/trunk@842 31f1291d-b8d6-0310-a050-a5561fc1590b
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@595 5417fbe8-f217-4b02-8779-1006273d7864
| -rw-r--r-- | Changes | 1 | ||||
| -rw-r--r-- | docs/EVENTS | 25 | ||||
| -rw-r--r-- | include/events.h | 3 | ||||
| -rw-r--r-- | src/core/cs_access.c | 6 | ||||
| -rw-r--r-- | src/core/cs_xop.c | 6 | ||||
| -rw-r--r-- | version.log | 6 |
6 files changed, 46 insertions, 1 deletions
@@ -1,6 +1,7 @@ Anope Version S V N -------------------- Provided by Anope Dev. <dev@anope.org> - 2005 +07/01 A Events for channel access/xop updates. [ #00] 06/26 A New module pack module: hs_request. [ #00] 06/03 A Protocol files can now fill mod_current_buffer with custom code. [#389] 07/01 F Modules will now be properly unloaded on shutdown. [ #00] diff --git a/docs/EVENTS b/docs/EVENTS index 7d2fb34e7..e67510e24 100644 --- a/docs/EVENTS +++ b/docs/EVENTS @@ -145,6 +145,31 @@ Anope Internal Events second argument, and so on. If av[0] and av[1] are given, the event has two arguments, and argc should be 2. + EVENT_ACCESS_ADD + An user has been added to a channel access list. + av[0] Name of the channel the user has been added to. + av[1] The nickname of the user that has just added an entry to the + access list. + av[2] The nickname of the user that has been added to the access + list. + av[3] The level number the user has been added with. + + EVENT_ACCESS_CHANGE + An user level has been changed on a channel access list. + av[0] Name of the channel the access list has been modified which. + av[1] The nickname of the user that has just modified the access + list of the channel. + av[2] The nickname of the user wich his access level has just been + modified. + av[3] The new access level for the user. + + EVENT_ACCESS_DEL + An user has been deleted of a channel access list. + av[0] Name of the channel the access entry has been deleted which. + av[1] The nickname of the user that has just deleted the access entry. + av[2] The nickname of the user wich his access level has just been + removed. + EVENT_BOT_ASSIGN A BotServ bot has been assigned to a channel. av[0] Name of the channel the bot has been assigned to. diff --git a/include/events.h b/include/events.h index 4065e1a2a..480c88e3e 100644 --- a/include/events.h +++ b/include/events.h @@ -53,3 +53,6 @@ #define EVENT_NICK_UNSUSPEND "nick_unsuspend" #define EVENT_JOIN_CHANNEL "join_channel" #define EVENT_PART_CHANNEL "part_channel" +#define EVENT_ACCESS_ADD "access_add" +#define EVENT_ACCESS_CHANGE "access_change" +#define EVENT_ACCESS_DEL "access_del" diff --git a/src/core/cs_access.c b/src/core/cs_access.c index e5d621972..8f348c028 100644 --- a/src/core/cs_access.c +++ b/src/core/cs_access.c @@ -142,6 +142,7 @@ int do_access(User * u) char *cmd = strtok(NULL, " "); char *nick = strtok(NULL, " "); char *s = strtok(NULL, " "); + char event_access[BUFSIZE]; ChannelInfo *ci; NickAlias *na; @@ -218,6 +219,8 @@ int do_access(User * u) return MOD_CONT; } access->level = level; + snprintf(event_access, BUFSIZE, "%d", access->level); + send_event(EVENT_ACCESS_CHANGE, 4, ci->name, u->nick, na->nick, event_access); alog("%s: %s!%s@%s (level %d) set access level %d to %s (group %s) on channel %s", s_ChanServ, u->nick, u->username, u->host, ulev, access->level, na->nick, nc->display, ci->name); notice_lang(s_ChanServ, u, CHAN_ACCESS_LEVEL_CHANGED, access->nc->display, chan, level); @@ -248,6 +251,8 @@ int do_access(User * u) access->level = level; access->last_seen = 0; + snprintf(event_access, BUFSIZE, "%d", access->level); + send_event(EVENT_ACCESS_ADD, 4, ci->name, u->nick, na->nick, event_access); alog("%s: %s!%s@%s (level %d) set access level %d to %s (group %s) on channel %s", s_ChanServ, u->nick, u->username, u->host, ulev, access->level, na->nick, nc->display, ci->name); notice_lang(s_ChanServ, u, CHAN_ACCESS_ADDED, nc->display, ci->name, access->level); @@ -306,6 +311,7 @@ int do_access(User * u) deleted = 0; notice_lang(s_ChanServ, u, PERMISSION_DENIED); } else { + send_event(EVENT_ACCESS_DEL, 3, ci->name, u->nick, na->nick); notice_lang(s_ChanServ, u, CHAN_ACCESS_DELETED, access->nc->display, ci->name); alog("%s: %s!%s@%s (level %d) deleted access of %s (group %s) on %s", s_ChanServ, u->nick, u->username, u->host, get_access(u, ci), na->nick, access->nc->display, chan); diff --git a/src/core/cs_xop.c b/src/core/cs_xop.c index 9116d165c..6209015a8 100644 --- a/src/core/cs_xop.c +++ b/src/core/cs_xop.c @@ -235,6 +235,7 @@ int do_xop(User * u, char *xname, int xlev, int *xmsgs) char *chan = strtok(NULL, " "); char *cmd = strtok(NULL, " "); char *nick = strtok(NULL, " "); + char event_access[BUFSIZE]; ChannelInfo *ci; NickAlias *na; @@ -324,10 +325,14 @@ int do_xop(User * u, char *xname, int xlev, int *xmsgs) alog("%s: %s!%s@%s (level %d) %s access level %d to %s (group %s) on channel %s", s_ChanServ, u->nick, u->username, u->host, ulev, change ? "changed" : "set", access->level, na->nick, nc->display, ci->name); + snprintf(event_access, BUFSIZE, "%d", access->level); + if (!change) { + send_event(EVENT_ACCESS_CHANGE, 4, ci->name, u->nick, na->nick, event_access); notice_lang(s_ChanServ, u, xmsgs[3], access->nc->display, ci->name); } else { + send_event(EVENT_ACCESS_ADD, 4, ci->name, u->nick, na->nick, event_access); notice_lang(s_ChanServ, u, xmsgs[4], access->nc->display, ci->name); } @@ -387,6 +392,7 @@ int do_xop(User * u, char *xname, int xlev, int *xmsgs) deleted = 0; notice_lang(s_ChanServ, u, PERMISSION_DENIED); } else { + send_event(EVENT_ACCESS_DEL, 3, ci->name, u->nick, na->nick); notice_lang(s_ChanServ, u, xmsgs[8], access->nc->display, ci->name); access->nc = NULL; diff --git a/version.log b/version.log index d63736717..461d6cea5 100644 --- a/version.log +++ b/version.log @@ -8,10 +8,14 @@ VERSION_MAJOR="1" VERSION_MINOR="7" VERSION_PATCH="10" -VERSION_BUILD="841" +VERSION_BUILD="842" # $Log$ # +# BUILD : 1.7.10 (842) +# BUGS : +# NOTES : Added 3 new events for channel access/xop list modifications +# # BUILD : 1.7.10 (841) # BUGS : 400 # NOTES : Modules will now get a more random filename in the runtime/ folder, which makes sure that no duplicate filenames will occur, which makes sure listchans can run at the same time as services since they both use the same protocol module, which in turn fixes bug 400. And all modules are now properly unloaded on shutdown :) |
