mirror of
https://git.bsd.gay/fef/nyastodon.git
synced 2024-12-24 19:23:41 +01:00
This commit is contained in:
parent
8902e265b4
commit
b87eb8ea14
2 changed files with 8 additions and 0 deletions
|
@ -10,6 +10,10 @@ class FavouriteService < BaseService
|
||||||
def call(account, status)
|
def call(account, status)
|
||||||
authorize_with account, status, :show?
|
authorize_with account, status, :show?
|
||||||
|
|
||||||
|
favourite = Favourite.find_by(account: account, status: status)
|
||||||
|
|
||||||
|
return favourite unless favourite.nil?
|
||||||
|
|
||||||
favourite = Favourite.create!(account: account, status: status)
|
favourite = Favourite.create!(account: account, status: status)
|
||||||
|
|
||||||
if status.local?
|
if status.local?
|
||||||
|
|
|
@ -13,6 +13,10 @@ class ReblogService < BaseService
|
||||||
|
|
||||||
authorize_with account, reblogged_status, :reblog?
|
authorize_with account, reblogged_status, :reblog?
|
||||||
|
|
||||||
|
reblog = account.statuses.find_by(reblog: reblogged_status)
|
||||||
|
|
||||||
|
return reblog unless reblog.nil?
|
||||||
|
|
||||||
reblog = account.statuses.create!(reblog: reblogged_status, text: '')
|
reblog = account.statuses.create!(reblog: reblogged_status, text: '')
|
||||||
|
|
||||||
DistributionWorker.perform_async(reblog.id)
|
DistributionWorker.perform_async(reblog.id)
|
||||||
|
|
Loading…
Reference in a new issue