[Tkabber-dev] r1937 - in trunk/tkabber: . plugins/general

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Tue May 25 16:18:33 MSD 2010


Author: sergei
Date: 2010-05-25 16:18:32 +0400 (Tue, 25 May 2010)
New Revision: 1937

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/plugins/general/remote.tcl
   trunk/tkabber/presence.tcl
Log:
	* plugins/general/remote.tcl: Do not store service messages (with an
	  empty JID) for forwarding.

	* presence.tcl: Use the own nickname as a resource part of JID where
	  to send custom presence if it is to be sent into a MUC room
	  (closes: http://yo.jabber.ru/bugzilla/show_bug.cgi?id=397).


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2010-05-17 14:46:44 UTC (rev 1936)
+++ trunk/tkabber/ChangeLog	2010-05-25 12:18:32 UTC (rev 1937)
@@ -1,3 +1,12 @@
+2010-05-25  Sergei Golovan  <sgolovan at nes.ru>
+
+	* plugins/general/remote.tcl: Do not store service messages (with an
+	  empty JID) for forwarding.
+
+	* presence.tcl: Use the own nickname as a resource part of JID where
+	  to send custom presence if it is to be sent into a MUC room
+	  (closes: http://yo.jabber.ru/bugzilla/show_bug.cgi?id=397).
+
 2010-05-17  Sergei Golovan  <sgolovan at nes.ru>
 
 	* plugins/richtext/emoticons.tcl: Started optimizing emoticons matching

Modified: trunk/tkabber/plugins/general/remote.tcl
===================================================================
--- trunk/tkabber/plugins/general/remote.tcl	2010-05-17 14:46:44 UTC (rev 1936)
+++ trunk/tkabber/plugins/general/remote.tcl	2010-05-25 12:18:32 UTC (rev 1937)
@@ -838,6 +838,11 @@
     if {![lcontain {chat groupchat} $type]} return
 #    if {![cequal chat $type]} return
 
+    if {$from == ""} {
+	# Don't forward service messages
+	return
+    }
+
     set date [clock seconds]
     set message [list $date $from $body $extras]
     set id [list $type $chatid]

Modified: trunk/tkabber/presence.tcl
===================================================================
--- trunk/tkabber/presence.tcl	2010-05-17 14:46:44 UTC (rev 1936)
+++ trunk/tkabber/presence.tcl	2010-05-25 12:18:32 UTC (rev 1937)
@@ -575,13 +575,17 @@
 ###############################################################################
 
 proc custom_presence_menu {m xlib jid} {
-    set chatid [chat::chatid $xlib [::xmpp::jid::stripResource $jid]]
-    set chatid1 [chat::chatid $xlib $jid]
+    set chatid [chat::chatid $xlib $jid]
+    set chatid1 [chat::chatid $xlib [::xmpp::jid::removeResource $jid]]
 
-    if {[chat::is_groupchat $chatid] && ![chat::is_groupchat $chatid1]} {
+    if {![chat::is_groupchat $chatid] && [chat::is_groupchat $chatid1]} {
 	return
     }
 
+    if {[chat::is_groupchat $chatid]} {
+	set jid [::xmpp::jid::replaceResource $jid [get_our_groupchat_nick $chatid]]
+    }
+
     set mm [menu $m.custom_presence -tearoff 0]
 
     $mm add command -label [::msgcat::mc "Available"] \



More information about the Tkabber-dev mailing list