Skip to content

Instantly share code, notes, and snippets.

@cosmo0920
Created September 20, 2012 15:41
Show Gist options
  • Save cosmo0920/3756680 to your computer and use it in GitHub Desktop.
Save cosmo0920/3756680 to your computer and use it in GitHub Desktop.
nested_quote.rbのcommandが0.2で動かないorz
--- core/plugin/command/conditions.rb 2012-09-21 00:37:56.497075247 +0900
+++ core/plugin/command/conditions.rb.edited 2012-09-21 00:38:14.050407983 +0900
@@ -71,6 +71,11 @@
# TL上のテキストが一文字でも選択されている
TimelineTextSelected = Condition.new{ |opt| opt.widget.selected_text(opt.messages.first) }
+ #TL上のメッセージがシステムメッセージではない
+ NotSystem = Condition.new{ |opt|
+ not opt.messages.empty? { |m|
+ not m.messages.system? } }
+
# ==== postbox ロール
# 編集可能状態(入力中:グレーアウトしてない時)
--- nested_quote.rb 2012-05-29 23:52:22.103404176 +0900
+++ nested_quote_0_2.rb 2012-09-21 00:36:20.000000000 +0900
@@ -177,18 +177,11 @@
end
Plugin.create :nested_quote do
- filter_command do |menu|
- menu[:copy_tweet_url] = {
- :slug => :copy_tweet_url,
- :name => 'ツイートのURLをコピー',
- :condition => lambda{ |m| !m.message.system? },
- :exec => lambda{ |m|
- Gtk::Clipboard.copy("https://twitter.com/#!/#{m.message.user[:idname]}/statuses/#{m.message[:id]}")
- },
- :visible => true,
- :role => :message }
- [menu]
+ command(:copy_tweet_url,
+ name: 'ツイートのURLをコピー',
+ condition: Plugin::Command[:NotSystem],
+ visible: true,
+ role: :timeline) do |opt|
+ Gtk::Clipboard.copy("https://twitter.com/#!/#{opt.messages.user[:idname]}/statuses/#{opt.messages[:id]}")
end
-
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment