[Tkabber-dev] r322 - in trunk/plugins/bldjid: . msgs

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Wed Mar 24 04:05:27 MSK 2010


Author: bigote
Date: 2010-03-24 04:05:27 +0300 (Wed, 24 Mar 2010)
New Revision: 322

Modified:
   trunk/plugins/bldjid/ChangeLog
   trunk/plugins/bldjid/README
   trunk/plugins/bldjid/README.ru
   trunk/plugins/bldjid/bldjid.tcl
   trunk/plugins/bldjid/msgs/ru.msg
Log:
Added an option options(rooms2log) that allows to specify only necessary rooms that are to be logged.


Modified: trunk/plugins/bldjid/ChangeLog
===================================================================
--- trunk/plugins/bldjid/ChangeLog	2010-03-23 23:37:29 UTC (rev 321)
+++ trunk/plugins/bldjid/ChangeLog	2010-03-24 01:05:27 UTC (rev 322)
@@ -1,5 +1,16 @@
 2010-03-24  Serge Yudin  <xmpp:bigote at jabber.ru> <mailto:bigote at gmail.com>
 
+--- Version 0.9.8 of the plugin.
+
+--- Files modified:
+    bldjid.tcl, ChangeLog, README, README.ru, msgs/ru.msg.
+
+--- Changes:
+	Added an option options(rooms2log) that allows to specify
+	only necessary rooms that are to be logged.
+
+2010-03-24  Serge Yudin  <xmpp:bigote at jabber.ru> <mailto:bigote at gmail.com>
+
 --- Version 0.9.7.2 of the plugin.
 
 --- Files modified:

Modified: trunk/plugins/bldjid/README
===================================================================
--- trunk/plugins/bldjid/README	2010-03-23 23:37:29 UTC (rev 321)
+++ trunk/plugins/bldjid/README	2010-03-24 01:05:27 UTC (rev 322)
@@ -136,8 +136,14 @@
 Tkabber -> Customize -> Plugins -> Bldjid
 
 --- ::plugins::bldjid::options(enable_jids_gathering)
-	Turns on JIDs gathering.
+	Turns on JIDs gathering. Disabling it doesn't prevent
+	/bldjid-like commands to work.
 
+--- ::plugins::bldjid::options(rooms2log)
+	Default value is empty which means that all available MUCs
+	will be logged. If you only want to log certain rooms
+	you can specify their jids separated with spaces here.
+
 --- ::plugins::bldjid::options(log_file)
 	Bldjid log file. If empty, logs won't be saved to file.
 	It is useful if you want to recall who entered a certain room

Modified: trunk/plugins/bldjid/README.ru
===================================================================
--- trunk/plugins/bldjid/README.ru	2010-03-23 23:37:29 UTC (rev 321)
+++ trunk/plugins/bldjid/README.ru	2010-03-24 01:05:27 UTC (rev 322)
@@ -139,8 +139,15 @@
 Tkabber -> Customize -> Plugins -> Bldjid
 
 --- ::plugins::bldjid::options(enable_jids_gathering)
-	Включает сбор джидов посетителей.
+	Включает сбор джидов посетителей. Если его не включать,
+	команды типа /bldjid всё равно будут работать.
 
+--- ::plugins::bldjid::options(rooms2log)
+	Значение по умолчанию -- пустая строка, это значит, что логи будут вестись
+	во всех доступных комнатах MUC. Если вы хотите вести сбор джидов посетителей
+	только определённых комнат, вы можете указать здесь полные джиды этих комнат,
+	разделяя их пробелами.
+
 --- ::plugins::bldjid::options(log_file)
 	Путь к файлу логов Bldjid. Если установить в качестве значения
 	пустую строку, логи не будут сохраняться в файл.

Modified: trunk/plugins/bldjid/bldjid.tcl
===================================================================
--- trunk/plugins/bldjid/bldjid.tcl	2010-03-23 23:37:29 UTC (rev 321)
+++ trunk/plugins/bldjid/bldjid.tcl	2010-03-24 01:05:27 UTC (rev 322)
@@ -1,4 +1,4 @@
-# "Bldjid" plugin for Tkabber. 2010-03-24 v. 0.9.7.2
+# "Bldjid" plugin for Tkabber. 2010-03-24 v. 0.9.8
 # Written by Serge Yudin xmpp:bigote at jabber.ru
 # See README or README.ru file for usage.
 
@@ -36,6 +36,11 @@
 			Disabling it doesn't prevent /bldjid-like commands to work."] \
 			-type boolean -group Bldjid
 
+		custom::defvar options(rooms2log) "" \
+			[::msgcat::mc "A list of conferences (full jids separated with spaces)\
+			that should be logged. If empty, all rooms will be logged."] \
+			-type string -group Bldjid
+
 		custom::defvar options(log_file) [file join $::configdir bldjid.log] \
 			[::msgcat::mc "Bldjid log file. If empty, logs won't be saved to file."] \
 			-group Bldjid \
@@ -165,6 +170,9 @@
 		return
 	}
 	set group [::chat::get_jid $chatid]
+	if {$options(rooms2log) != "" && ![string match *$group* $options(rooms2log)]} {
+		return
+	}
 	if {[chat::is_groupchat $chatid]} {
 		set user_already_here [lcontain [::muc::roster $chatid] $nick]
 		if {!$user_already_here} {
@@ -676,12 +684,20 @@
 					set iam [whoami $xlib $tmpgrp]
 					if {($iam == "admin" || $iam == "owner") \
 						&& ![string match *%*@irc* $tmpgrp]} {
-						lappend grpjids $tmpgrp
+						if {$options(rooms2log) == ""} {
+							lappend grpjids $tmpgrp
+						} elseif {[string match *$tmpgrp* $options(rooms2log)]} {
+							lappend grpjids $tmpgrp
+						}
 					}
 				}
 
 				all {
-					lappend grpjids $tmpgrp
+					if {$options(rooms2log) == ""} {
+						lappend grpjids $tmpgrp
+					} elseif {[string match *$tmpgrp* $options(rooms2log)]} {
+						lappend grpjids $tmpgrp
+					}
 				}
 			}
 		}
@@ -1023,6 +1039,7 @@
 	} else {
 		return stop
 	}
+puts $grpjds
 	foreach grp $grpjds {
 		foreach item $a($grp) {
 			foreach key [array names p_list] {

Modified: trunk/plugins/bldjid/msgs/ru.msg
===================================================================
--- trunk/plugins/bldjid/msgs/ru.msg	2010-03-23 23:37:29 UTC (rev 321)
+++ trunk/plugins/bldjid/msgs/ru.msg	2010-03-24 01:05:27 UTC (rev 322)
@@ -82,3 +82,5 @@
 "Поиск джида '%s' в списке %s этой комнаты:"
 ::msgcat::mcset ru "Timeout for version requests (in seconds). See README for details." \
 "Тайм-аут для запроса версии (в секундах). Читайте описание опции в файле README.ru."
+::msgcat::mcset ru "A list of conferences (full jids separated with spaces) that should be logged. If empty, all rooms will be logged." \
+"Список конференций (полные джиды, разделённые пробелами), логи которых вы хотите вести. Если поле пустое, будут вестись логи всех конференций."



More information about the Tkabber-dev mailing list