summaryrefslogtreecommitdiff
path: root/src/process.c
diff options
context:
space:
mode:
authortrystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2005-02-11 05:37:05 +0000
committertrystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2005-02-11 05:37:05 +0000
commitf19412921768cfadec42215e538588108d3c8b40 (patch)
treeb31b822ff354e9a92df7ff35caf37300ce93061d /src/process.c
parentd7ad5a8d621b2b25e687134191b9296482fd68de (diff)
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
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c19
1 files changed, 17 insertions, 2 deletions
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;
}