From 517dd987a78aafda52057f1f6b763a278e3384b2 Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 15 Apr 2005 19:29:20 +0000 Subject: Added new API methods: int Module::OnRawMode(userrec* user, char mode, std::string param, bool adding, int pcnt); int Module::OnCheckInvite(userrec* user, chanrec* chan); int Module::OnCheckKey(userrec* user, chanrec* chan, std::string keygiven); int Module::OnCheckLimit(userrec* user, chanrec* chan); int Module::OnCheckBan(userrec* user, chanrec* chan); void Module::OnStats(char symbol); int Module::OnChangeLocalUserHost(userrec* user, std::string newhost); int Module::OnChangeLocalUserGECOS(userrec* user, std::string newhost); int Module::OnLocalTopicChange(userrec* user, chanrec* chan, std::string topic); git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1105 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/commands.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/commands.cpp') diff --git a/src/commands.cpp b/src/commands.cpp index 635000974..3a30a3972 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -542,14 +542,22 @@ void handle_topic(char **parameters, int pcnt, userrec *user) WriteServ(user->fd,"482 %s %s :You must be at least a half-operator to change modes on this channel", user->nick, Ptr->name); return; } - + char topic[MAXBUF]; strlcpy(topic,parameters[1],MAXBUF); if (strlen(topic)>MAXTOPIC) { topic[MAXTOPIC-1] = '\0'; } - + + if (!strcasecmp(user->server,ServerName)) + { + int MOD_RESULT = 0; + FOREACH_RESULT(OnLocalTopicChange(user,Ptr,topic)); + if (MOD_RESULT) + return; + } + strlcpy(Ptr->topic,topic,MAXBUF); strlcpy(Ptr->setby,user->nick,NICKMAX); Ptr->topicset = TIME; @@ -1301,6 +1309,8 @@ void handle_stats(char **parameters, int pcnt, userrec *user) } + FOREACH_MOD OnStats(*parameters[0]); + if (!strcasecmp(parameters[0],"c")) { for (int i = 0; i < ConfValueEnum("link",&config_f); i++) -- cgit v1.3.1-10-gc9f91