mirror of https://github.com/nealey/irc-bot
fix forum for privmsg
This commit is contained in:
parent
dc9f49e350
commit
491c65415c
2
Makefile
2
Makefile
|
@ -1,5 +1,5 @@
|
||||||
CFLAGS = -Wall -Werror
|
CFLAGS = -Wall -Werror
|
||||||
TARGETS = dispatch irc
|
TARGETS = dispatch irc-filter
|
||||||
|
|
||||||
all: $(TARGETS)
|
all: $(TARGETS)
|
||||||
|
|
||||||
|
|
|
@ -17,4 +17,4 @@ if [ -p $botdir/fifo ]; then
|
||||||
fifo="-f $botdir/fifo"
|
fifo="-f $botdir/fifo"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec $ircdir/dispatch $fifo $ircdir/irc $botdir/handler
|
exec $ircdir/dispatch $fifo $ircdir/irc-filter $botdir/handler
|
||||||
|
|
|
@ -92,8 +92,20 @@ main(int argc, char *argv[])
|
||||||
|
|
||||||
/* Determine forum */
|
/* Determine forum */
|
||||||
if ((0 == strcmp(cmd, "PRIVMSG")) ||
|
if ((0 == strcmp(cmd, "PRIVMSG")) ||
|
||||||
(0 == strcmp(cmd, "NOTICE")) ||
|
(0 == strcmp(cmd, "NOTICE"))) {
|
||||||
(0 == strcmp(cmd, "PART")) ||
|
/* :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, "MODE")) ||
|
||||||
(0 == strcmp(cmd, "TOPIC")) ||
|
(0 == strcmp(cmd, "TOPIC")) ||
|
||||||
(0 == strcmp(cmd, "KICK"))) {
|
(0 == strcmp(cmd, "KICK"))) {
|
Loading…
Reference in New Issue