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

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Tue Apr 14 01:56:05 MSD 2009


Author: bigote
Date: 2009-04-14 01:56:04 +0400 (Tue, 14 Apr 2009)
New Revision: 217

Added:
   trunk/plugins/bldjid/THANKS
Modified:
   trunk/plugins/bldjid/ChangeLog
   trunk/plugins/bldjid/bldjid.tcl
Log:
Fixed a bug that gave error when processing nicks like "{", "}" and "{%}".
Thanks to Alexey Smirnov.


Modified: trunk/plugins/bldjid/ChangeLog
===================================================================
--- trunk/plugins/bldjid/ChangeLog	2009-04-11 13:00:20 UTC (rev 216)
+++ trunk/plugins/bldjid/ChangeLog	2009-04-13 21:56:04 UTC (rev 217)
@@ -1,3 +1,22 @@
+2009-04-13  Serge Yudin  <xmpp:bigote at jabber.ru> <mailto:bigote at gmail.com>
+
+--- Version 0.5.14 of the plugin.
+--- Files modified:
+    bldjid.tcl, ChangeLog.
+
+--- Files added:
+	THANKS.
+
+--- Changes:
+	Fixed a bug that gave error when processing nicks like "{", "}" and "{%}".
+	Thanks to Alexey Smirnov.
+
+--- Known problem:
+	If you close a room window while the monitor window is still not closed
+	by timeout, the next time you open this room and invoke the monitor again,
+	its timeout will be shorter. It can be fixed by setting a new timeout
+	in Customize.
+
 2009-04-11  Serge Yudin  <xmpp:bigote at jabber.ru> <mailto:bigote at gmail.com>
 
 --- Version 0.5.13 of the plugin.

Added: trunk/plugins/bldjid/THANKS
===================================================================
--- trunk/plugins/bldjid/THANKS	                        (rev 0)
+++ trunk/plugins/bldjid/THANKS	2009-04-13 21:56:04 UTC (rev 217)
@@ -0,0 +1,5 @@
+Thanks to:
+Alexey Smirnov <alexey.smirnov at gmx.com> for active testing, good ideas and useful code.
+Konstantin Khomoutov <kostix at 007spb.ru> for clever tcl suggestions and code.
+Rakhmanin Ruslan <rakhmaninr at gmail.com> for testing and suggestions.
+BrennendeR_Komet and all users of this plugin for testing, opinions and patience :)

Modified: trunk/plugins/bldjid/bldjid.tcl
===================================================================
--- trunk/plugins/bldjid/bldjid.tcl	2009-04-11 13:00:20 UTC (rev 216)
+++ trunk/plugins/bldjid/bldjid.tcl	2009-04-13 21:56:04 UTC (rev 217)
@@ -1,4 +1,4 @@
-# "Bldjid" plugin for Tkabber. 2009-04-11 v. 0.5.13
+# "Bldjid" plugin for Tkabber. 2009-04-13 v. 0.5.14
 # Written by Serge Yudin xmpp:bigote at jabber.ru
 # See README file for usage.
 
@@ -309,11 +309,11 @@
 			append header " Show all visits to the "
 			if {$room == ""} {
 				set room $group
-				if {!$options(redirect_output)} {
+#				if {!$options(redirect_output)} {
 					append header "current room:"
-				} else {
-					append header "room $room:"
-				}
+#				} else {
+#					append header "room $room:"
+#				}
 			} elseif {$options(matching_rules) == "exact"} {
 				append header "room $room:"
 			} else {
@@ -593,7 +593,7 @@
 }
 
 # Here we get our role and affiliation in a room.
-# Thanks to Konstantin Khomoutov (kostix at 007spb.ru)
+# Thanks to Konstantin Khomoutov <kostix at 007spb.ru>
 proc bldjid::whoami {xlib where} {
 	global grouproster
 	if {[muc::is_compatible $where]} {
@@ -677,25 +677,32 @@
 	}
 }
 
+### Thanks to Alexey Smirnov <alexey.smirnov at gmx.com>
+proc bldjid::extract_user {msg tsVar nickVar jidVar} {
+	upvar 1 $tsVar timestamp $nickVar nick $jidVar jid
+
+	set timestamp [lindex $msg 0]
+	set nick      [lindex $msg 1]
+	set jid       [lindex $msg 2]
+
+	return
+}
+
+### Thanks to Alexey Smirnov
 proc bldjid::format_msg {msg n} {
 	variable options
 	set sep $options(custom_separator)
-	set x 0
-	foreach item $msg {
-		if {$item == "" && $x == 0} {
-			set item " "
-		} elseif {$item == ""} {
-			set item " $sep *NO JID* "
-		} elseif {$x == 0} {
-			set item $item
-		} else {
-			set item " $sep $item"
-		}
-		append newmsg $item
-		incr x
+
+	[namespace current]::extract_user $msg timestamp nick jid
+	if {$jid == ""} {
+		set jid "*NO JID*"
 	}
-	set NEWmsg [join [linsert $newmsg 0 "\n$n:\t"]]
-	return $NEWmsg
+	if {[llength $msg] == 3} {
+		set myroom ""
+	} else {
+		set myroom " $sep [lindex $msg 3]"
+	}
+		return "\n$n:\t$timestamp $sep $nick $sep $jid$myroom"
 }
 
 proc bldjid::prepare_user_list {grpjds nick} {



More information about the Tkabber-dev mailing list