mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2025-06-05 21:59:23 +02:00
Add notification for follow requests status
This commit is contained in:
12
app/boxes.py
12
app/boxes.py
@ -1105,6 +1105,18 @@ async def save_to_inbox(
|
||||
ap_actor_id=actor.ap_id,
|
||||
)
|
||||
db_session.add(following)
|
||||
|
||||
notif_type = (
|
||||
models.NotificationType.FOLLOW_REQUEST_ACCEPTED
|
||||
if activity_ro.ap_type == "Accept"
|
||||
else models.NotificationType.FOLLOW_REQUEST_REJECTED
|
||||
)
|
||||
notif = models.Notification(
|
||||
notification_type=notif_type,
|
||||
actor_id=actor.id,
|
||||
inbox_object_id=inbox_object.id,
|
||||
)
|
||||
db_session.add(notif)
|
||||
else:
|
||||
logger.info(
|
||||
"Received an Accept for an unsupported activity: "
|
||||
|
Reference in New Issue
Block a user