Adds favorit handling
This commit is contained in:
parent
27b9326dd9
commit
a664ad3328
10 changed files with 59 additions and 8 deletions
|
@ -1,7 +1,8 @@
|
|||
''' bring activitypub functions into the namespace '''
|
||||
from .actor import get_actor
|
||||
from .collection import get_outbox, get_outbox_page, get_add, get_remove, \
|
||||
get_following, get_followers
|
||||
get_following, get_followers
|
||||
from .create import get_create
|
||||
from .follow import get_follow_request, get_unfollow, get_accept
|
||||
from .status import get_review, get_review_article, get_status, get_replies
|
||||
from .status import get_review, get_review_article, get_status, get_replies, \
|
||||
get_favorite
|
||||
|
|
|
@ -71,3 +71,14 @@ def get_replies(status, replies):
|
|||
'items': [get_status(r) for r in replies]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
def get_favorite(favorite):
|
||||
''' like a post '''
|
||||
return {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"id": favorite.absolute_id,
|
||||
"type": "Like",
|
||||
"actor": favorite.user.actor,
|
||||
"object": favorite.status.absolute_id,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue