[Tkabber-dev] r123 - trunk/plugins/singularity

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Tue Aug 19 18:03:56 MSD 2008


Author: kostix
Date: 2008-08-19 18:03:55 +0400 (Tue, 19 Aug 2008)
New Revision: 123

Modified:
   trunk/plugins/singularity/singularity.tcl
Log:
singularity/singularity.tcl:
 * Fixed bug with handling of groupchats -- opening of private chat
   in a MUC room caused leaving of the MUC room.
 * Input history from all windows being closed is now collected,
   stack position is reset to 0 in a new window.


Modified: trunk/plugins/singularity/singularity.tcl
===================================================================
--- trunk/plugins/singularity/singularity.tcl	2008-08-18 23:47:10 UTC (rev 122)
+++ trunk/plugins/singularity/singularity.tcl	2008-08-19 14:03:55 UTC (rev 123)
@@ -22,6 +22,8 @@
 
 	set from [chat::get_jid $chatid]
 	set barejid [node_and_server_from_jid $from]
+	if {[chat::is_groupchat [chat::chatid \
+			[chat::get_connid $chatid] $barejid]]} return
 
 	variable contexts
 	upvar 0 contexts(input,$chatid) savedinput
@@ -34,14 +36,13 @@
 	if {$ifacetk::options(use_tabbar)} {
 		foreach page [.nb pages] {
 			upvar #0 chat::chat_id([ifacetk::nbpath $page]) cid 
-			if {![info exists cid]} continue
+			if {![info exists cid] || [chat::is_groupchat $from]} continue
 			set jid [chat::get_jid $cid]
 			if {![string equal $from $jid] &&
 					[string equal $barejid [node_and_server_from_jid $jid]]} {
 				if {$savedinput != ""} { append savedinput \n }
 				append savedinput [[chat::input_win $cid] get 1.0 end-1c]
-				set savedhistory [list \
-					$history(stack,$cid) $history(pos,$cid)]
+				set savedhistory [concat $savedhistory $history(stack,$cid)]
 				eval destroy [pack slaves [.nb getframe $page]]
 				.nb delete $page 1
 				ifacetk::tab_move .nb 0
@@ -64,8 +65,8 @@
 	variable [namespace parent]::history
 
 	[chat::input_win $chatid] insert end $contexts(input,$chatid)
-	lassign $contexts(history,$chatid) \
-		history(stack,$chatid) history(pos,$chatid)
+	set history(stack,$chatid) $contexts(history,$chatid)
+	set history(pos,$chatid)   0
 
 	unset contexts(input,$chatid) contexts(history,$chatid)
 }



More information about the Tkabber-dev mailing list