]> git.donarmstrong.com Git - infobot.git/commitdiff
don't clear channels, minor utf8 tweak
authortimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Wed, 28 Dec 2011 21:31:56 +0000 (21:31 +0000)
committertimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Wed, 28 Dec 2011 21:31:56 +0000 (21:31 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@1915 c11ca15a-4712-0410-83d8-924469b57eb5

infobot
src/IRC/Irc.pl

diff --git a/infobot b/infobot
index 2c58f3921cb7e3d493e96eb1f357d711d0d2f279..ff2b0a0640de1ed44d92ca9df639732665232218 100755 (executable)
--- a/infobot
+++ b/infobot
@@ -14,6 +14,7 @@ use vars qw($bot_base_dir $bot_src_dir $bot_misc_dir $bot_state_dir
 # ancient Perl may not like these, but modern systems should have this
 use open ':utf8';
 use open ':std';
+use Encode qw( decode FB_QUIET );
 
 BEGIN {
     if ( @ARGV and -f $ARGV[0] ) {
index ccae33b17bd64d006dd3914ba964794f5bed87c5..7b962c8ad23e0b9e13c9c1ef6cb2cd54257087ea 100644 (file)
@@ -128,6 +128,7 @@ sub irc {
            if (defined $conns{$mynick}) {
                # explicit binmode for socket as "use open" does not seem to work here
                #binmode $conns{$mynick}->{_socket}, ":utf8";
+               # This will bomb on non-utf8 input
                #binmode $conns{$mynick}->{_socket}, ":encoding(UTF-8)";
                # TODO: need to input bytes, but output utf8
                binmode $conns{$mynick}->{_socket}, ":bytes";
@@ -887,7 +888,8 @@ sub clearChanVars {
 }
 
 sub clearIRCVars {
-    undef %channels;
+    # FIXME: only remove channels for current bot!
+    #undef %channels;
     undef %floodjoin;
 
     $cache{joinTime} = time();