Handle delete Salmons, todo: clean up timelines
This commit is contained in:
parent
1022d682dc
commit
a289c1d52f
4 changed files with 115 additions and 1 deletions
|
@ -32,6 +32,8 @@ class ProcessInteractionService < BaseService
|
|||
add_post!(body, account) if mentions_account?(xml, target_account)
|
||||
when :share
|
||||
add_post!(body, account) unless status(xml).nil?
|
||||
when :delete
|
||||
delete_post!(xml, account)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -62,6 +64,16 @@ class ProcessInteractionService < BaseService
|
|||
account.unfollow!(target_account)
|
||||
end
|
||||
|
||||
def delete_post!(xml, account)
|
||||
status = Status.find(activity_id(xml))
|
||||
|
||||
return if status.nil?
|
||||
|
||||
if account.id == status.account_id
|
||||
RemoveStatusService.new.(status)
|
||||
end
|
||||
end
|
||||
|
||||
def favourite!(xml, from_account)
|
||||
current_status = status(xml)
|
||||
current_status.favourites.where(account: from_account).first_or_create!(account: from_account)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue