diff --git a/app/boxes.py b/app/boxes.py index 167279c..7b25641 100644 --- a/app/boxes.py +++ b/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: " diff --git a/app/main.py b/app/main.py index ac2443f..a2d7dc1 100644 --- a/app/main.py +++ b/app/main.py @@ -78,7 +78,6 @@ _RESIZED_CACHE: MutableMapping[tuple[str, int], tuple[bytes, str, Any]] = LFUCac # Next: # - show pending follow request (and prevent double follow?) # - UI support for updating posts -# - Support for processing update # - Article support # - Fix tests # - Fix SQL tx in the codebase diff --git a/app/models.py b/app/models.py index 5bda03f..631857e 100644 --- a/app/models.py +++ b/app/models.py @@ -479,11 +479,18 @@ class Webmention(Base): class NotificationType(str, enum.Enum): NEW_FOLLOWER = "new_follower" UNFOLLOW = "unfollow" + + FOLLOW_REQUEST_ACCEPTED = "follow_request_accepted" + FOLLOW_REQUEST_REJECTED = "follow_request_rejected" + LIKE = "like" UNDO_LIKE = "undo_like" + ANNOUNCE = "announce" UNDO_ANNOUNCE = "undo_announce" + MENTION = "mention" + NEW_WEBMENTION = "new_webmention" UPDATED_WEBMENTION = "updated_webmention" DELETED_WEBMENTION = "deleted_webmention" diff --git a/app/templates/layout.html b/app/templates/layout.html index de6265f..e10dc0e 100644 --- a/app/templates/layout.html +++ b/app/templates/layout.html @@ -30,7 +30,7 @@