diff options
author | rburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-01-23 08:38:45 +0000 |
---|---|---|
committer | rburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-01-23 08:38:45 +0000 |
commit | acde0c64ee9ef68fced861a8c419184e0306ce81 (patch) | |
tree | b78ab1439c47f28520dd1f188443189bb32efb29 /src | |
parent | ea0533be0f4f9d6dd50e2df1c3d0c47c405847b9 (diff) |
Correctly handle parameterised modes in FJOIN, fixes bug #987.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1930 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r-- | src/channels.c | 8 | ||||
-rw-r--r-- | src/protocol/inspircd12.cpp | 14 |
2 files changed, 19 insertions, 3 deletions
diff --git a/src/channels.c b/src/channels.c index c35748c23..350c60fd3 100644 --- a/src/channels.c +++ b/src/channels.c @@ -1114,6 +1114,14 @@ void do_sjoin(const char *source, int ac, const char **av) /* Handle a channel MODE command. */ +/* + * av[0]: channel + * av[1]: (tsmode) channel TS (this should be moved to a protocol module) + * av[2-]: (tsmode) modes and parameters + * + * av[1-]: modes and parameters. + * + */ void do_cmode(const char *source, int ac, const char **av) { Channel *chan; diff --git a/src/protocol/inspircd12.cpp b/src/protocol/inspircd12.cpp index 7933d8280..7bce26bbd 100644 --- a/src/protocol/inspircd12.cpp +++ b/src/protocol/inspircd12.cpp @@ -823,7 +823,7 @@ int anope_event_fmode(const char *source, int ac, const char **av) */ int anope_event_fjoin(const char *source, int ac, const char **av) { - const char *newav[10]; + const char *newav[30]; // hopefully 30 will do until the stupid ac/av stuff goes away. /* value used for myStrGetToken */ int curtoken = 0; @@ -891,9 +891,17 @@ endnick: newav[0] = av[1]; /* timestamp */ newav[1] = av[0]; /* channel name */ - newav[2] = av[2]; /* channel modes */ // XXX: this is incorrect, it doesn't take into account +L etc, modes which require params.. call FMODE instead? -- w00t + + int newac = 2; + + for (int i = 2; i != ac; i++) + { + newav[i] = av[i]; + newac++; + } + newav[3] = nicklist; - do_sjoin(source, 4, newav); + do_sjoin(source, newac, newav); return MOD_CONT; } |