[Tkabber-dev] r2040 - in trunk/tkabber-plugins: . singularity

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Tue Dec 31 00:16:05 MSK 2013


Author: sergei
Date: 2013-12-31 00:16:05 +0400 (Tue, 31 Dec 2013)
New Revision: 2040

Modified:
   trunk/tkabber-plugins/ChangeLog
   trunk/tkabber-plugins/singularity/singularity.tcl
Log:
	* singularity/singularity.tcl: Fixed concatenation of histories.


Modified: trunk/tkabber-plugins/ChangeLog
===================================================================
--- trunk/tkabber-plugins/ChangeLog	2013-12-30 19:24:55 UTC (rev 2039)
+++ trunk/tkabber-plugins/ChangeLog	2013-12-30 20:16:05 UTC (rev 2040)
@@ -1,3 +1,7 @@
+2013-12-30  Sergei Golovan <sgolovan at nes.ru>
+
+	* singularity/singularity.tcl: Fixed concatenation of histories.
+
 2013-12-03  Sergei Golovan <sgolovan at nes.ru>
 
 	* debug/debug.tcl: Added xmpp::transport::bosh debug category.

Modified: trunk/tkabber-plugins/singularity/singularity.tcl
===================================================================
--- trunk/tkabber-plugins/singularity/singularity.tcl	2013-12-30 19:24:55 UTC (rev 2039)
+++ trunk/tkabber-plugins/singularity/singularity.tcl	2013-12-30 20:16:05 UTC (rev 2040)
@@ -58,15 +58,15 @@
     variable [namespace parent]::history
 
     set savedinput ""
-    set savedhistory [list]
+    set savedhistory [list {}]
 
     foreach cid [chat::opened] {
 	set jid [chat::get_jid $cid]
-	if {![string equal $from $jid] &&
-		[string equal $barejid [::xmpp::jid::stripResource $jid]]} {
+	if {![::xmpp::jid::equal $from $jid] &&
+		[::xmpp::jid::equal $barejid [::xmpp::jid::stripResource $jid]]} {
 	    if {$savedinput != ""} { append savedinput \n }
 	    append savedinput [[chat::input_win $cid] get 1.0 end-1c]
-	    set savedhistory [concat $savedhistory $history(stack,$cid)]
+	    set savedhistory [concat $savedhistory [lrange $history(stack,$cid) 1 end]]
 	    chat::close $cid
 	}
     }
@@ -82,11 +82,11 @@
 
     variable [namespace parent]::history
 
-    [chat::input_win $chatid] insert end $contexts(input,$chatid)
-    set history(stack,$chatid) $contexts(history,$chatid)
-    set history(pos,$chatid)   0
+    [chat::input_win $chatid] insert end $savedinput
+    set history(stack,$chatid) $savedhistory
+    set history(pos,$chatid) 0
 
-    unset contexts(input,$chatid) contexts(history,$chatid)
+    unset savedinput savedhistory
 }
 
 # vim:ts=8:sw=4:sts=4:noet



More information about the Tkabber-dev mailing list