Follow/unfollow behavior

Fixes #23
This commit is contained in:
Mouse Reeve
2020-02-18 22:44:13 -08:00
parent 14d300162d
commit 95bfb61cf3
10 changed files with 138 additions and 102 deletions

View File

@ -16,6 +16,21 @@ def get_follow_request(user, to_follow):
'object': to_follow.actor,
}
def get_unfollow(relationship):
''' undo that precious bond of friendship '''
return {
'@context': 'https://www.w3.org/ns/activitystreams',
'id': '%s/undo' % relationship.absolute_id,
'type': 'Undo',
'actor': relationship.user_subject.actor,
'object': {
'id': relationship.relationship_id,
'type': 'Follow',
'actor': relationship.user_subject.actor,
'object': relationship.user_object.actor,
}
}
def get_accept(user, request_activity):
''' accept a follow request '''