[Tkabber-dev] r155 - trunk/plugins/killerfeature

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Tue Oct 21 16:51:53 MSD 2008


Author: kostix
Date: 2008-10-21 16:51:53 +0400 (Tue, 21 Oct 2008)
New Revision: 155

Modified:
   trunk/plugins/killerfeature/killerfeature.tcl
Log:
killerfeature/killerfeature.tcl: Updated to work with the latest
 changes in Tkabber's mainline (thanks to Alexey Smirnov).


Modified: trunk/plugins/killerfeature/killerfeature.tcl
===================================================================
--- trunk/plugins/killerfeature/killerfeature.tcl	2008-10-20 18:35:56 UTC (rev 154)
+++ trunk/plugins/killerfeature/killerfeature.tcl	2008-10-21 12:51:53 UTC (rev 155)
@@ -19,7 +19,7 @@
 }
 
 proc killerfeature::update_state args {
-	set enabled [expr {[llength [jlib::connections]] != 0}]
+	set enabled [expr {[llength [connections]] != 0}]
 }
 
 proc killerfeature::myentry m {
@@ -34,7 +34,7 @@
 }
 
 proc killerfeature::zap_dialog {} {
-	set connids [jlib::connections]
+	set connids [connections]
 	if {[llength $connids] == 0} return
 
 	set w [Dialog .zapaccount \
@@ -46,18 +46,20 @@
 	set f [$w getframe]
 
 	set accs [list]
-	foreach connid $connids {
-		lappend accs [list [jlib::connection_bare_jid $connid] $connid]
+	foreach xlib $connids {
+		lappend accs [list [connection_bare_jid $xlib] $xlib]
 	}
 	set accs [lsort -unique -index 0 $accs]
 
 	variable state
 	array unset state *
+	set n 0
 	foreach acc $accs {
-		lassign $acc jid connid
-		checkbutton $f.$connid -text $jid \
-			-variable [namespace current]::state($connid)
-		pack $f.$connid -side top -anchor w
+		lassign $acc jid xlib
+		checkbutton $f.$n -text $jid \
+			-variable [namespace current]::state($xlib)
+		pack $f.$n -side top -anchor w
+		incr n
 	}
 
 	set choice [$w draw]
@@ -65,25 +67,24 @@
 	if {$choice != 0} return
 
 	foreach acc $accs {
-		lassign $acc jid connid
-		if {$state($connid)} {
-			zap $connid
+		lassign $acc jid xlib
+		if {$state($xlib)} {
+			zap $xlib
 		}
 	}
 
 	array unset state *
 }
 
-proc killerfeature::zap connid {
-	jlib::send_iq set \
-		[jlib::wrapper:createtag query \
-			-vars [list xmlns jabber:iq:register] \
-			-subtags [list [jlib::wrapper:createtag remove]]] \
-		-connection $connid \
-		-command [list [namespace current]::parse_iq_resp $connid]
-	logout $connid
+proc killerfeature::zap xlib {
+	xmpp::sendIQ $xlib set \
+		-query [::xmpp::xml::create query \
+			-xmlns jabber:iq:register \
+			-subelements [list [::xmpp::xml::create remove]]] \
+		-command [list [namespace current]::parse_iq_resp $xlib]
+	logout $xlib
 }
 
-proc killerfeature::parse_iq_resp {connid res child} {
+proc killerfeature::parse_iq_resp {xlib res child} {
 }
 



More information about the Tkabber-dev mailing list