[Tkabber-dev] r1570 - trunk/tkabber

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Tue Oct 21 18:08:21 MSD 2008


Author: sergei
Date: 2008-10-21 18:08:21 +0400 (Tue, 21 Oct 2008)
New Revision: 1570

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/datagathering.tcl
   trunk/tkabber/disco.tcl
   trunk/tkabber/login.tcl
Log:
	* datagathering.tcl: Fixed typo.

	* disco.tcl: Fixed checking for jabber:x:data XMLNS in disco forms.

	* datagathering: Fixed creating jabber:x:data submit forms.

	* login.tcl: Fixed checking for different proxy packages. Also, make
	  sure that no login is scheduled if logout without arguments is
	  called.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2008-10-21 06:42:45 UTC (rev 1569)
+++ trunk/tkabber/ChangeLog	2008-10-21 14:08:21 UTC (rev 1570)
@@ -7,6 +7,12 @@
 
 	* disco.tcl: Fixed checking for jabber:x:data XMLNS in disco forms.
 
+	* datagathering: Fixed creating jabber:x:data submit forms.
+
+	* login.tcl: Fixed checking for different proxy packages. Also, make
+	  sure that no login is scheduled if logout without arguments is
+	  called.
+
 2008-10-20  Sergei Golovan  <sgolovan at nes.ru>
 
 	* messages.tcl: Fixed typo.

Modified: trunk/tkabber/datagathering.tcl
===================================================================
--- trunk/tkabber/datagathering.tcl	2008-10-21 06:42:45 UTC (rev 1569)
+++ trunk/tkabber/datagathering.tcl	2008-10-21 14:08:21 UTC (rev 1570)
@@ -588,11 +588,12 @@
 	        lappend vartags [::xmpp::xml::create value -cdata $val]
 	    }
 	} else {
-	    set vartag [::xmpp::xml::create value -cdata $data(var,$var,$g)]
+	    set vartags [list [::xmpp::xml::create value \
+					    -cdata $data(var,$var,$g)]]
 	}
 	lappend restags [::xmpp::xml::create field \
 					     -attrs [list var $var] \
-					     -subelement $vartag]
+					     -subelement $vartags]
     }
 
     set restag [list [::xmpp::xml::create x \

Modified: trunk/tkabber/disco.tcl
===================================================================
--- trunk/tkabber/disco.tcl	2008-10-21 06:42:45 UTC (rev 1569)
+++ trunk/tkabber/disco.tcl	2008-10-21 14:08:21 UTC (rev 1570)
@@ -206,7 +206,7 @@
 		}
 	    }
 	    default {
-		if {$xmlns == $::NS(data) && \
+		if {$sxmlns == $::NS(data) && \
 			[::xmpp::xml::getAttr $sattrs type] == "result"} {
 		    lappend extras [data::parse_xdata_results $ssubels -hidden 1]
 		}

Modified: trunk/tkabber/login.tcl
===================================================================
--- trunk/tkabber/login.tcl	2008-10-21 06:42:45 UTC (rev 1569)
+++ trunk/tkabber/login.tcl	2008-10-21 14:08:21 UTC (rev 1570)
@@ -21,13 +21,16 @@
     set have_sasl 1
 }
 
-if {[catch {package require pconnect::socks4}] && \
-	[catch {package require pconnect::socks5}] && \
-	[catch {package require pconnect::https}]} {
-    set have_proxy 0
-} else {
+set have_proxy 0
+if {![catch {package require pconnect::socks4}]} {
     set have_proxy 1
 }
+if {![catch {package require pconnect::socks5}]} {
+    set have_proxy 1
+}
+if {![catch {package require pconnect::https}]} {
+    set have_proxy 1
+}
 
 if {[catch {package require xmpp::transport::poll}]} {
     set have_http_poll 0
@@ -342,7 +345,7 @@
     }
     # OK, connected.
     debugmsg login "Connect successful ($jid) $xlib"
-    set login_after_time 15000
+    set login_after_time 7500
     login_login $xlib $logindata
 }
 
@@ -350,7 +353,9 @@
     global login_after_time
     global login_after_id
 
-    if {![info exists login_after_time]} {set login_after_time 7500}
+    if {![info exists login_after_time]} {
+	set login_after_time 7500
+    }
     if {$login_after_time < 1800000} {
 	# 1800000 == 30 * 60 * 1000 == 30min
 	# the sequence goes: 15s, 30s, 1min, 2min, 4min, 8min, 16min, 32min, 32min...
@@ -371,10 +376,11 @@
 proc login_retry1 {interval jid logindata} {
     global login_after_id
 
+    incr interval -1000
+
     if {$interval <= 0} {
 	login $logindata
     } else {
-	incr interval -1000
 	set login_after_id($jid) [after 1000 [list login_retry1 $interval $jid $logindata]]
 	set_status [::msgcat::mc "Login retry for %s in %s" $jid \
 				 [format_time [expr {$interval/1000}]]]
@@ -693,9 +699,16 @@
 ########################################################################
 
 proc logout {{xlib {}}} {
+    global login_after_id
+
     debugmsg login "LOGOUT $xlib"
 
     if {$xlib == {}} {
+	foreach jid [array names login_after_id] {
+	    after cancel $login_after_id($jid)
+	    unset login_after_id($jid)
+	}
+
 	foreach xlib [connections] {
 	    disconnected $xlib
 	}



More information about the Tkabber-dev mailing list