From e196c6a3e25f439c944d0df41c127bbee46225c6 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Thu, 16 Dec 2010 21:29:52 -0700 Subject: [PATCH] Fix "\\\007NOTICE $sender :foo" factoid problem --- cobalt-handler | 15 ++++++++++----- infobot | 3 +++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/cobalt-handler b/cobalt-handler index 513ed4a..0d5c712 100755 --- a/cobalt-handler +++ b/cobalt-handler @@ -7,15 +7,19 @@ command=$1; export command; shift # $* is now args text=$(cat) +join () { + printf '\aJOIN %s\n' "$1" +} + case $command in 001) - printf '\aJOIN #woozle\n' - printf '\aJOIN #foozle\n' - printf '\aJOIN #bot\n' + join "#woozle" + join "#foozle" + join "#bot" ;; PRIVMSG) case "$forum" in - \#woozle|\#foozle) + \#*) ./firebot "$text" || \ ./whuffie woozle.whuffie.cdb "$text" || \ ./infobot woozle.factoids.cdb "$text" @@ -23,7 +27,8 @@ case $command in esac ;; INVITE) - printf '\aJOIN %s\n' "$forum" + join "$forum" + echo "Thanks for the invitation, $sender." ;; esac diff --git a/infobot b/infobot index c017b5e..f0fe948 100755 --- a/infobot +++ b/infobot @@ -65,6 +65,9 @@ EOF "") exit 1 ;; + \\*) + echo "Someone's up to no good!" + ;; \\*) printf "%s" "$resp" | cut -b2- ;;