[Tkabber-dev] r1880 - trunk/tkabber

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Sat Jan 23 11:19:46 MSK 2010


Author: sergei
Date: 2010-01-23 11:19:46 +0300 (Sat, 23 Jan 2010)
New Revision: 1880

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/login.tcl
   trunk/tkabber/namespaces.tcl
   trunk/tkabber/register.tcl
   trunk/tkabber/roster.tcl
Log:
	* login.tcl, roster.tcl: Use xmpp::register package from TclXMPP.

	* namespaces.tcl, register.tcl: Removed NS(register) array value.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2010-01-22 11:20:17 UTC (rev 1879)
+++ trunk/tkabber/ChangeLog	2010-01-23 08:19:46 UTC (rev 1880)
@@ -1,3 +1,9 @@
+2010-01-23  Sergei Golovan  <sgolovan at nes.ru>
+
+	* login.tcl, roster.tcl: Use xmpp::register package from TclXMPP.
+
+	* namespaces.tcl, register.tcl: Removed NS(register) array value.
+
 2010-01-22 Konstantin Khomoutov <flatworm at users.sourceforge.net>
 
 	* ifacetk/iface.tcl: Fix error occured when deletion of the status

Modified: trunk/tkabber/login.tcl
===================================================================
--- trunk/tkabber/login.tcl	2010-01-22 11:20:17 UTC (rev 1879)
+++ trunk/tkabber/login.tcl	2010-01-23 08:19:46 UTC (rev 1880)
@@ -2,6 +2,7 @@
 
 package require xmpp::dns
 package require xmpp::auth
+package require xmpp::register
 
 if {[catch {package require xmpp::starttls}]} {
     set use_tls 0
@@ -774,15 +775,11 @@
 						    [error_to_string $xml]] \
 			     -type user -buttons {yes no} -default 0 -cancel 1]
 		if {!$res} {
-		    ::xmpp::sendIQ $xlib set \
-			-query [::xmpp::xml::create query \
-				    -xmlns jabber:iq:register \
-				    -subelement [::xmpp::xml::create username \
-							-cdata $lc(user)] \
-				    -subelement [::xmpp::xml::create password \
-							-cdata $lc(password)]] \
-			-to $lc(server) \
-			-command [list recv_register_result $xlib $logindata]
+		    ::xmpp::register::submit $xlib $lc(server) \
+			    [list username [list $lc(user)] \
+				  password [list $lc(password)]] \
+			    -old 1 \
+			    -command [list recv_register_result $xlib $logindata]
 		    return
 		}
 	    } else {

Modified: trunk/tkabber/namespaces.tcl
===================================================================
--- trunk/tkabber/namespaces.tcl	2010-01-22 11:20:17 UTC (rev 1879)
+++ trunk/tkabber/namespaces.tcl	2010-01-23 08:19:46 UTC (rev 1880)
@@ -15,7 +15,6 @@
 
 namespace eval :: {
     array set NS [list \
-	register    "jabber:iq:register" \
 	roster	    "jabber:iq:roster" \
 	signed      "jabber:x:signed" \
 	encrypted   "jabber:x:encrypted" \

Modified: trunk/tkabber/register.tcl
===================================================================
--- trunk/tkabber/register.tcl	2010-01-22 11:20:17 UTC (rev 1879)
+++ trunk/tkabber/register.tcl	2010-01-23 08:19:46 UTC (rev 1880)
@@ -279,5 +279,5 @@
 }
 
 hook::add postload_hook \
-    [list disco::browser::register_feature_handler $::NS(register) register::open \
+    [list disco::browser::register_feature_handler jabber:iq:register register::open \
     -desc [list * [::msgcat::mc "Register"]]]

Modified: trunk/tkabber/roster.tcl
===================================================================
--- trunk/tkabber/roster.tcl	2010-01-22 11:20:17 UTC (rev 1879)
+++ trunk/tkabber/roster.tcl	2010-01-23 08:19:46 UTC (rev 1880)
@@ -1,6 +1,7 @@
 # $Id$
 
 package require xmpp::roster
+package require xmpp::register
 
 namespace eval roster {
     variable undef_group_name [::msgcat::mc "Undefined"]
@@ -553,11 +554,7 @@
 	 ($category == "gateway")) && \
 	[string compare -nocase [::xmpp::jid::stripResource $jid] \
 				[connection_server $xlib]]} {
-	::xmpp::sendIQ $xlib set \
-	    -query [::xmpp::xml::create query \
-			-xmlns jabber:iq:register \
-			-subelement [::xmpp::xml::create remove]] \
-	    -to $jid
+	::xmpp::register::remove $xlib $jid
     }
 }
 



More information about the Tkabber-dev mailing list