about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-09-02 20:44:41 +0200
committerGitHub <noreply@github.com>2017-09-02 20:44:41 +0200
commitd3b67461735f9a1c38a7eee655a8131bcf6a0cbf (patch)
tree3228ad4c8a815867c0ddd6e4f2806686636d2292 /app/lib
parent2a5d1d5a1b2a3c152f2deadac3308f655b6e96be (diff)
Make "unfollow" undo pending outgoing follow request too (#4781)
* Make "unfollow" undo pending outgoing follow request too

* Add cancel button to web UI when awaiting follow request approval

* Make the hourglass button do the cancelling
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/activitypub/activity/undo.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/lib/activitypub/activity/undo.rb b/app/lib/activitypub/activity/undo.rb
index 097b1dba4..4b0905de2 100644
--- a/app/lib/activitypub/activity/undo.rb
+++ b/app/lib/activitypub/activity/undo.rb
@@ -33,6 +33,8 @@ class ActivityPub::Activity::Undo < ActivityPub::Activity
 
     if @account.following?(target_account)
       @account.unfollow!(target_account)
+    elsif @account.requested?(target_account)
+      FollowRequest.find_by(account: @account, target_account: target_account)&.destroy
     else
       delete_later!(object_uri)
     end