Unfavorite statuses
This commit is contained in:
parent
e0bd8200ad
commit
7455467c40
10 changed files with 143 additions and 19 deletions
|
@ -5,4 +5,4 @@ from .collection import get_outbox, get_outbox_page, get_add, get_remove, \
|
|||
from .create import get_create
|
||||
from .follow import get_follow_request, get_unfollow, get_accept, get_reject
|
||||
from .status import get_review, get_review_article, get_status, get_replies, \
|
||||
get_favorite, get_add_tag, get_remove_tag, get_replies_page
|
||||
get_favorite, get_unfavorite, get_add_tag, get_remove_tag, get_replies_page
|
||||
|
|
|
@ -77,6 +77,7 @@ def get_replies(status, replies):
|
|||
|
||||
|
||||
def get_replies_page(status, replies):
|
||||
''' actual reply list content '''
|
||||
id_slug = status.absolute_id + '/replies?page=true&only_other_accounts=true'
|
||||
items = []
|
||||
for reply in replies:
|
||||
|
@ -105,6 +106,22 @@ def get_favorite(favorite):
|
|||
}
|
||||
|
||||
|
||||
def get_unfavorite(favorite):
|
||||
''' like a post '''
|
||||
return {
|
||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||
'id': '%s/undo' % favorite.absolute_id,
|
||||
'type': 'Undo',
|
||||
'actor': favorite.user.actor,
|
||||
'object': {
|
||||
'id': favorite.absolute_id,
|
||||
'type': 'Like',
|
||||
'actor': favorite.user.actor,
|
||||
'object': favorite.status.absolute_id,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
def get_add_tag(tag):
|
||||
''' add activity for tagging a book '''
|
||||
uuid = uuid4()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue