Allow announces without status

main2
Bob Mottram 2019-10-21 10:48:37 +01:00
parent 49b0a2de45
commit 38e954af17
1 changed files with 9 additions and 9 deletions

View File

@ -247,7 +247,7 @@ def savePostToInboxQueue(baseDir: str,httpPrefix: str, \
if isBlocked(baseDir,nickname,domain,replyNickname,replyDomain): if isBlocked(baseDir,nickname,domain,replyNickname,replyDomain):
print('WARN: post contains reply from '+str(actor)+' to a blocked account: '+replyNickname+'@'+replyDomain) print('WARN: post contains reply from '+str(actor)+' to a blocked account: '+replyNickname+'@'+replyDomain)
return None return None
else: else:
print('WARN: post is a reply to an unidentified account: '+postJsonObject['object']['inReplyTo']) print('WARN: post is a reply to an unidentified account: '+postJsonObject['object']['inReplyTo'])
return None return None
if postJsonObject['object'].get('content'): if postJsonObject['object'].get('content'):
@ -1045,10 +1045,10 @@ def receiveAnnounce(session,handle: str,isGroup: bool,baseDir: str, \
if debug: if debug:
print('DEBUG: "users", "channel" or "profile" missing in '+messageJson['type']) print('DEBUG: "users", "channel" or "profile" missing in '+messageJson['type'])
return False return False
if '/statuses/' not in messageJson['object']: #if '/statuses/' not in messageJson['object']:
if debug: # if debug:
print('DEBUG: "statuses" missing from object in '+messageJson['type']) # print('DEBUG: "statuses" missing from object in '+messageJson['type'])
return False # return False
objectDomain=messageJson['object'].replace('https://','').replace('http://','').replace('dat://','') objectDomain=messageJson['object'].replace('https://','').replace('http://','').replace('dat://','')
if '/' in objectDomain: if '/' in objectDomain:
objectDomain=objectDomain.split('/')[0] objectDomain=objectDomain.split('/')[0]
@ -1136,10 +1136,10 @@ def receiveUndoAnnounce(session,handle: str,isGroup: bool,baseDir: str, \
if debug: if debug:
print('DEBUG: "users" or "profile" missing from actor in '+messageJson['type']+' announce') print('DEBUG: "users" or "profile" missing from actor in '+messageJson['type']+' announce')
return False return False
if '/statuses/' not in messageJson['object']: #if '/statuses/' not in messageJson['object']:
if debug: # if debug:
print('DEBUG: "statuses" missing from object in '+messageJson['type']+' announce') # print('DEBUG: "statuses" missing from object in '+messageJson['type']+' announce')
return False # return False
if not os.path.isdir(baseDir+'/accounts/'+handle): if not os.path.isdir(baseDir+'/accounts/'+handle):
print('DEBUG: unknown recipient of undo announce - '+handle) print('DEBUG: unknown recipient of undo announce - '+handle)
# if this post in the outbox of the person? # if this post in the outbox of the person?