Fixes loading remote books

- saves remote_id correctly
- loads remote books for incoming statuses
This commit is contained in:
Mouse Reeve
2020-10-30 17:04:10 -07:00
parent 72219ace77
commit 203e526a83
8 changed files with 57 additions and 5 deletions

View File

@ -225,6 +225,15 @@ def handle_create(activity):
if not reply:
return
# look up books
book_urls = []
if hasattr(activity, 'inReplyToBook'):
book_urls.append(activity.inReplyToBook)
if hasattr(activity, 'tag'):
book_urls += [t.href for t in activity.tag if t.type == 'Book']
for remote_id in book_urls:
book = books_manager.get_or_create_book(remote_id)
model = models.activity_models[activity.type]
status = activity.to_model(model)