From f19412921768cfadec42215e538588108d3c8b40 Mon Sep 17 00:00:00 2001 From: "trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b" Date: Fri, 11 Feb 2005 05:37:05 +0000 Subject: BUILD : 1.7.8 (573) BUGS : 296 NOTES : mod_current_buffer was not set in all possible cases git-svn-id: svn://svn.anope.org/anope/trunk@573 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@423 5417fbe8-f217-4b02-8779-1006273d7864 --- src/process.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/process.c b/src/process.c index 2a3c04021..d4ea8b29e 100644 --- a/src/process.c +++ b/src/process.c @@ -238,8 +238,23 @@ void process() if (mod_current_buffer) { free(mod_current_buffer); } - if (av[1]) { - mod_current_buffer = sstrdup(av[1]); + /* fix to moduleGetLastBuffer() bug 296 */ + /* old logic was that since its meant for PRIVMSG that we would get + the NICK as AV[0] and the rest would be in av[1], however on Bahamut + based systems when you do /cs it assumes we will translate the command + to the NICK and thus AV[0] is the message. The new logic is to check + av[0] to see if its a service nick if so assign mod_current_buffer the + value from AV[1] else just assign av[0] - TSL */ + if (av[0]) { + if (nickIsServices(av[0], 0)) { + if (av[1]) { + mod_current_buffer = sstrdup(av[1]); + } else { + mod_current_buffer = sstrdup(av[0]); + } + } else { + mod_current_buffer = sstrdup(av[0]); + } } else { mod_current_buffer = NULL; } -- cgit