Boosts - handle url, store in database, send, notify.
This commit is contained in:
@ -291,6 +291,22 @@ def handle_unfavorite(user, status):
|
||||
recipients = get_recipients(user, 'direct', [status.user])
|
||||
broadcast(user, fav_activity, recipients)
|
||||
|
||||
def handle_boost(user, status):
|
||||
''' a user wishes to boost a status '''
|
||||
try:
|
||||
boost = models.Boost.objects.create(
|
||||
boosted_status=status,
|
||||
user=user,
|
||||
)
|
||||
boost.save()
|
||||
except IntegrityError:
|
||||
# you already boosted that
|
||||
# TODO - doesn't work because unique constraint isn't enforcable.
|
||||
return
|
||||
|
||||
boost_activity = activitypub.get_boost(boost)
|
||||
recipients = get_recipients(user, 'public')
|
||||
broadcast(user, boost_activity, recipients)
|
||||
|
||||
def handle_update_book(user, book):
|
||||
''' broadcast the news about our book '''
|
||||
|
Reference in New Issue
Block a user