From 8b73c81e517d0d9130206bc7f08c89c14209f05e Mon Sep 17 00:00:00 2001 From: db0 Date: Mon, 26 Jun 2023 15:18:30 +0200 Subject: [PATCH] fix: follow messages --- fediseer/apis/v1/activitypub.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/fediseer/apis/v1/activitypub.py b/fediseer/apis/v1/activitypub.py index c0aa845..2207f71 100644 --- a/fediseer/apis/v1/activitypub.py +++ b/fediseer/apis/v1/activitypub.py @@ -45,9 +45,12 @@ class Inbox(Resource): self.args = self.post_parser.parse_args() json_payload = request.get_json() actor = json_payload["actor"] - try: - message = json_payload["object"]["content"] - except: - logger.info(f"Received unexpected invox payload: {json_payload}") - logger.info(f"Fediseer Inbox Received: From: {actor} | {message}") + if json_payload.get("Type") == "Follow": + logger.info(f"Fediseer is now followed from: {actor}") + else: + try: + message = json_payload["object"]["content"] + logger.info(f"Fediseer Inbox Received: From: {actor} | {message}") + except: + logger.info(f"Received unexpected invox payload: {json_payload}") return {"message": "delivered"}, 200