[Tkabber-dev] [tclxmpp commit] r46 - in trunk: . xmpp

codesite-noreply at google.com codesite-noreply at google.com
Fri Oct 24 23:00:48 MSD 2008


Author: sgolovan
Date: Fri Oct 24 12:00:36 2008
New Revision: 46

Modified:
    trunk/ChangeLog
    trunk/xmpp/xmpp.tcl

Log:
	* xmpp/xmpp.tcl: Fixed error stanza when aborting IQ on timeout, made
	  calling back when sending IQ failed to after idle, fixed IQ
	  callbacks to compare normalized JIDs when searching for reply.


Modified: trunk/ChangeLog
==============================================================================
--- trunk/ChangeLog	(original)
+++ trunk/ChangeLog	Fri Oct 24 12:00:36 2008
@@ -1,3 +1,9 @@
+2008-10-24  Sergei Golovan  <sgolovan at nes.ru>
+
+	* xmpp/xmpp.tcl: Fixed error stanza when aborting IQ on timeout, made
+	  calling back when sending IQ failed to after idle, fixed IQ
+	  callbacks to compare normalized JIDs when searching for reply.
+
  2008-10-21  Sergei Golovan  <sgolovan at nes.ru>

  	* xmpp/xml.tcl: Fixed typo.

Modified: trunk/xmpp/xmpp.tcl
==============================================================================
--- trunk/xmpp/xmpp.tcl	(original)
+++ trunk/xmpp/xmpp.tcl	Fri Oct 24 12:00:36 2008
@@ -1394,14 +1394,15 @@

      # A 'from' JID in result or error IQ may differ from 'to' JID in
      # corresponding request if the reques was sent without 'to' attribute.
-    if {[::xmpp::jid::equal $from $to]} {
-        set pfrom [list $from ""]
-    } elseif {[::xmpp::jid::equal $from [::xmpp::jid::stripResource $to]]}  
{
-        set pfrom [list $from ""]
-    } elseif {[::xmpp::jid::equal $from [::xmpp::jid::server $to]]} {
-        set pfrom [list $from ""]
+    set nfrom [jid::normalize $from]
+    if {[jid::equal $from $to]} {
+        set pfrom [list $nfrom ""]
+    } elseif {[jid::equal $from [jid::stripResource $to]]} {
+        set pfrom [list $nfrom ""]
+    } elseif {[jid::equal $from [jid::server $to]]} {
+        set pfrom [list $nfrom ""]
      } else {
-        set pfrom [list $from]
+        set pfrom [list $nfrom]
      }

      # Any IQ.
@@ -1683,11 +1684,13 @@
      }

      if {[info exists cmd]} {
-        set state([list iq $attrs(id) $to]) $cmd
+        set state([list iq $attrs(id) [jid::normalize $to]]) $cmd
          if {$timeout > 0} {
              after $timeout \
                    [namespace code [list abortIQ $xlib $attrs(id) timeout \
-                                [::msgcat::mc "IQ %s timed out"  
$attrs(id)]]]
+                                [xml::create error \
+                                    -cdata [::msgcat::mc "IQ %s timed out"  
\
+                                                         $attrs(id)]]]]
          }
      }

@@ -1697,11 +1700,11 @@
      set res [outXML $xlib $data]

      if {[info exists cmd] && $res < 0} {
-        unset state([list iq $attrs(id) $to])
-        uplevel #0 $cmd [list abort \
-                              [xml::create error \
-                                    -cdata [::msgcat::mc "Disconnected"]]]
-
+        after idle \
+              [namespace code [list abortIQ $xlib $attrs(id) abort \
+                                            [xml::create error \
+                                                -cdata [::msgcat::mc \
+                                                            "Disconnected"]]]]
      }

      if {$getset && [info exists attrs(id)]} {


More information about the Tkabber-dev mailing list