summaryrefslogtreecommitdiffstats
path: root/users/models/inbox_message.py
diff options
context:
space:
mode:
authorAndrew Godwin2022-12-17 14:58:04 -0700
committerAndrew Godwin2022-12-17 14:58:04 -0700
commit64f113dd8d102282da8f013ab2acf6e1c24a5934 (patch)
tree7ed951a51f24b31c850eb58d660d1fa11b918595 /users/models/inbox_message.py
parente8d6dccbb27a8611311b5f94f593b69bcca99528 (diff)
downloadtakahe-64f113dd8d102282da8f013ab2acf6e1c24a5934.tar.gz
takahe-64f113dd8d102282da8f013ab2acf6e1c24a5934.tar.bz2
takahe-64f113dd8d102282da8f013ab2acf6e1c24a5934.zip
Receive inbound reports
Diffstat (limited to 'users/models/inbox_message.py')
-rw-r--r--users/models/inbox_message.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/users/models/inbox_message.py b/users/models/inbox_message.py
index 6c36043..d6d4f43 100644
--- a/users/models/inbox_message.py
+++ b/users/models/inbox_message.py
@@ -16,7 +16,7 @@ class InboxMessageStates(StateGraph):
@classmethod
async def handle_received(cls, instance: "InboxMessage"):
from activities.models import Post, PostInteraction
- from users.models import Follow, Identity
+ from users.models import Follow, Identity, Report
match instance.message_type:
case "follow":
@@ -29,6 +29,8 @@ class InboxMessageStates(StateGraph):
match instance.message_object_type:
case "note":
await sync_to_async(Post.handle_create_ap)(instance.message)
+ case "question":
+ pass # Drop for now
case unknown:
raise ValueError(
f"Cannot handle activity of type create.{unknown}"
@@ -39,6 +41,8 @@ class InboxMessageStates(StateGraph):
await sync_to_async(Post.handle_update_ap)(instance.message)
case "person":
await sync_to_async(Identity.handle_update_ap)(instance.message)
+ case "question":
+ pass # Drop for now
case unknown:
raise ValueError(
f"Cannot handle activity of type update.{unknown}"
@@ -87,6 +91,9 @@ class InboxMessageStates(StateGraph):
case "remove":
# We are ignoring these right now (probably pinned items)
pass
+ case "flag":
+ # Received reports
+ await sync_to_async(Report.handle_ap)(instance.message)
case unknown:
raise ValueError(f"Cannot handle activity of type {unknown}")
return cls.processed