mirror of https://gitlab.com/bashrc2/epicyon
Tidying
parent
1043a857aa
commit
00c8d96099
30
inbox.py
30
inbox.py
|
@ -1332,26 +1332,12 @@ def inboxAfterCapabilities(session,keyId: str,handle: str,messageJson: {}, \
|
||||||
return True
|
return True
|
||||||
|
|
||||||
if messageJson.get('postNickname'):
|
if messageJson.get('postNickname'):
|
||||||
if validPostContent(messageJson['post'],maxMentions):
|
postJson=messageJson['post']
|
||||||
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)
|
|
||||||
else:
|
else:
|
||||||
if validPostContent(messageJson,maxMentions):
|
postJson=messageJson
|
||||||
if isDM(messageJson):
|
|
||||||
|
if validPostContent(postJson,maxMentions):
|
||||||
|
if isDM(postJson):
|
||||||
dmNotify(baseDir,handle)
|
dmNotify(baseDir,handle)
|
||||||
domainFull=domain
|
domainFull=domain
|
||||||
if port:
|
if port:
|
||||||
|
@ -1359,12 +1345,12 @@ def inboxAfterCapabilities(session,keyId: str,handle: str,messageJson: {}, \
|
||||||
if port!=80 and port!=443:
|
if port!=80 and port!=443:
|
||||||
domainFull=domainFull+':'+str(port)
|
domainFull=domainFull+':'+str(port)
|
||||||
actor=httpPrefix+'://'+domainFull+'/users/'+handle.split('@')[0]
|
actor=httpPrefix+'://'+domainFull+'/users/'+handle.split('@')[0]
|
||||||
if isReply(messageJson,actor):
|
if isReply(postJson,actor):
|
||||||
replyNotify(baseDir,handle)
|
replyNotify(baseDir,handle)
|
||||||
obtainAvatarForReplyPost(session,baseDir,httpPrefix,domain,personCache,messageJson,debug)
|
obtainAvatarForReplyPost(session,baseDir,httpPrefix,domain,personCache,postJson,debug)
|
||||||
try:
|
try:
|
||||||
with open(destinationFilename, 'w+') as fp:
|
with open(destinationFilename, 'w+') as fp:
|
||||||
commentjson.dump(messageJson, fp, indent=4, sort_keys=False)
|
commentjson.dump(postJson, fp, indent=4, sort_keys=False)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue