[Tkabber-dev] r1172 - in trunk/tkabber: . ifacetk plugins/pep

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Sun Aug 5 18:17:46 MSD 2007


Author: sergei
Date: 2007-08-05 18:17:45 +0400 (Sun, 05 Aug 2007)
New Revision: 1172

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/ifacetk/iroster.tcl
   trunk/tkabber/plugins/pep/user_mood.tcl
Log:
	* ifacetk/iroster.tcl: Fixed cascaded roster item submenus in case of
	  multiple contact resources connected.

	* plugins/pep/user_mood.tcl: Use JIDs without resource for sending
	  user mood subscription/unsubscription stanzas via roster item menu.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2007-08-03 13:32:48 UTC (rev 1171)
+++ trunk/tkabber/ChangeLog	2007-08-05 14:17:45 UTC (rev 1172)
@@ -1,3 +1,11 @@
+2007-08-05  Sergei Golovan  <sgolovan at nes.ru>
+
+	* ifacetk/iroster.tcl: Fixed cascaded roster item submenus in case of
+	  multiple contact resources connected.
+
+	* plugins/pep/user_mood.tcl: Use JIDs without resource for sending
+	  user mood subscription/unsubscription stanzas via roster item menu.
+
 2007-08-03  Sergei Golovan  <sgolovan at nes.ru>
 
 	* pep.tcl: Fixed customization of menu tearoffs.

Modified: trunk/tkabber/ifacetk/iroster.tcl
===================================================================
--- trunk/tkabber/ifacetk/iroster.tcl	2007-08-03 13:32:48 UTC (rev 1171)
+++ trunk/tkabber/ifacetk/iroster.tcl	2007-08-05 14:17:45 UTC (rev 1172)
@@ -1515,7 +1515,8 @@
 	    $m add separator
 	} elseif {![catch { $m1 entrycget $i -menu } menu]} {
 	    set suffix2 [join [lrange [split $menu .] 2 end] .]
-	    set m2 [menu $m.$suffix2 -tearoff 0]
+	    set suffix3 [lindex [split $menu .] end]
+	    set m2 [menu $m.$suffix3 -tearoff 0]
 	    $m add cascad -label $label -menu $m2
 	    add_menu_submenu $m2 $prefix .$suffix2 $jids
 	} elseif {![catch { $m1 entrycget $i -variable } var]} {

Modified: trunk/tkabber/plugins/pep/user_mood.tcl
===================================================================
--- trunk/tkabber/plugins/pep/user_mood.tcl	2007-08-03 13:32:48 UTC (rev 1171)
+++ trunk/tkabber/plugins/pep/user_mood.tcl	2007-08-05 14:17:45 UTC (rev 1172)
@@ -94,20 +94,26 @@
 }
 
 proc mood::add_roster_pep_menu_item {m connid jid} {
-    set pm [pep::get_roster_menu_pep_submenu $m $connid $jid]
+    set rjid [roster::find_jid $connid $jid]
 
+    if {$rjid == ""} {
+ 	set rjid [node_and_server_from_jid $jid]
+    }
+
+    set pm [pep::get_roster_menu_pep_submenu $m $connid $rjid]
+
     set mm [menu $pm.mood -tearoff no]
     $pm add cascade -menu $mm \
 	    -label [::msgcat::mc "User mood"]
 
     $mm add command \
 	    -label [::msgcat::mc "Subscribe"] \
-	    -command [list [namespace current]::subscribe $connid $jid]
+	    -command [list [namespace current]::subscribe $connid $rjid]
     $mm add command \
 	    -label [::msgcat::mc "Unsubscribe"] \
-	    -command [list [namespace current]::unsubscribe $connid $jid]
+	    -command [list [namespace current]::unsubscribe $connid $rjid]
 
-    hook::run roster_pep_user_mood_menu_hook $mm $connid $jid
+    hook::run roster_pep_user_mood_menu_hook $mm $connid $rjid
 }
 
 proc mood::subscribe {connid jid args} {



More information about the Tkabber-dev mailing list