| 1 |
|
| 2 |
|
| 3 |
module Plugin::MastodonSseStreaming::Handler |
| 4 |
class Reblog |
| 5 |
|
| 6 |
ひとつにつき一度呼ばれる |
| 7 |
たユーザ |
| 8 |
たToot |
| 9 |
def initialize(connection_type, &receiver) |
| 10 |
@connection_type = connection_type |
| 11 |
@receiver = receiver |
| 12 |
end |
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
def call(event, payload) |
| 17 |
return if event != 'notification' |
| 18 |
case payload |
| 19 |
in type: 'reblog', account: Hash => account, status: Hash => status |
| 20 |
@receiver.(Plugin::Mastodon::Account.new(account), |
| 21 |
Plugin::Mastodon::Status.build(@connection_type.server, status)) |
| 22 |
else |
| 23 |
|
| 24 |
end |
| 25 |
end |
| 26 |
end |
| 27 |
end |