Mention and notify users when creating a status
This commit is contained in:
@ -59,6 +59,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(
|
||||
@ -66,6 +67,11 @@ class Status(OrderedCollectionPageMixin, BookWyrmModel):
|
||||
name=book.title,
|
||||
type='Book'
|
||||
))
|
||||
for user in self.mention_users.all():
|
||||
tags.append(activitypub.Mention(
|
||||
href=user.remote_id,
|
||||
name=user.username,
|
||||
))
|
||||
return tags
|
||||
|
||||
shared_mappings = [
|
||||
@ -270,7 +276,7 @@ class ReadThrough(BookWyrmModel):
|
||||
|
||||
NotificationType = models.TextChoices(
|
||||
'NotificationType',
|
||||
'FAVORITE REPLY TAG FOLLOW FOLLOW_REQUEST BOOST IMPORT')
|
||||
'FAVORITE REPLY MENTION TAG FOLLOW FOLLOW_REQUEST BOOST IMPORT')
|
||||
|
||||
class Notification(BookWyrmModel):
|
||||
''' you've been tagged, liked, followed, etc '''
|
||||
|
Reference in New Issue
Block a user