mirror of
https://git.exozy.me/a/fuwuqi.git
synced 2024-11-22 06:11:03 +00:00
Implement S2S processing for unfollows
This commit is contained in:
parent
c9102fab30
commit
76d293317c
2 changed files with 5 additions and 1 deletions
|
@ -37,7 +37,7 @@ Enjoy your new "extremely hardcore" ActivityPub server!!! 🎉😎🚀🙃🥳
|
||||||
|
|
||||||
Since Fuwuqi's code is super duper easy to read and extend, the following features are left as an exercise to the reader:
|
Since Fuwuqi's code is super duper easy to read and extend, the following features are left as an exercise to the reader:
|
||||||
- Multi-user support (hint: dynamically generate `.well-known/webfinger` instead of serving a static file)
|
- Multi-user support (hint: dynamically generate `.well-known/webfinger` instead of serving a static file)
|
||||||
- S2S server-side processing for likes and announces
|
- S2S processing for likes and announces
|
||||||
- Deleting posts
|
- Deleting posts
|
||||||
- JSON-LD (hint: don't do it, your brain will thank you)
|
- JSON-LD (hint: don't do it, your brain will thank you)
|
||||||
- Lots of pain
|
- Lots of pain
|
||||||
|
|
|
@ -98,6 +98,10 @@ class fuwuqi(SimpleHTTPRequestHandler):
|
||||||
if activity['type'] == 'Accept' and activity['actor'] == activity['object']['object']:
|
if activity['type'] == 'Accept' and activity['actor'] == activity['object']['object']:
|
||||||
# Follow request accepted
|
# Follow request accepted
|
||||||
collection_append(username, 'following', activity['actor'])
|
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'):
|
elif self.path.endswith('outbox'):
|
||||||
# C2S
|
# C2S
|
||||||
collection_append(username, 'outbox', activity)
|
collection_append(username, 'outbox', activity)
|
||||||
|
|
Loading…
Reference in a new issue