Merge branch 'main' into mention_users
This commit is contained in:
@ -60,6 +60,7 @@ class Status(OrderedCollectionPageMixin, BookWyrmModel):
|
||||
@property
|
||||
def ap_tag(self):
|
||||
''' references to books and/or users '''
|
||||
|
||||
tags = []
|
||||
for book in self.mention_books.all():
|
||||
tags.append(activitypub.Link(
|
||||
@ -123,7 +124,7 @@ class Status(OrderedCollectionPageMixin, BookWyrmModel):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
def to_activity(self, **kwargs):
|
||||
def to_activity(self, pure=False):
|
||||
''' return tombstone if the status is deleted '''
|
||||
if self.deleted:
|
||||
return activitypub.Tombstone(
|
||||
@ -132,7 +133,12 @@ class Status(OrderedCollectionPageMixin, BookWyrmModel):
|
||||
deleted=self.deleted_date.isoformat(),
|
||||
published=self.deleted_date.isoformat()
|
||||
).serialize()
|
||||
return ActivitypubMixin.to_activity(self, **kwargs)
|
||||
return ActivitypubMixin.to_activity(self, pure=pure)
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
self.user.last_active_date = timezone.now()
|
||||
self.user.save()
|
||||
super().save(*args, **kwargs)
|
||||
|
||||
|
||||
class GeneratedNote(Status):
|
||||
@ -233,6 +239,11 @@ class Favorite(ActivitypubMixin, BookWyrmModel):
|
||||
|
||||
activity_serializer = activitypub.Like
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
self.user.last_active_date = timezone.now()
|
||||
self.user.save()
|
||||
super().save(*args, **kwargs)
|
||||
|
||||
|
||||
class Meta:
|
||||
''' can't fav things twice '''
|
||||
@ -273,6 +284,11 @@ class ReadThrough(BookWyrmModel):
|
||||
blank=True,
|
||||
null=True)
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
self.user.last_active_date = timezone.now()
|
||||
self.user.save()
|
||||
super().save(*args, **kwargs)
|
||||
|
||||
|
||||
NotificationType = models.TextChoices(
|
||||
'NotificationType',
|
||||
|
Reference in New Issue
Block a user