[Tkabber-dev] r436 - trunk/plugins/juick

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Mon Nov 29 21:58:30 MSK 2010


Author: Totktonada
Date: 2010-11-29 21:58:30 +0300 (Mon, 29 Nov 2010)
New Revision: 436

Modified:
   trunk/plugins/juick/juick.tcl
Log:
Juick: add menu command for subscribe to thread

Modified: trunk/plugins/juick/juick.tcl
===================================================================
--- trunk/plugins/juick/juick.tcl	2010-11-10 20:48:06 UTC (rev 435)
+++ trunk/plugins/juick/juick.tcl	2010-11-29 18:58:30 UTC (rev 436)
@@ -103,8 +103,22 @@
           -command [list [namespace current]::copy_thing $chatwin $thing]
     $m add command -label [::msgcat::mc "\[J\] Open thing in browser."] \
           -command [list [namespace current]::browse_thing $chatwin $thing]
+    if {[regexp {#\d+$} $thing]} {
+        $m add command -label [::msgcat::mc "\[J\] Subscribe to $thing replies."] \
+              -command [list [namespace current]::subscribe_to $chatwin $thing]
+    }
 }
 
+proc subscribe_to {w thing} {
+     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"
+
+     message::send_msg $xlib $jid -type chat -body $body
+}
+
 proc copy_thing {w thing} {
     clipboard clear -displayof $w
     clipboard append -displayof $w $thing



More information about the Tkabber-dev mailing list