[Tkabber-dev] r526 - branches/plugins-0.11.1/juick

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Sat Sep 8 02:35:05 MSK 2012


Author: Totktonada
Date: 2012-09-08 02:35:05 +0400 (Sat, 08 Sep 2012)
New Revision: 526

Modified:
   branches/plugins-0.11.1/juick/juick.tcl
Log:
Juick plugin (tkabber-0.11.1 branch):
* Fix bug with thread subscribe from JuBo chat.
* Add thread unsubscribe command to context chat menu.


Modified: branches/plugins-0.11.1/juick/juick.tcl
===================================================================
--- branches/plugins-0.11.1/juick/juick.tcl	2012-09-07 22:34:10 UTC (rev 525)
+++ branches/plugins-0.11.1/juick/juick.tcl	2012-09-07 22:35:05 UTC (rev 526)
@@ -378,7 +378,6 @@
     set ci [chat::input_win $chatid]
     set jid [::xmpp::jid::removeResource [chat::get_jid $chatid]]
 
-
     set tags [$cw tag names "@$x,$y"]
 
     if {[set idx [lsearch -glob $tags JUICK-*]] >= 0} {
@@ -426,23 +425,33 @@
     if {[regexp {#\d+$} $thing]} {
         $m add command -label [::msgcat::mc \
             "\[J\] Subscribe to $thing replies."] \
-            -command [list [namespace current]::subscribe_to \
-            $chatwin $thing]
+            -command [list [namespace current]::send_to_juick \
+            $chatwin "S $thing"]
 
         $m add command -label [::msgcat::mc \
+            "\[J\] Unsubscribe from $thing replies."] \
+            -command [list [namespace current]::send_to_juick \
+            $chatwin "U $thing"]
+
+        $m add command -label [::msgcat::mc \
             "\[J\] Open thread in new tab."] \
             -command [list [namespace current]::get_juick_thread \
             $chatwin $thing]
     }
 }
 
-proc subscribe_to {w thing} {
+proc send_to_juick {w body} {
+    variable options
     set cw [join [lrange [split $w .] 0 end-1] .]
     set chatid [chat::winid_to_chatid $cw]
     set xlib [chat::get_xlib $chatid]
     set jid [chat::get_jid $chatid]
-    set body "S $thing"
 
+    if {![is_juick_jid $jid]} {
+        set mainchat [chat::chatid $xlib $options(main_jid)]
+        set jid [chat::get_jid $mainchat]
+    }
+
     message::send_msg $xlib $jid -type chat -body $body
 }
 



More information about the Tkabber-dev mailing list