diff options
author | ThibG <thib@sitedethib.com> | 2018-08-17 16:24:56 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2018-08-17 16:24:56 +0200 |
commit | 59f7f4c923494bb8dd6f2881a1610c7b51240d9c (patch) | |
tree | 9f01be5d65a9cdecfb92a7276e462bd6ab6db8e2 /app/models | |
parent | 1ee675d68bfd2034183a03408a2377c338dfac41 (diff) |
Implement Undo { Accept { Follow } } (fixes #8234) (#8245)
* Add Follow#revoke_request! * Implement Undo { Accept { Follow } } (fixes #8234)
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/follow.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/follow.rb b/app/models/follow.rb index 3fce14b9a..714f4e898 100644 --- a/app/models/follow.rb +++ b/app/models/follow.rb @@ -32,6 +32,11 @@ class Follow < ApplicationRecord false # Force uri_for to use uri attribute end + def revoke_request! + FollowRequest.create!(account: account, target_account: target_account, show_reblogs: show_reblogs, uri: uri) + destroy! + end + before_validation :set_uri, only: :create after_destroy :remove_endorsements |