main2
Bob Mottram 2019-10-04 10:58:02 +01:00
parent 1043a857aa
commit 00c8d96099
1 changed files with 21 additions and 35 deletions

View File

@ -1332,41 +1332,27 @@ def inboxAfterCapabilities(session,keyId: str,handle: str,messageJson: {}, \
return True
if messageJson.get('postNickname'):
if validPostContent(messageJson['post'],maxMentions):
if isDM(messageJson['post']):
dmNotify(baseDir,handle)
domainFull=domain
if port:
if ':' not in domain:
if port!=80 and port!=443:
domainFull=domainFull+':'+str(port)
actor=httpPrefix+'://'+domainFull+'/users/'+handle.split('@')[0]
if isReply(messageJson['post'],actor):
replyNotify(baseDir,handle)
obtainAvatarForReplyPost(session,baseDir,httpPrefix,domain,personCache,messageJson['post'],debug)
try:
with open(destinationFilename, 'w+') as fp:
commentjson.dump(messageJson['post'], fp, indent=4, sort_keys=False)
except Exception as e:
print(e)
postJson=messageJson['post']
else:
if validPostContent(messageJson,maxMentions):
if isDM(messageJson):
dmNotify(baseDir,handle)
domainFull=domain
if port:
if ':' not in domain:
if port!=80 and port!=443:
domainFull=domainFull+':'+str(port)
actor=httpPrefix+'://'+domainFull+'/users/'+handle.split('@')[0]
if isReply(messageJson,actor):
replyNotify(baseDir,handle)
obtainAvatarForReplyPost(session,baseDir,httpPrefix,domain,personCache,messageJson,debug)
try:
with open(destinationFilename, 'w+') as fp:
commentjson.dump(messageJson, fp, indent=4, sort_keys=False)
except Exception as e:
print(e)
postJson=messageJson
if validPostContent(postJson,maxMentions):
if isDM(postJson):
dmNotify(baseDir,handle)
domainFull=domain
if port:
if ':' not in domain:
if port!=80 and port!=443:
domainFull=domainFull+':'+str(port)
actor=httpPrefix+'://'+domainFull+'/users/'+handle.split('@')[0]
if isReply(postJson,actor):
replyNotify(baseDir,handle)
obtainAvatarForReplyPost(session,baseDir,httpPrefix,domain,personCache,postJson,debug)
try:
with open(destinationFilename, 'w+') as fp:
commentjson.dump(postJson, fp, indent=4, sort_keys=False)
except Exception as e:
print(e)
if not os.path.isfile(destinationFilename):
return False