Broadcast book update events

This commit is contained in:
Mouse Reeve
2020-03-28 19:12:17 -07:00
parent db6af61f03
commit cf113e50fe
5 changed files with 35 additions and 4 deletions

View File

@ -1,7 +1,7 @@
''' bring activitypub functions into the namespace '''
from .actor import get_actor
from .book import get_book
from .create import get_create
from .create import get_create, get_update
from .follow import get_following, get_followers
from .follow import get_follow_request, get_unfollow, get_accept, get_reject
from .outbox import get_outbox, get_outbox_page

View File

@ -30,4 +30,17 @@ def get_create(user, status_json):
}
def get_update(user, activity_json):
''' a user profile or book or whatever got updated '''
# TODO: should this have a signature??
return {
'@context': 'https://www.w3.org/ns/activitystreams',
'id': 'https://friend.camp/users/tripofmice#updates/1585446332',
'type': 'Update',
'actor': user.actor,
'to': [
'https://www.w3.org/ns/activitystreams#Public'
],
'object': activity_json,
}