chiark / gitweb /
topicedit: add a timeout; better error handling
[ircbot.git] / bridge.tcl
index 64d2d5ed66de0ed3daf10740dd958bf0d3d909f0..8bac56c6e218cf287175ef076e1aa084398a6c3e 100755 (executable)
@@ -14,7 +14,7 @@ proc privmsg_unlogged {p ischan params} {
        if {[catch {
            prefix_nick
            set text [lindex $params 1]
-           if {"$line_org_endchar" == "\001"} {
+           if {![string compare $line_org_endchar "\001"]} {
                if {[regexp {^\?ACTION (.*)\?$} $text dummy text]} {
                    set towrite "* $n $text"
                } else {
@@ -55,7 +55,7 @@ def_bnbot event {l} {
        set bnnicks($n) 1
        sendprivmsg $channel "[bnnick_clean $n] has joined $bnchanfn."
     } elseif {[regexp {^1003 LEAVE ([^ ]+) \w+$} $l dummy n]} {
-       if {"$n" == "$bnnick"} return
+       if {![ircnick_compare $n $bnnick]} return
        catch { unset bnnicks($n) }
        sendprivmsg $channel "[bnnick_clean $n] has left $bnchanfn."
     } elseif {[regexp {^1004 WHISPER ([^ ]+) \w+ "(.*)"$} $l dummy n text]} {
@@ -74,7 +74,7 @@ def_bnbot event {l} {
            foreach m $pub_msgs { bnbot_writemsg $botid "$n $m" }
        }
     } elseif {[regexp {^1001 USER ([^ ]+) \w+} $l dummy n]} {
-       if {"$n" == "$bnnick"} return
+       if {![ircnick_compare $n $bnnick]} return
        set bnnicks($n) 1
     }
 }
@@ -86,7 +86,7 @@ proc msg_353 {p c dest type chan nicklist} {
     catch { unset onchan_nicks }
     foreach n $nicklist {
        regsub {^[@+]} $n {} n
-       if {"$n" == "$nick"} continue
+       if {![ircnick_compare $n $nick]} continue
        set onchan_nicks($n) 1
     }
 }