[Tkabber-dev] r1266 - in trunk/tkabber-plugins: . floatinglog

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Wed Oct 10 20:28:45 MSD 2007


Author: sergei
Date: 2007-10-10 20:28:45 +0400 (Wed, 10 Oct 2007)
New Revision: 1266

Modified:
   trunk/tkabber-plugins/ChangeLog
   trunk/tkabber-plugins/floatinglog/floatinglog.tcl
Log:
	* floatinglog/floatinglog.tcl: Added new options which allow to show
	  only personal messages (or MUC highlights) and allow not to show
	  status changes (thanks to Konstantin Khomoutov).


Modified: trunk/tkabber-plugins/ChangeLog
===================================================================
--- trunk/tkabber-plugins/ChangeLog	2007-10-10 16:28:16 UTC (rev 1265)
+++ trunk/tkabber-plugins/ChangeLog	2007-10-10 16:28:45 UTC (rev 1266)
@@ -1,3 +1,9 @@
+2007-10-10  Sergei Golovan <sgolovan at nes.ru>
+
+	* floatinglog/floatinglog.tcl: Added new options which allow to show
+	  only personal messages (or MUC highlights) and allow not to show
+	  status changes (thanks to Konstantin Khomoutov).
+
 2007-10-07  Sergei Golovan <sgolovan at nes.ru>
 
 	* floatinglog/floatinglog.tcl: Fixed doubleclick bindings to JIDs

Modified: trunk/tkabber-plugins/floatinglog/floatinglog.tcl
===================================================================
--- trunk/tkabber-plugins/floatinglog/floatinglog.tcl	2007-10-10 16:28:16 UTC (rev 1265)
+++ trunk/tkabber-plugins/floatinglog/floatinglog.tcl	2007-10-10 16:28:45 UTC (rev 1266)
@@ -42,6 +42,15 @@
 	[::msgcat::mc "Show other messages."] \
 	-type boolean -group {Floating Log Control}
 
+    custom::defvar options(show_only_personal) 0 \
+	[::msgcat::mc "Show only personal messages and MUC highlights."] \
+	-type boolean -group {Floating Log Control}
+
+    custom::defvar options(show_notifications) 1 \
+	[::msgcat::mc "Show notifications (presence state changes,\
+	    chat state events, IQ queries etc)."] \
+	-type boolean -group {Floating Log Control}
+
     custom::defvar options(show_when_tkabber_is_active) 0 \
 	[::msgcat::mc "Show when Tkabber is active."] \
 	-type boolean -group {Floating Log Control}
@@ -284,7 +293,10 @@
 
 proc floatinglog::process_status {text} {
     variable idlestring
+    variable options
 
+    if {!$options(show_notifications)} return
+
     if {[string first $idlestring $text] != -1} return
     add_text $text
 }
@@ -318,6 +330,16 @@
 	    groupchat { 
 		if {!$options(show_groupchat)} return
 		if {[is_delayed $x]} return
+		if {![catch {
+		    ::plugins::mucignore::is_ignored $connid $from $type
+		} ignore] && $ignore != ""} return
+		if {$options(show_only_personal)} {
+		    set chatid [chat::chatid $connid \
+			[node_and_server_from_jid $from]]
+		    set myjid [chat::our_jid $chatid]
+		    set mynick [chat::get_nick $connid $myjid $type]
+		    if {![check_message $mynick $body]} return
+		}
 	    }
 	    default {
 		if {!$options(show_other_messages)} return
@@ -361,3 +383,4 @@
 hook::add finload_hook \
 	  [namespace current]::floatinglog::window_initialization 200
 
+# vim:ts=8:sw=4:sts=4:noet



More information about the Tkabber-dev mailing list