[Tkabber-dev] r1908 - trunk/tkabber

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Mon Feb 1 19:59:20 MSK 2010


Author: sergei
Date: 2010-02-01 19:59:20 +0300 (Mon, 01 Feb 2010)
New Revision: 1908

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/chats.tcl
Log:
	* chats.tcl: Fixed reporting presence change for opened chat windows.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2010-02-01 16:19:44 UTC (rev 1907)
+++ trunk/tkabber/ChangeLog	2010-02-01 16:59:20 UTC (rev 1908)
@@ -2,6 +2,8 @@
 
 	* chats.tcl: Added a few debug instructions.
 
+	* chats.tcl: Fixed reporting presence change for opened chat windows.
+
 2010-01-31  Sergei Golovan  <sgolovan at nes.ru>
 
 	* chats.tcl, muc.tcl, plugins/chat/muc_ignore.tcl: Changed arguments

Modified: trunk/tkabber/chats.tcl
===================================================================
--- trunk/tkabber/chats.tcl	2010-02-01 16:19:44 UTC (rev 1907)
+++ trunk/tkabber/chats.tcl	2010-02-01 16:59:20 UTC (rev 1908)
@@ -989,6 +989,10 @@
 
     debugmsg chat "PRESENCE: $xlib $jid $type $x $args"
 
+    set chatid [chatid $xlib $jid]
+
+    if {![is_opened $chatid] || [is_groupchat $chatid]} return
+
     switch -- $type {
 	error -
 	unavailable { set status $type }
@@ -1005,19 +1009,16 @@
 
     # This case traces both chat and private groupchat conversations:
     if {$options(gen_status_change_msgs)} {
-	set chatid [chatid $xlib $jid]
-	if {[is_opened $chatid]} {
-	    set msg [get_nick $xlib $jid chat]
-	    append msg " " [::get_long_status_desc [::get_user_status $xlib $jid]]
-	    set desc [::get_user_status_desc $xlib $jid]
-	    if {$desc != {}} {
-		append msg " ($desc)"
-	    }
-	    ::chat::add_message $chatid "" chat $msg {}
+	set msg [get_nick $xlib $jid chat]
+	append msg " " [::get_long_status_desc [::get_user_status $xlib $jid]]
+	set desc [::get_user_status_desc $xlib $jid]
+	if {![string equal $desc ""]} {
+	    append msg " ($desc)"
 	}
+	::chat::add_message $chatid "" chat $msg {}
     }
 
-    set cw [winid [chatid $xlib $jid]]
+    set cw [winid $chatid]
 
     if {[winfo exists $cw.status.icon]} {
 	$cw.status.icon configure \



More information about the Tkabber-dev mailing list