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,11 +92,23 @@ 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 */
|
||||||
(0 == strcmp(cmd, "MODE")) ||
|
switch (parts[1][0]) {
|
||||||
(0 == strcmp(cmd, "TOPIC")) ||
|
case '#':
|
||||||
(0 == strcmp(cmd, "KICK"))) {
|
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];
|
forum = parts[1];
|
||||||
} else if (0 == strcmp(cmd, "JOIN")) {
|
} else if (0 == strcmp(cmd, "JOIN")) {
|
||||||
if (0 == nparts) {
|
if (0 == nparts) {
|
Loading…
Reference in New Issue