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

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Sun Feb 21 09:07:09 MSK 2010


Author: bigote
Date: 2010-02-21 09:07:09 +0300 (Sun, 21 Feb 2010)
New Revision: 304

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 a possibility for exact search by commands /inbanlist and /inmemberlist (just set options(matching_rules) to Exact).
A small bug fixed in processing /visited command when Exact matching rules are set.


Modified: trunk/plugins/bldjid/ChangeLog
===================================================================
--- trunk/plugins/bldjid/ChangeLog	2010-02-21 02:56:17 UTC (rev 303)
+++ trunk/plugins/bldjid/ChangeLog	2010-02-21 06:07:09 UTC (rev 304)
@@ -1,5 +1,18 @@
 2010-02-21  Serge Yudin  <xmpp:bigote at jabber.ru> <mailto:bigote at gmail.com>
 
+--- Version 0.9.3 of the plugin.
+
+--- Files modified:
+    bldjid.tcl, README, README.ru, ChangeLog, msgs/ru.msg.
+
+--- Changes:
+	Added a possibility for exact search by commands /inbanlist
+	and /inmemberlist (just set options(matching_rules) to Exact).
+	A small bug fixed in processing /visited command
+	when Exact matching rules are set.
+
+2010-02-21  Serge Yudin  <xmpp:bigote at jabber.ru> <mailto:bigote at gmail.com>
+
 --- Version 0.9.2 of the plugin.
 
 --- Files modified:

Modified: trunk/plugins/bldjid/README
===================================================================
--- trunk/plugins/bldjid/README	2010-02-21 02:56:17 UTC (rev 303)
+++ trunk/plugins/bldjid/README	2010-02-21 06:07:09 UTC (rev 304)
@@ -29,6 +29,10 @@
 	of the current room using the following commands:
 /inbanlist pattern
 /inmemberlist pattern
+	These searches are affected by the options(matching_rules), so for example
+	if you want to know if some Jabber server is banned entirely just set
+	this option to Exact and search for an exact server's name, otherwise
+	you could receive a lot of output if many users from this server were banned.
 
 New commands added that could be helpful
 when ::muc::options(gen_enter_exit_msgs) is disabled.

Modified: trunk/plugins/bldjid/README.ru
===================================================================
--- trunk/plugins/bldjid/README.ru	2010-02-21 02:56:17 UTC (rev 303)
+++ trunk/plugins/bldjid/README.ru	2010-02-21 06:07:09 UTC (rev 304)
@@ -32,6 +32,11 @@
 	текущей комнаты с помощью следующих команд:
 /inbanlist pattern
 /inmemberlist pattern
+	На поиск в этих списках влияет состояние опции options(matching_rules).
+	Например, вы хотите узнать, забанен ли некий Jabber-сервер.
+	Включите у этой настройки "Точное совпадение" и введите для поиска
+	точное имя сервера, иначе вы можете получить слишком много результатов,
+	если забанено очень много пользователей с этого сервера.
 
 Добавлены новые команды, которые могут быть полезны,
 когда у вас выключена опция ::muc::options(gen_enter_exit_msgs).

Modified: trunk/plugins/bldjid/bldjid.tcl
===================================================================
--- trunk/plugins/bldjid/bldjid.tcl	2010-02-21 02:56:17 UTC (rev 303)
+++ trunk/plugins/bldjid/bldjid.tcl	2010-02-21 06:07:09 UTC (rev 304)
@@ -1,4 +1,4 @@
-# "Bldjid" plugin for Tkabber. 2010-02-21 v. 0.9.2
+# "Bldjid" plugin for Tkabber. 2010-02-21 v. 0.9.3
 # Written by Serge Yudin xmpp:bigote at jabber.ru
 # See README or README.ru file for usage.
 
@@ -445,6 +445,7 @@
 }
 
 proc bldjid::receive_search_list {attr val chatid test_jid res child} {
+	variable options
 	set xlib [chat::get_xlib $chatid]
 	set group [chat::get_jid $chatid]
 	if {![string equal $res ok]} {
@@ -459,7 +460,18 @@
 		return
 	}
 	set found 0
-	set header [::msgcat::mc "JIDs that match your search pattern '%s' in %s list of this room:" $test_jid $val]
+	switch -- $options(matching_rules) {
+		loose {
+			set header [::msgcat::mc \
+			"JIDs that match your search pattern '%s' in %s list of this room:" \
+			$test_jid $val]
+		}
+		exact {
+			set header [::msgcat::mc \
+			"Search for JID '%s' in %s list of this room:" \
+			$test_jid $val]
+		}
+	}
 	set msg ""
 	foreach item $items {
 		::xmpp::xml::split $item tag xmlns attrs cdata subels
@@ -468,9 +480,20 @@
 				set jid [::xmpp::xml::getAttr $attrs jid]
 			}
 		}
-		if {[string match *$test_jid* $jid]} {
-			lappend msg "\n$jid"
-			set found 1
+		switch -- $options(matching_rules) {
+			loose {
+				if {[string match *$test_jid* $jid]} {
+					lappend msg "\n$jid"
+					set found 1
+				}
+			}
+			exact {
+				if {[string equal $test_jid $jid]} {
+					lappend msg "\n$jid"
+					set found 1
+					break
+				}
+			}
 		}
 	}
 	if {!$found} {
@@ -721,6 +744,7 @@
 			[::msgcat::mc "Parameters expected. Type /bldhelp for usage examples."] {}
 			return stop
 		} elseif {$room == ""} {
+			set groupjids ""
 			if {$options(matching_rules) == "exact"} {
 				append header [::msgcat::mc "%s to all rooms:" $nick]
 			} else {
@@ -734,6 +758,8 @@
 					set groupjids [[namespace current]::valid_groups $xlib $which {}]
 				}
 			}
+#			if {![info exists groupjids]} {
+#			}
 			[namespace current]::prepare_user_list $groupjids $nick
 		} else {
 			if {$options(matching_rules) == "exact"} {

Modified: trunk/plugins/bldjid/msgs/ru.msg
===================================================================
--- trunk/plugins/bldjid/msgs/ru.msg	2010-02-21 02:56:17 UTC (rev 303)
+++ trunk/plugins/bldjid/msgs/ru.msg	2010-02-21 06:07:09 UTC (rev 304)
@@ -74,3 +74,5 @@
 ::msgcat::mcset ru "JIDs that match your search pattern '%s' in %s list of this room:" \
 "Джиды, подходящие к поисковому паттерну '%s' в списке %s этой комнаты:"
 ::msgcat::mcset ru "\nNo matches were found." "\nНе найдено ни одного подходящего джида."
+::msgcat::mcset ru "Search for JID '%s' in %s list of this room:" \
+"Поиск джида '%s' в списке %s этой комнаты:"



More information about the Tkabber-dev mailing list