Also check cc

main
Bob Mottram 2021-03-22 23:03:23 +00:00
parent 34f0cb47ad
commit 5d17c2d9ce
1 changed files with 6 additions and 0 deletions

View File

@ -182,11 +182,17 @@ def _postIsToYou(actor: str, postJsonObject: {}) -> bool:
if postJsonObject.get('to'):
if actor in postJsonObject['to']:
toYourActor = True
if not toYourActor and postJsonObject.get('cc'):
if actor in postJsonObject['cc']:
toYourActor = True
if not toYourActor and postJsonObject.get('object'):
if isinstance(postJsonObject['object'], dict):
if postJsonObject['object'].get('to'):
if actor in postJsonObject['object']['to']:
toYourActor = True
if not toYourActor and postJsonObject['object'].get('cc'):
if actor in postJsonObject['object']['cc']:
toYourActor = True
return toYourActor