[Tkabber-dev] r200 - trunk/plugins/bldjid

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Mon Apr 6 23:12:33 MSD 2009


Author: bigote
Date: 2009-04-06 23:12:32 +0400 (Mon, 06 Apr 2009)
New Revision: 200

Modified:
   trunk/plugins/bldjid/ChangeLog
   trunk/plugins/bldjid/README
   trunk/plugins/bldjid/bldjid.tcl
Log:
Changed JID adding rules for Minimum verbosity level.
Users with the same JID but different nicks will be logged
in different entries.

Added timestamp logging for Minimum verbosity level. It will not affect
JID adding rules but will be useful to distinguish users with different
JIDs and equal nicks that entered at different time.


Modified: trunk/plugins/bldjid/ChangeLog
===================================================================
--- trunk/plugins/bldjid/ChangeLog	2009-04-06 02:20:06 UTC (rev 199)
+++ trunk/plugins/bldjid/ChangeLog	2009-04-06 19:12:32 UTC (rev 200)
@@ -1,5 +1,22 @@
 2009-04-06  Serge Yudin  <xmpp:bigote at jabber.ru> <mailto:bigote at gmail.com>
 
+--- Version 0.5.5 of the plugin.
+--- Files modified:
+    bldjid.tcl, README, ChangeLog.
+
+--- Changes:
+	Changed JID adding rules for Minimum verbosity level.
+	Users with the same JID but different nicks will be logged
+	in different entries.
+	It is done so that to avoid situations when somebody enters a room
+	pretending to be another user, so you could ban a wrong person.
+
+	Added timestamp logging for Minimum verbosity level. It will not affect
+	JID adding rules but will be useful to distinguish users with different
+	JIDs and equal nicks that entered at different time.
+
+2009-04-06  Serge Yudin  <xmpp:bigote at jabber.ru> <mailto:bigote at gmail.com>
+
 --- Version 0.5.4 of the plugin.
 --- Files modified:
     bldjid.tcl, TODO, README, ChangeLog.

Modified: trunk/plugins/bldjid/README
===================================================================
--- trunk/plugins/bldjid/README	2009-04-06 02:20:06 UTC (rev 199)
+++ trunk/plugins/bldjid/README	2009-04-06 19:12:32 UTC (rev 200)
@@ -87,10 +87,12 @@
 	Bldjid still will gather logs for such rooms, it just won't display them.
 
 --- ::plugins::bldjid::options(verbosity_level)
-	Minimum level means that there will be no repeated JIDs
-	in each room list and no timestamps.
-	Maximum level means that every entrance	of every user
-	will be logged, with a corresponding timestamp.
+	Minimum level means that there will be no repeated JIDs in each room list.
+	However, if the same JID enters the same room with a different nick,
+	such entrance will be also logged.
+	Maximum level means that every entrance	of every user will be logged.
+	Timestamps will be added to every entry to keep it easier tracking
+	user entrances.
 
 --- ::plugins::bldjid::options(matching_rules)
 	"Exact" matching obliges you provide exact parameters for /visit* commands

Modified: trunk/plugins/bldjid/bldjid.tcl
===================================================================
--- trunk/plugins/bldjid/bldjid.tcl	2009-04-06 02:20:06 UTC (rev 199)
+++ trunk/plugins/bldjid/bldjid.tcl	2009-04-06 19:12:32 UTC (rev 200)
@@ -1,4 +1,4 @@
-# "Bldjid" plugin for Tkabber. 2009-04-06 v. 0.5.4
+# "Bldjid" plugin for Tkabber. 2009-04-06 v. 0.5.5
 # Written by Serge Yudin xmpp:bigote at jabber.ru
 # See README file for usage.
 
@@ -17,10 +17,8 @@
 # Set plugin options.
 		set verbosity [list \
 		min [::msgcat::mc "Minimum:\
-		Log each entrance of a user\
-		only once per room (less memory used)."]\
-		max [::msgcat::mc "Maximum: Also log timestamps\
-		(all entrances of each user will be logged)."]]
+		Log each entrance of a user only once per room (less memory used)."]\
+		max [::msgcat::mc "Maximum: All entrances of each user will be logged."]]
 
 		set matching_rules [list \
 		exact [::msgcat::mc "Exact match."]\
@@ -69,6 +67,7 @@
 ## Adapted to bldjid's necessities by Serge Yudin
 proc bldjid::smart_enter_exit_message {xlib jid type x args} {
 	global grouproster
+	global jids_by_chats
 	variable options
 	if {!$options(enabled)} {
 		return
@@ -90,21 +89,17 @@
 				return
 			}
 			set nick [::chat::get_nick $xlib $jid groupchat]
-			set ts ""
-			if {$options(verbosity_level) != "min"} {
-				set ts [clock format [clock seconds] \
-				-format $::plugins::options(timestamp_format)]
-			}
+			set ts [clock format [clock seconds] \
+			-format $::plugins::options(timestamp_format)]
 			set real_jid [::xmpp::jid::stripResource \
 				[::muc::get_real_jid $xlib $group/$nick]]
 
-			global jids_by_chats
 			if {[info exists jids_by_chats($group)]} {
 				if {$options(verbosity_level) == "min"} {
 					set tmp_user_list $jids_by_chats($group)
 					foreach item $tmp_user_list {
-						if {[lsearch -exact [lindex $item 2] $real_jid] >= 0} {
-							unset tmp_user_list
+						if {[lindex $item 2] == $real_jid
+						&&  [lindex $item 1] == $nick} {
 							return
 						}
 					}
@@ -294,7 +289,9 @@
 				set groupjids [[namespace current]::valid_groups $xlib $which $room]
 				foreach grp $groupjids {
 					foreach item $jids_by_chats($grp) {
-						lappend item $grp
+						if {![string match "*current room:" $header]} {
+							lappend item $grp
+						}
 						lappend user_list $item
 					}
 				}



More information about the Tkabber-dev mailing list