summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2010-03-30 08:55:34 +0000
committerAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2010-03-30 08:55:34 +0000
commitb2d258328a596a053e571c58031c37f0e12119ea (patch)
tree8089a3034117b79c55e990cb41b137e1322a7406
parentef5c945e0bf37f534c93fe7dc6303c9e7577615f (diff)
Fixed catserv module demo to work correctly on TS6 IRCDs
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2843 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r--src/modules/demos/catserv/ircd_catserv.c13
-rw-r--r--version.log3
2 files changed, 9 insertions, 7 deletions
diff --git a/src/modules/demos/catserv/ircd_catserv.c b/src/modules/demos/catserv/ircd_catserv.c
index ae34d6161..082ab6718 100644
--- a/src/modules/demos/catserv/ircd_catserv.c
+++ b/src/modules/demos/catserv/ircd_catserv.c
@@ -24,15 +24,11 @@ int AnopeInit(int argc, char **argv)
{
Message *msg = NULL;
int status;
-#ifdef IRC_UNREAL32
if (UseTokens) {
msg = createMessage("!", my_privmsg);
} else {
msg = createMessage("PRIVMSG", my_privmsg);
}
-#else
- msg = createMessage("PRIVMSG", my_privmsg);
-#endif
status = moduleAddMessage(msg, MOD_HEAD);
if (status == MOD_ERR_OK) {
addClient(s_CatServ, "meow!");
@@ -52,12 +48,15 @@ void AnopeFini(void)
int my_privmsg(char *source, int ac, char **av)
{
User *u;
+ Uid *ud = NULL;
char *s;
/* First, some basic checks */
if (ac != 2)
return MOD_CONT; /* bleh */
- if (!(u = finduser(source))) {
+ if (ircd->ts6)
+ u = find_byuid(source); // If this is a ts6 ircd, find the user by uid
+ if (!u && !(u = finduser(source))) { // If user isn't found and we cant find them by nick, return
return MOD_CONT;
} /* non-user source */
if (*av[0] == '#') {
@@ -71,7 +70,9 @@ int my_privmsg(char *source, int ac, char **av)
if (stricmp(s, ServerName) != 0)
return MOD_CONT;
}
- if ((stricmp(av[0], s_CatServ)) == 0) { /* its for US! */
+ if (ircd->ts6)
+ ud = find_uid(s_CatServ); // Find CatServs UID
+ if (stricmp(av[0], s_CatServ) == 0 || (ud && strcmp(av[0], ud->uid) == 0)) { /* If the nick or the uid matches its for us */
catserv(u, av[1]);
return MOD_STOP;
} else { /* ok it isnt us, let the old code have it */
diff --git a/version.log b/version.log
index a2355de40..b5d742853 100644
--- a/version.log
+++ b/version.log
@@ -9,10 +9,11 @@ VERSION_MAJOR="1"
VERSION_MINOR="8"
VERSION_PATCH="3"
VERSION_EXTRA="-svn"
-VERSION_BUILD="2842"
+VERSION_BUILD="2843"
# $Log$ # Changes since 1.8.3 Release
+#Revision 2843 - Fixed catserv module demo to work correctly on TS6 IRCds
#Revision 2842 - Fixed bug #1149 - Number memos in MySQL correctly
#Revision 2841 - Fixed bugs #1146 and #1147 - Fixed check_modes to only apply defcon settings when defcon is actually on
#Revision 2840 - Fixed bug #1144 - replaced some strcpy calls with strscpy to be safer