プロジェクト

全般

プロフィール

バグ #1243 » fixed-open_link-entity-score.patch

ncaq エヌユル, 2018-05-14 14:05

差分を表示:

core/plugin/command/command.rb
command(:open_link,
name: _('リンクを開く'),
condition: Plugin::Command[:HasOneMessage] & lambda{ |opt|
opt.messages[0].entity.to_a.any? {|u| [:urls, :media].include?(u[:slug]) } },
!Plugin[:"score"].score_of(opt.messages[0]).map(&:uri).compact.empty? },
visible: true,
role: :timeline) do |opt|
opt.messages[0].entity.to_a.each {|u|
url =
case u[:slug]
when :urls
u[:expanded_url] || u[:url]
when :media
u[:media_url]
end
::Gtk::TimeLine.openurl(url) if url } end
Plugin[:"score"].score_of(opt.messages[0]).map(&:uri).compact.each {|uri|
::Gtk::TimeLine.openurl(uri.to_s) } end
command(:copy_link,
name: _('リンクをコピー'),
    (1-1/1)