mirror of https://github.com/nealey/irc-bot
fix JOIN parser (again)
This commit is contained in:
parent
efb3c7063d
commit
dffd968152
2
bot
2
bot
|
@ -19,6 +19,6 @@ export nickname realname
|
||||||
fi
|
fi
|
||||||
)
|
)
|
||||||
|
|
||||||
mkfifo -m 0600 $botdir/fifo
|
[ -p $botdir/fifo ] || mkfifo -m 0600 $botdir/fifo
|
||||||
|
|
||||||
exec $d/dispatch -f $botdir/fifo $d/irc $botdir/handler
|
exec $d/dispatch -f $botdir/fifo $d/irc $botdir/handler
|
||||||
|
|
|
@ -11,7 +11,15 @@ else
|
||||||
fd=1
|
fd=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -x $botdir/login ]; then
|
||||||
$botdir/login 1 >& $fd
|
$botdir/login 1 >& $fd
|
||||||
|
else
|
||||||
|
nickname=$(cat $botdir/nickname)
|
||||||
|
realname=$(cat $botdir/realname 2>/dev/null || \
|
||||||
|
echo "I'm a little printf, short and stdout.")
|
||||||
|
echo "NICK $nickname" 1 >& $fd
|
||||||
|
echo "USER $nickname $nickname $nickname :$realname" 1 >& $fd
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -p $botdir/fifo ]; then
|
if [ -p $botdir/fifo ]; then
|
||||||
fifo="-f $botdir/fifo"
|
fifo="-f $botdir/fifo"
|
||||||
|
|
|
@ -111,7 +111,8 @@ main(int argc, char *argv[])
|
||||||
(0 == strcmp(cmd, "KICK"))) {
|
(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) {
|
DUMP_d(nparts);
|
||||||
|
if (1 == nparts) {
|
||||||
forum = text;
|
forum = text;
|
||||||
text = NULL;
|
text = NULL;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue