Also handle bot profiles

master
Bob Mottram 2019-08-22 20:53:24 +01:00
parent ab64f2a2c5
commit 2af276f0ae
2 changed files with 7 additions and 3 deletions

View File

@ -658,7 +658,8 @@ def receiveUpdate(session,baseDir: str, \
print('DEBUG: "users" missing from actor in '+messageJson['type']) print('DEBUG: "users" missing from actor in '+messageJson['type'])
return False 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'): if messageJson['object'].get('url') and messageJson['object'].get('id'):
print('Request to update actor: '+messageJson['actor']) print('Request to update actor: '+messageJson['actor'])
updateDomain,updatePort=getDomainFromActor(messageJson['actor']) updateDomain,updatePort=getDomainFromActor(messageJson['actor'])

View File

@ -1328,7 +1328,9 @@ def sendToNamedAddresses(session,baseDir: str, \
isProfileUpdate=False isProfileUpdate=False
# for actor updates there is no 'to' within the object # for actor updates there is no 'to' within the object
if postJsonObject['object'].get('type') and postJsonObject.get('type'): 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' # use the original object, which has a 'to'
recipientsObject=postJsonObject recipientsObject=postJsonObject
isProfileUpdate=True isProfileUpdate=True
@ -1473,7 +1475,8 @@ def sendToFollowers(session,baseDir: str, \
if postJsonObject.get('object'): if postJsonObject.get('object'):
if isinstance(postJsonObject['object'], dict): if isinstance(postJsonObject['object'], dict):
if postJsonObject['object'].get('type'): 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) print('Sending profile update to shared inbox of '+toDomain)
toNickname='inbox' toNickname='inbox'