From: Pat Thoyts Date: Wed, 3 Feb 2010 10:16:25 +0000 (+0000) Subject: Handle ijchain/wubchain processing in the application code and fixed X-Git-Url: http://privyetmir.co.uk/gitweb?a=commitdiff_plain;h=31b7b0f1f463e3bb9d48cee7b7d43ed22ce5a7a8;p=Bullfrog Handle ijchain/wubchain processing in the application code and fixed jabber user management since it changed a while ago. Also started to add tooltips for irc users using whois information. Signed-off-by: Pat Thoyts --- diff --git a/bin/bf_irc.tcl b/bin/bf_irc.tcl index 235fab1..603cf47 100644 --- a/bin/bf_irc.tcl +++ b/bin/bf_irc.tcl @@ -144,6 +144,7 @@ proc IrcAddChannel {Chat channel} { $chan(window) chat tag bind URL [list UrlEnter %W] $chan(window) chat tag bind URL [list UrlLeave %W] $chan(window) chat tag bind URL [list UrlClick %W %x %y] + $chat(window) names configure -wrap none $chan(window) names tag bind NICK \ [list [namespace origin IrcChannelNickMenu] $Channel %W %x %y] $chan(window) names tag bind NICK \ @@ -194,7 +195,14 @@ proc IrcNickTooltip {Chat type w x y} { if {[package provide tooltip] eq {}} { return } set nick [string trim [$w get "@$x,$y linestart" "@$x,$y lineend"]] if {$nick eq ""} { return } - puts stderr "Tooltip $type $nick" + #puts stderr "Tooltip $type $nick" + upvar #0 $Chat chat + upvar #0 $chat(irc) context + if {![info exists context(whois,$nick)]} { return } + set data [dict get $context(whois,$nick) userinfo] + append data @[dict get $context(whois,$nick) host] + append data "\nis on " [join [dict get $context(whois,$nick) channels] ", "] + after idle [list ::tooltip::tooltip $w -tag NICK-$nick $data] return } @@ -271,6 +279,20 @@ proc IrcCallback {Chat context state args} { IrcCallbackNick $w $action $target $jnick $jnew jabber return } + } elseif {$nick in {ijchain wubchain}} { + # alternative stuff for ijchain/wubchain + if {$type eq "ACTION"} { + regexp {(\S+) (.+)} $msg -> nick msg + if {$msg eq "has become available"} { + IrcCallbackNick $w entered $target $nick "" jabber + return + } elseif {$msg eq "has left"} { + IrcCallbackNick $w left $target $nick "" jabber + return + } + } else { + regexp {<([^>]+)> (.+)} $msg -> nick msg + } } $w message $msg -nick $nick -type $type }