From 2af276f0ae0829af1d7874d5d96bea482547408e Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 22 Aug 2019 20:53:24 +0100 Subject: [PATCH] Also handle bot profiles --- inbox.py | 3 ++- posts.py | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/inbox.py b/inbox.py index 04ef66b41..02cb1b67b 100644 --- a/inbox.py +++ b/inbox.py @@ -658,7 +658,8 @@ def receiveUpdate(session,baseDir: str, \ print('DEBUG: "users" missing from actor in '+messageJson['type']) return False - if messageJson['object']['type']=='Person': + if messageJson['object']['type']=='Person' or \ + messageJson['object']['type']=='Service': if messageJson['object'].get('url') and messageJson['object'].get('id'): print('Request to update actor: '+messageJson['actor']) updateDomain,updatePort=getDomainFromActor(messageJson['actor']) diff --git a/posts.py b/posts.py index aed0b17f1..665bf1c60 100644 --- a/posts.py +++ b/posts.py @@ -1328,7 +1328,9 @@ def sendToNamedAddresses(session,baseDir: str, \ isProfileUpdate=False # for actor updates there is no 'to' within the object if postJsonObject['object'].get('type') and postJsonObject.get('type'): - if postJsonObject['type']=='Update' and postJsonObject['object']['type']=='Person': + if postJsonObject['type']=='Update' and \ + (postJsonObject['object']['type']=='Person' or \ + postJsonObject['object']['type']=='Service'): # use the original object, which has a 'to' recipientsObject=postJsonObject isProfileUpdate=True @@ -1473,7 +1475,8 @@ def sendToFollowers(session,baseDir: str, \ if postJsonObject.get('object'): if isinstance(postJsonObject['object'], dict): if postJsonObject['object'].get('type'): - if postJsonObject['object']['type']=='Person': + if postJsonObject['object']['type']=='Person' or \ + postJsonObject['object']['type']=='Service': print('Sending profile update to shared inbox of '+toDomain) toNickname='inbox'