aboutsummaryrefslogtreecommitdiff
path: root/server.py
diff options
context:
space:
mode:
authorAnthony Wang2023-01-19 01:55:44 +0000
committerAnthony Wang2023-01-19 01:55:44 +0000
commit76d293317c97a81cbfe056b835e04b05c0d54852 (patch)
tree8a29cbaf7a571fad2ec0113008697820e4bb0ad3 /server.py
parentc9102fab30b7d9b24343d52429b1302bfffcf6e3 (diff)
Implement S2S processing for unfollows
Diffstat (limited to 'server.py')
-rw-r--r--server.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/server.py b/server.py
index a0f2395..3fe33ab 100644
--- a/server.py
+++ b/server.py
@@ -98,6 +98,10 @@ class fuwuqi(SimpleHTTPRequestHandler):
if activity['type'] == 'Accept' and activity['actor'] == activity['object']['object']:
# Follow request accepted
collection_append(username, 'following', activity['actor'])
+ elif activity['type'] == 'Undo' and activity['object']['type'] == 'Follow' and \
+ activity['actor'] == activity['object']['actor']:
+ # Unfollow request
+ collection_remove(username, 'followers', activity['actor'])
elif self.path.endswith('outbox'):
# C2S
collection_append(username, 'outbox', activity)