[Tkabber-dev] [tclxmpp] r126 committed - * xmpp/disco.tcl: Fixed calling back when info or items are received...

codesite-noreply at google.com codesite-noreply at google.com
Sun Oct 18 15:39:45 MSD 2009


Revision: 126
Author: sgolovan
Date: Sun Oct 18 04:39:10 2009
Log: 	* xmpp/disco.tcl: Fixed calling back when info or items are received
	  with status error or abort.

http://code.google.com/p/tclxmpp/source/detail?r=126

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

=======================================
--- /trunk/ChangeLog	Sun Oct 11 21:25:16 2009
+++ /trunk/ChangeLog	Sun Oct 18 04:39:10 2009
@@ -1,3 +1,8 @@
+2009-10-18  Sergei Golovan  <sgolovan at nes.ru>
+
+	* xmpp/disco.tcl: Fixed calling back when info or items are received
+	  with status error or abort.
+
  2009-10-12  Sergei Golovan  <sgolovan at nes.ru>

  	* examples/rssbot.tcl: Ignore messages with empty bodies.
=======================================
--- /trunk/xmpp/disco.tcl	Wed Apr 22 23:13:53 2009
+++ /trunk/xmpp/disco.tcl	Sun Oct 18 04:39:10 2009
@@ -162,15 +162,14 @@
          if {[lsearch -exact $NonCacheable $condition] >= 0} {
              # Do not cache certain error conditions

-            return
-        }
-
-        if {$cache && [lsearch -glob $state(cache) \
-                                     [list [list info $jid $node] *]] < 0}  
{
-            lappend state(cache) [list [list info $jid $node] $status $xml]
-
-            if {[llength $state(cache)] > $state(size)} {
-                set state(cache) [lrange $state(cache) 1 end]
+        } else {
+            if {$cache && [lsearch -glob $state(cache) \
+                                   [list [list info $jid $node] *]] < 0} {
+                lappend state(cache) [list [list info $jid $node] $status  
$xml]
+
+                if {[llength $state(cache)] > $state(size)} {
+                    set state(cache) [lrange $state(cache) 1 end]
+                }
              }
          }

@@ -181,6 +180,9 @@
      } elseif {![string equal $status ok]} {
          # Do not cache the answer if status is 'abort'

+        if {[llength $commands] > 0} {
+            uplevel #0 [lindex $commands 0] [list $status $xml]
+        }
          return
      }

@@ -225,7 +227,6 @@
          uplevel #0 [lindex $commands 0] \
                     [list ok [list $identities $features $extras]]
      }
-
      return
  }

@@ -309,15 +310,15 @@
          if {[lsearch -exact $NonCacheable $condition] >= 0} {
              # Do not cache certain error conditions

-            return
-        }
-
-        if {$cache && [lsearch -glob $state(cache) \
-                                     [list [list items $jid $node] *]] <  
0} {
-            lappend state(cache) [list [list items $jid $node] $status  
$xml]
-
-            if {[llength $state(cache)] > $state(size)} {
-                set state(cache) [lrange $state(cache) 1 end]
+        } else {
+
+            if {$cache && [lsearch -glob $state(cache) \
+                                   [list [list items $jid $node] *]] < 0} {
+                lappend state(cache) [list [list items $jid $node] $status  
$xml]
+
+                if {[llength $state(cache)] > $state(size)} {
+                    set state(cache) [lrange $state(cache) 1 end]
+                }
              }
          }

@@ -328,6 +329,9 @@
      } elseif {![string equal $status ok]} {
          # Do not cache the answer if status is 'abort'

+        if {[llength $commands] > 0} {
+            uplevel #0 [lindex $commands 0] [list $status $xml]
+        }
          return
      }

@@ -364,7 +368,6 @@
      if {[llength $commands] > 0} {
          uplevel #0 [lindex $commands 0] [list ok $items]
      }
-
      return
  }



More information about the Tkabber-dev mailing list