fix forum for privmsg

This commit is contained in:
Neale Pickett 2012-01-06 17:14:45 -06:00
parent dc9f49e350
commit 491c65415c
3 changed files with 19 additions and 7 deletions

View File

@ -1,5 +1,5 @@
CFLAGS = -Wall -Werror
TARGETS = dispatch irc
TARGETS = dispatch irc-filter
all: $(TARGETS)

View File

@ -17,4 +17,4 @@ if [ -p $botdir/fifo ]; then
fifo="-f $botdir/fifo"
fi
exec $ircdir/dispatch $fifo $ircdir/irc $botdir/handler
exec $ircdir/dispatch $fifo $ircdir/irc-filter $botdir/handler

View File

@ -92,11 +92,23 @@ main(int argc, char *argv[])
/* Determine forum */
if ((0 == strcmp(cmd, "PRIVMSG")) ||
(0 == strcmp(cmd, "NOTICE")) ||
(0 == strcmp(cmd, "PART")) ||
(0 == strcmp(cmd, "MODE")) ||
(0 == strcmp(cmd, "TOPIC")) ||
(0 == strcmp(cmd, "KICK"))) {
(0 == strcmp(cmd, "NOTICE"))) {
/* :neale!user@127.0.0.1 PRIVMSG #hydra :foo */
switch (parts[1][0]) {
case '#':
case '&':
case '+':
case '!':
forum = parts[1];
break;
default:
forum = snick;
break;
}
} else if ((0 == strcmp(cmd, "PART")) ||
(0 == strcmp(cmd, "MODE")) ||
(0 == strcmp(cmd, "TOPIC")) ||
(0 == strcmp(cmd, "KICK"))) {
forum = parts[1];
} else if (0 == strcmp(cmd, "JOIN")) {
if (0 == nparts) {