Boost and unboost federation fixes

This commit is contained in:
Mouse Reeve
2020-11-04 16:28:32 -08:00
parent 21c0a0163a
commit 152343d251
4 changed files with 35 additions and 27 deletions

View File

@ -76,7 +76,7 @@ class Status(OrderedCollectionPageMixin, BookWyrmModel):
return tags
shared_mappings = [
ActivityMapping('url', 'remote_id'),
ActivityMapping('url', 'remote_id', lambda x: None),
ActivityMapping('id', 'remote_id'),
ActivityMapping('inReplyTo', 'reply_parent'),
ActivityMapping('published', 'published_date'),
@ -136,6 +136,7 @@ class Status(OrderedCollectionPageMixin, BookWyrmModel):
return ActivitypubMixin.to_activity(self, pure=pure)
def save(self, *args, **kwargs):
''' update user active time '''
self.user.last_active_date = timezone.now()
self.user.save()
super().save(*args, **kwargs)
@ -240,6 +241,7 @@ class Favorite(ActivitypubMixin, BookWyrmModel):
activity_serializer = activitypub.Like
def save(self, *args, **kwargs):
''' update user active time '''
self.user.last_active_date = timezone.now()
self.user.save()
super().save(*args, **kwargs)
@ -285,6 +287,7 @@ class ReadThrough(BookWyrmModel):
null=True)
def save(self, *args, **kwargs):
''' update user active time '''
self.user.last_active_date = timezone.now()
self.user.save()
super().save(*args, **kwargs)