File: score.rb

package info (click to toggle)
mikutter 5.1.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,780 kB
  • sloc: ruby: 22,912; sh: 186; makefile: 21
file content (13 lines) | stat: -rw-r--r-- 536 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
Plugin.create(:mastodon) do
  # model#scoreを持っている場合のscore_filter
  filter_score_filter do |model, note, yielder|
    next [model, note, yielder] unless model == note
    next [model, note, yielder] unless model.is_a?(Plugin::Mastodon::Status) || model.is_a?(Plugin::Mastodon::AccountProfile) || model.is_a?(Plugin::Mastodon::AccountField)

    if model.score.size > 1 || model.score.size == 1 && !model.score[0].is_a?(Plugin::Score::TextNote)
      yielder << model.score
    end
    [model, note, yielder]
  end
end