[Tkabber-dev] r1806 - in trunk/tkabber: . plugins/chat

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Mon May 11 14:53:20 MSD 2009


Author: sergei
Date: 2009-05-11 14:53:20 +0400 (Mon, 11 May 2009)
New Revision: 1806

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/plugins/chat/me_command.tcl
Log:
	* plugins/chat/me_command.tcl: Treat any message starting with word /me
	  as a /me-command (not only '/me ', but also '/me,', '/me.' etc.).


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2009-05-11 07:38:00 UTC (rev 1805)
+++ trunk/tkabber/ChangeLog	2009-05-11 10:53:20 UTC (rev 1806)
@@ -3,6 +3,9 @@
 	* plugins/chat/chatstate.tcl: Fixed order of running bind scripts when
 	  <Delete> or <BackSpace> events are fired.
 
+	* plugins/chat/me_command.tcl: Treat any message starting with word /me
+	  as a /me-command (not only '/me ', but also '/me,', '/me.' etc.).
+
 2009-05-09  Sergei Golovan  <sgolovan at nes.ru>
 
 	* plugins/chat/events.tcl, plugins/chat/chatstate.tcl:: Fixed

Modified: trunk/tkabber/plugins/chat/me_command.tcl
===================================================================
--- trunk/tkabber/plugins/chat/me_command.tcl	2009-05-11 07:38:00 UTC (rev 1805)
+++ trunk/tkabber/plugins/chat/me_command.tcl	2009-05-11 10:53:20 UTC (rev 1806)
@@ -1,8 +1,8 @@
 # $Id$
 
 proc handle_me {chatid from type body x} {
-    if {[cequal [crange $body 0 3] "/me "] || [cequal $body "/me"]} {
-	set body [crange $body 4 end]
+    if {[regexp {^/me\M} $body]} {
+	set body [string range $body 3 end]
 
 	if {[chat::is_our_jid $chatid $from]} {
 	    set tag me
@@ -15,12 +15,12 @@
 	set nick [chat::get_nick $xlib $from $type]
 	set cw [chat::winid $chatid]
 
-	$chatw insert end "* $nick" [list $tag NICK-$nick] " "
+	$chatw insert end "* $nick" [list $tag NICK-$nick]
 
 	$chatw mark set MSGLEFT "end - 1 char"
 	$chatw mark gravity MSGLEFT left
 
-	if {[cequal $type groupchat]} {
+	if {[string equal $type groupchat]} {
 	    set myjid [chat::our_jid $chatid]
 	    set mynick [chat::get_nick $xlib $myjid $type]
 



More information about the Tkabber-dev mailing list