From 0fe9b2adcdaab3b1bc83483a1a77efbc9b874617 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 23 Dec 2020 22:18:19 +0000 Subject: [PATCH] Tidying --- inbox.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/inbox.py b/inbox.py index 96d78c4a1..c0bd64098 100644 --- a/inbox.py +++ b/inbox.py @@ -730,19 +730,19 @@ def _personReceiveUpdate(baseDir: str, ' ' + str(personJson)) domainFull = getFullDomain(domain, port) updateDomainFull = getFullDomain(updateDomain, updatePort) - actor = updateDomainFull + '/users/' + updateNickname - if actor not in personJson['id']: - actor = updateDomainFull + '/profile/' + updateNickname - if actor not in personJson['id']: - actor = updateDomainFull + '/channel/' + updateNickname - if actor not in personJson['id']: - actor = updateDomainFull + '/accounts/' + updateNickname - if actor not in personJson['id']: - if debug: - print('actor: ' + actor) - print('id: ' + personJson['id']) - print('DEBUG: Actor does not match id') - return False + usersPaths = ('users', 'profile', 'channel', 'accounts') + usersStrFound = False + for usersStr in usersPaths: + actor = updateDomainFull + '/' + usersStr + '/' + updateNickname + if actor in personJson['id']: + usersStrFound = True + break + if not usersStrFound: + if debug: + print('actor: ' + actor) + print('id: ' + personJson['id']) + print('DEBUG: Actor does not match id') + return False if updateDomainFull == domainFull: if debug: print('DEBUG: You can only receive actor updates ' +