From 9ff6ed2430ed87014846b39456b31b7aba231e48 Mon Sep 17 00:00:00 2001 From: rburchell Date: Sat, 6 Jun 2009 23:33:23 +0000 Subject: New events stuff, patch totally by Adam (aka Awesome). git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2313 5417fbe8-f217-4b02-8779-1006273d7864 --- src/protocol/inspircd11.c | 10 ++++++---- src/protocol/inspircd12.cpp | 10 ++++++---- src/protocol/ratbox.c | 10 ++++++---- 3 files changed, 18 insertions(+), 12 deletions(-) (limited to 'src/protocol') diff --git a/src/protocol/inspircd11.c b/src/protocol/inspircd11.c index 5e93fa68e..0aa2321b4 100644 --- a/src/protocol/inspircd11.c +++ b/src/protocol/inspircd11.c @@ -889,10 +889,12 @@ int anope_event_topic(const char *source, int ac, const char **av) record_topic(av[0]); - if (ac > 1 && *av[1]) - send_event(EVENT_TOPIC_UPDATED, 2, av[0], av[1]); - else - send_event(EVENT_TOPIC_UPDATED, 2, av[0], ""); + if (ac > 1 && *av[1]) { + FOREACH_MOD(I_OnTopicUpdated, OnTopicUpdated(c, av[1])); + } + else { + FOREACH_MOD(I_OnTopicUpdated, OnTopicUpdated(c, "")); + } return MOD_CONT; } diff --git a/src/protocol/inspircd12.cpp b/src/protocol/inspircd12.cpp index 0b36267da..0fc07852d 100644 --- a/src/protocol/inspircd12.cpp +++ b/src/protocol/inspircd12.cpp @@ -968,10 +968,12 @@ int anope_event_topic(const char *source, int ac, const char **av) record_topic(av[0]); - if (ac > 1 && *av[1]) - send_event(EVENT_TOPIC_UPDATED, 2, av[0], av[1]); - else - send_event(EVENT_TOPIC_UPDATED, 2, av[0], ""); + if (ac > 1 && *av[1]) { + FOREACH_MOD(I_OnTopicUpdated, OnTopicUpdated(c, av[0])); + } + else { + FOREACH_MOD(I_OnTopicUpdated, OnTopicUpdated(c, "")); + } return MOD_CONT; } diff --git a/src/protocol/ratbox.c b/src/protocol/ratbox.c index d87d0b64e..261aeb031 100644 --- a/src/protocol/ratbox.c +++ b/src/protocol/ratbox.c @@ -782,10 +782,12 @@ int anope_event_topic(const char *source, int ac, const char **av) record_topic(av[0]); - if (ac > 1 && *av[1]) - send_event(EVENT_TOPIC_UPDATED, 2, av[0], av[1]); - else - send_event(EVENT_TOPIC_UPDATED, 2, av[0], ""); + if (ac > 1 && *av[1]) { + FOREACH_MOD(I_OnTopicUpdated, OnTopicUpdated(c, av[1])); + } + else { + FOREACH_MOD(I_OnTopicUpdated, OnTopicUpdated(c, "")); + } } return MOD_CONT; } -- cgit