mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-11-15 11:14:28 +00:00
Fix unfollow
This commit is contained in:
parent
20a40ee344
commit
5ad4d81735
1 changed files with 4 additions and 11 deletions
|
@ -156,26 +156,19 @@ class MicroblogPubBackend(Backend):
|
||||||
|
|
||||||
@ensure_it_is_me
|
@ensure_it_is_me
|
||||||
def new_follower(self, as_actor: ap.Person, follow: ap.Follow) -> None:
|
def new_follower(self, as_actor: ap.Person, follow: ap.Follow) -> None:
|
||||||
remote_actor = follow.get_actor().id
|
pass
|
||||||
|
|
||||||
if DB.followers.find({"remote_actor": remote_actor}).count() == 0:
|
|
||||||
DB.followers.insert_one({"remote_actor": remote_actor})
|
|
||||||
|
|
||||||
@ensure_it_is_me
|
@ensure_it_is_me
|
||||||
def undo_new_follower(self, as_actor: ap.Person, follow: ap.Follow) -> None:
|
def undo_new_follower(self, as_actor: ap.Person, follow: ap.Follow) -> None:
|
||||||
# TODO(tsileo): update the follow to set undo
|
DB.activities.update_one({"remote_id": follow.id}, {"$set": {"meta.undo": True}})
|
||||||
DB.followers.delete_one({"remote_actor": follow.get_actor().id})
|
|
||||||
|
|
||||||
@ensure_it_is_me
|
@ensure_it_is_me
|
||||||
def undo_new_following(self, as_actor: ap.Person, follow: ap.Follow) -> None:
|
def undo_new_following(self, as_actor: ap.Person, follow: ap.Follow) -> None:
|
||||||
# TODO(tsileo): update the follow to set undo
|
DB.activities.update_one({"remote_id": follow.id}, {"$set": {"meta.undo": True}})
|
||||||
DB.following.delete_one({"remote_actor": follow.get_object().id})
|
|
||||||
|
|
||||||
@ensure_it_is_me
|
@ensure_it_is_me
|
||||||
def new_following(self, as_actor: ap.Person, follow: ap.Follow) -> None:
|
def new_following(self, as_actor: ap.Person, follow: ap.Follow) -> None:
|
||||||
remote_actor = follow.get_object().id
|
pass
|
||||||
if DB.following.find({"remote_actor": remote_actor}).count() == 0:
|
|
||||||
DB.following.insert_one({"remote_actor": remote_actor})
|
|
||||||
|
|
||||||
@ensure_it_is_me
|
@ensure_it_is_me
|
||||||
def inbox_like(self, as_actor: ap.Person, like: ap.Like) -> None:
|
def inbox_like(self, as_actor: ap.Person, like: ap.Like) -> None:
|
||||||
|
|
Loading…
Reference in a new issue