[Tkabber-dev] r1184 - in trunk/tkabber: . plugins/general plugins/iq plugins/roster

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Sun Aug 12 19:42:56 MSD 2007


Author: sergei
Date: 2007-08-12 19:42:55 +0400 (Sun, 12 Aug 2007)
New Revision: 1184

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/iq.tcl
   trunk/tkabber/muc.tcl
   trunk/tkabber/plugins/general/caps.tcl
   trunk/tkabber/plugins/iq/ping.tcl
   trunk/tkabber/plugins/roster/conferenceinfo.tcl
Log:
	* iq.tcl: Switched to returning service-unavailable instead of
	  feature-not-implemented as recommended by RFC-3291.

	* plugins/iq/ping.tcl: Return service-unavailable instead of
	  swallowing ping request because it's mandatory to reply to every IQ
	  request.

	* plugins/general/caps.tcl: Index array of features lists not only by
	  hash values but also by hash methods.

	* plugins/roster/conferenceinfo.tcl: Added service-unavailable to
	  caught jabber:iq:browse errors.

	* muc.tcl: Added a hack to change room nickname instead of joining if
	  we are already in the room.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2007-08-11 14:49:33 UTC (rev 1183)
+++ trunk/tkabber/ChangeLog	2007-08-12 15:42:55 UTC (rev 1184)
@@ -1,3 +1,21 @@
+2007-08-12  Sergei Golovan  <sgolovan at nes.ru>
+
+	* iq.tcl: Switched to returning service-unavailable instead of
+	  feature-not-implemented as recommended by RFC-3291.
+
+	* plugins/iq/ping.tcl: Return service-unavailable instead of
+	  swallowing ping request because it's mandatory to reply to every IQ
+	  request.
+
+	* plugins/general/caps.tcl: Index array of features lists not only by
+	  hash values but also by hash methods.
+
+	* plugins/roster/conferenceinfo.tcl: Added service-unavailable to
+	  caught jabber:iq:browse errors.
+
+	* muc.tcl: Added a hack to change room nickname instead of joining if
+	  we are already in the room.
+
 2007-08-11  Sergei Golovan  <sgolovan at nes.ru>
 
 	* jabberlib-tclxml/tclxml/xml-8.1.tcl: Fixed parsing XML attributes

Modified: trunk/tkabber/iq.tcl
===================================================================
--- trunk/tkabber/iq.tcl	2007-08-11 14:49:33 UTC (rev 1183)
+++ trunk/tkabber/iq.tcl	2007-08-12 15:42:55 UTC (rev 1184)
@@ -75,9 +75,9 @@
 	    }
 	}
     } else {
-	debugmsg iq "IQREPLY: SENDING 501: $from; $useid; $id; $child"
+	debugmsg iq "IQREPLY: SENDING 503: $from; $useid; $id; $child"
 	jlib::send_iq error \
-	    [stanzaerror::error cancel feature-not-implemented -xml $child] \
+	    [stanzaerror::error cancel service-unavailable -xml $child] \
 	    -to $from \
 	    -connection $connid \
 	    -id $id

Modified: trunk/tkabber/muc.tcl
===================================================================
--- trunk/tkabber/muc.tcl	2007-08-11 14:49:33 UTC (rev 1183)
+++ trunk/tkabber/muc.tcl	2007-08-12 15:42:55 UTC (rev 1184)
@@ -1397,10 +1397,16 @@
     variable muc_password
 
     set group [tolower_node_and_domain $group]
+    set chatid [chat::chatid $connid $group]
 
+    if {[info exists chat::chats(status,$chatid)] && \
+	    ![string equal $chat::chats(status,$chatid) disconnected]} {
+	change_nick $chatid $nick
+	return
+    }
+
     privacy::add_to_special_list $connid conference [server_from_jid $group]
 
-    set chatid [chat::chatid $connid $group]
     set_our_groupchat_nick $chatid $nick
 
     chat::open_window $chatid groupchat

Modified: trunk/tkabber/plugins/general/caps.tcl
===================================================================
--- trunk/tkabber/plugins/general/caps.tcl	2007-08-11 14:49:33 UTC (rev 1183)
+++ trunk/tkabber/plugins/general/caps.tcl	2007-08-12 15:42:55 UTC (rev 1184)
@@ -177,8 +177,8 @@
 	return
     }
 
-    set hidentities($hver($connid,$jid)) $ids
-    set hfeatures($hver($connid,$jid)) $fes
+    set hidentities($htype($connid,$jid),$hver($connid,$jid)) $ids
+    set hfeatures($htype($connid,$jid),$hver($connid,$jid)) $fes
 }
 
 hook::add disco_info_hook [namespace current]::caps::info_receive

Modified: trunk/tkabber/plugins/iq/ping.tcl
===================================================================
--- trunk/tkabber/plugins/iq/ping.tcl	2007-08-11 14:49:33 UTC (rev 1183)
+++ trunk/tkabber/plugins/iq/ping.tcl	2007-08-12 15:42:55 UTC (rev 1184)
@@ -35,9 +35,9 @@
     variable options
 
     if {$options(pong)} {
-	return [list result ""]
+	return [list result {}]
     } else {
-	return [list ignore]
+	return [list error cancel service-unavailable]
     }
 }
 

Modified: trunk/tkabber/plugins/roster/conferenceinfo.tcl
===================================================================
--- trunk/tkabber/plugins/roster/conferenceinfo.tcl	2007-08-11 14:49:33 UTC (rev 1183)
+++ trunk/tkabber/plugins/roster/conferenceinfo.tcl	2007-08-12 15:42:55 UTC (rev 1184)
@@ -33,7 +33,8 @@
 	    ![info exists data(error_disco,$jid)]} return
 
     if {$data(error_disco,$jid) != "" && $data(error_browse,$jid) != ""} {
-	if {$data(error_browse_code,$jid) != "feature-not-implemented"} {
+	if {$data(error_browse_code,$jid) != "feature-not-implemented" && \
+		$data(error_browse_code,$jid) != "service-unavailable"} {
 	    set errstr $data(error_browse,$jid)
 	} else {
 	    set errstr $data(error_disco,$jid)



More information about the Tkabber-dev mailing list