[Tkabber-dev] [tclxmpp] r181 committed - * xmpp/roster.tcl: Removed usage of -index lsearch option because it...

tclxmpp at googlecode.com tclxmpp at googlecode.com
Sun Feb 16 10:44:14 MSK 2014


Revision: 181
Author:   sgolovan
Date:     Sun Feb 16 06:43:59 2014 UTC
Log:      	* xmpp/roster.tcl: Removed usage of -index lsearch option  
because it
	  doesn't work with Tcl 8.4.

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

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

=======================================
--- /trunk/ChangeLog	Sun Feb  2 17:12:34 2014 UTC
+++ /trunk/ChangeLog	Sun Feb 16 06:43:59 2014 UTC
@@ -1,3 +1,8 @@
+2014-02-16  Sergei Golovan  <sgolovan at nes.ru>
+
+	* xmpp/roster.tcl: Removed usage of -index lsearch option because it
+	  doesn't work with Tcl 8.4.
+
  2014-02-02  Sergei Golovan  <sgolovan at nes.ru>

  	* xmpp/xmpp.tcl: Added function which returns the current XMPP stream
=======================================
--- /trunk/xmpp/roster.tcl	Sun Feb  2 17:43:11 2014 UTC
+++ /trunk/xmpp/roster.tcl	Sun Feb 16 06:43:59 2014 UTC
@@ -407,7 +407,15 @@
                      set state(items) [lreplace $state(items) $idx $idx]
                  }

-                set idx [lsearch -exact -index 0 $state(-cache) $njid]
+                set idx -1
+                set i -1
+                foreach item $state(-cache) {
+                    incr i
+                    if {[string equal [lindex $item 0] $njid]} {
+                        set idx $i
+                        break
+                    }
+                }
                  if {$idx >= 0} {
                      set state(-cache) [lreplace $state(-cache) $idx $idx]
                  }


More information about the Tkabber-dev mailing list