mirror of
https://github.com/jointakahe/takahe.git
synced 2025-02-16 15:45:14 +00:00
Type and fanout fixes
This commit is contained in:
parent
6eaaa6eac4
commit
f4f575d22f
2 changed files with 9 additions and 2 deletions
|
@ -23,6 +23,10 @@ class FanOutStates(StateGraph):
|
|||
|
||||
fan_out = await instance.afetch_full()
|
||||
|
||||
# Don't try to fan out to identities that are not fetched yet
|
||||
if not (fan_out.identity.local or fan_out.identity.inbox_uri):
|
||||
return
|
||||
|
||||
match (fan_out.type, fan_out.identity.local):
|
||||
# Handle creating/updating local posts
|
||||
case ((FanOut.Types.post | FanOut.Types.post_edited), True):
|
||||
|
|
|
@ -135,8 +135,11 @@ class InboxMessage(StatorModel):
|
|||
return self.message["type"].lower()
|
||||
|
||||
@property
|
||||
def message_object_type(self):
|
||||
return self.message["object"]["type"].lower()
|
||||
def message_object_type(self) -> str | None:
|
||||
if isinstance(self.message["object"], dict):
|
||||
return self.message["object"]["type"].lower()
|
||||
else:
|
||||
return None
|
||||
|
||||
@property
|
||||
def message_type_full(self):
|
||||
|
|
Loading…
Reference in a new issue