[Tkabber-dev] r905 - in trunk/tkabber: . examples/tools

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Thu Feb 8 18:57:19 MSK 2007


Author: sergei
Date: 2007-02-08 18:57:17 +0300 (Thu, 08 Feb 2007)
New Revision: 905

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/examples/tools/jsend.tcl
Log:
	* examples/tools/jsend.tcl: Adapted to new jabberlib version.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2007-02-07 20:58:13 UTC (rev 904)
+++ trunk/tkabber/ChangeLog	2007-02-08 15:57:17 UTC (rev 905)
@@ -1,3 +1,7 @@
+2007-02-08  Sergei Golovan  <sgolovan at nes.ru>
+
+	* examples/tools/jsend.tcl: Adapted to new jabberlib version.
+
 2007-02-07  Sergei Golovan  <sgolovan at nes.ru>
 
 	* plugins/si/socks5.tcl: Fixed bug with lowering case of JID. Resource

Modified: trunk/tkabber/examples/tools/jsend.tcl
===================================================================
--- trunk/tkabber/examples/tools/jsend.tcl	2007-02-07 20:58:13 UTC (rev 904)
+++ trunk/tkabber/examples/tools/jsend.tcl	2007-02-08 15:57:17 UTC (rev 905)
@@ -146,13 +146,12 @@
         }
         jlib::connect $connid \
 		      -transport $transport \
-		      -host $aprops(domain) \
-		      -port $port
-        jlib::wait_for_stream $connid
+		      -host [idna::domain_toascii $aprops(domain)] \
+		      -port $port \
+		      -password $options(-password)
     
-        jlib::send_auth $connid \
-	    $aprops(local) $options(-password) $aprops(resource) \
-            [namespace current]::sendit_aux
+        jlib::login $connid [namespace current]::sendit_aux
+
         vwait [namespace current]::sendit_result
     
         if {[string compare [lindex $sendit_result 0] OK]} {
@@ -196,19 +195,10 @@
         }
     }
     if {!$stayP} {
-# the non-blocking nature hoses us here, so force the server to close things...
-#        jlib::disconnect
-
-        set connid [lindex $lib(connections) end]
-
         set jsend::stayP 0
-        fconfigure $lib($connid,sck) -blocking 1
-        outmsg "</stream:stream>"
-        flush $lib($connid,sck)
-        vwait [namespace current]::lib($connid,sck)
+	jlib::disconnect $connid
     }
 
-
     return 1
 }
 
@@ -362,7 +352,7 @@
                 if {[string length $buffer] > 0} {
                     if {[catch { eval [list jlib::sendit 1] $argv \
                                       [parse $buffer] \
-                                      [list -body "$buffer\n"] } result]} {
+                                      [list -body $buffer] } result]} {
                         ::LOG $result
                         break
                     } elseif {$result} {
@@ -381,7 +371,7 @@
             break
         } elseif {[set x [string first "\n" $buffer]] < 0} {
         } else {
-            set body [string range $buffer 0 $x]
+            set body [string range $buffer 0 [expr {$x-1}]]
             while {[catch { eval [list jlib::sendit 1] $argv [parse $body] \
                                  [list -body $body] } result]} {
                 ::LOG $result
@@ -544,3 +534,5 @@
 }
 
 exit $status
+
+# vim:ft=tcl:ts=8:sw=4:sts=4:noet



More information about the Tkabber-dev mailing list