mirror of https://gitlab.com/bashrc2/epicyon
Extra check on received posts
parent
88e26a57af
commit
fb82fd6583
3
inbox.py
3
inbox.py
|
@ -98,6 +98,8 @@ def inboxPermittedMessage(domain: str,messageJson: {},federationList: []) -> boo
|
||||||
messageJson['type']!='Delete' and \
|
messageJson['type']!='Delete' and \
|
||||||
messageJson['type']!='Announce':
|
messageJson['type']!='Announce':
|
||||||
if messageJson.get('object'):
|
if messageJson.get('object'):
|
||||||
|
if not isinstance(messageJson['object'], dict):
|
||||||
|
return False
|
||||||
if messageJson['object'].get('inReplyTo'):
|
if messageJson['object'].get('inReplyTo'):
|
||||||
inReplyTo=messageJson['object']['inReplyTo']
|
inReplyTo=messageJson['object']['inReplyTo']
|
||||||
if not urlPermitted(inReplyTo,federationList):
|
if not urlPermitted(inReplyTo,federationList):
|
||||||
|
@ -159,6 +161,7 @@ def savePostToInboxQueue(baseDir: str,httpPrefix: str,nickname: str, domain: str
|
||||||
sharedInboxItem=True
|
sharedInboxItem=True
|
||||||
|
|
||||||
newQueueItem = {
|
newQueueItem = {
|
||||||
|
'id': postId,
|
||||||
'nickname': nickname,
|
'nickname': nickname,
|
||||||
'domain': domain,
|
'domain': domain,
|
||||||
'sharedInbox': sharedInboxItem,
|
'sharedInbox': sharedInboxItem,
|
||||||
|
|
Loading…
Reference in New Issue