Project

General

Profile

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

ncaq net, 2018-05-14 14:05

View differences:

core/plugin/command/command.rb
170 170
  command(:open_link,
171 171
          name: _('リンクを開く'),
172 172
          condition: Plugin::Command[:HasOneMessage] & lambda{ |opt|
173
            opt.messages[0].entity.to_a.any? {|u| [:urls, :media].include?(u[:slug]) } },
173
            !Plugin[:"score"].score_of(opt.messages[0]).map(&:uri).compact.empty? },
174 174
          visible: true,
175 175
          role: :timeline) do |opt|
176
    opt.messages[0].entity.to_a.each {|u|
177
      url =
178
        case u[:slug]
179
        when :urls
180
          u[:expanded_url] || u[:url]
181
        when :media
182
          u[:media_url]
183
        end
184
      ::Gtk::TimeLine.openurl(url) if url } end
176
    Plugin[:"score"].score_of(opt.messages[0]).map(&:uri).compact.each {|uri|
177
      ::Gtk::TimeLine.openurl(uri.to_s) } end
185 178

  
186 179
  command(:copy_link,
187 180
          name: _('リンクをコピー'),
    (1-1/1)