[Tkabber-dev] r146 - in trunk/plugins: quotelastmsg stripes

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Mon Oct 13 17:40:08 MSD 2008


Author: kostix
Date: 2008-10-13 17:40:08 +0400 (Mon, 13 Oct 2008)
New Revision: 146

Modified:
   trunk/plugins/quotelastmsg/quotelastmsg.tcl
   trunk/plugins/stripes/stripes.tcl
Log:
quotelastmsg/quotelastmsg.tcl, stripes/stripes.tcl:
 Added check for a chat window being already opened before
 attempting to fiddle with its contents. This should fix
 reported errors which are probably caused by typing
 notifications being sent to us when the chat window
 isn't already opened.


Modified: trunk/plugins/quotelastmsg/quotelastmsg.tcl
===================================================================
--- trunk/plugins/quotelastmsg/quotelastmsg.tcl	2008-10-12 16:35:49 UTC (rev 145)
+++ trunk/plugins/quotelastmsg/quotelastmsg.tcl	2008-10-13 13:40:08 UTC (rev 146)
@@ -60,9 +60,11 @@
 }
 
 proc quotelastmsg::on_message_drawn {chatid from type body x} {
-    variable state
+    if {![chat::is_opened $chatid]} return
 
     set cw [::chat::chat_win $chatid]
+
+    variable state
     upvar 0 state($cw,last) last
 
     set now [$cw index {end - 1 char}]

Modified: trunk/plugins/stripes/stripes.tcl
===================================================================
--- trunk/plugins/stripes/stripes.tcl	2008-10-12 16:35:49 UTC (rev 145)
+++ trunk/plugins/stripes/stripes.tcl	2008-10-13 13:40:08 UTC (rev 146)
@@ -50,9 +50,11 @@
 }
 
 proc stripes::on_message_drawn {chatid from type body x} {
-    variable state
+    if {![chat::is_opened $chatid]} return
 
     set cw [::chat::chat_win $chatid]
+
+    variable state
     upvar 0 state($cw,last) last
     upvar 0 state($cw,tag)  tag
 



More information about the Tkabber-dev mailing list