mirror of https://gitlab.com/bashrc2/epicyon
Less verbose
parent
928412c34c
commit
a3be3c1803
|
|
@ -1333,6 +1333,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
return True
|
return True
|
||||||
elif self.path.endswith('/' + nickname):
|
elif self.path.endswith('/' + nickname):
|
||||||
return True
|
return True
|
||||||
|
if self.server.debug:
|
||||||
print('AUTH: nickname ' + nickname +
|
print('AUTH: nickname ' + nickname +
|
||||||
' was not found in path ' + self.path)
|
' was not found in path ' + self.path)
|
||||||
return False
|
return False
|
||||||
|
|
|
||||||
5
inbox.py
5
inbox.py
|
|
@ -395,6 +395,7 @@ def savePostToInboxQueue(baseDir: str, httpPrefix: str,
|
||||||
replyDomain, replyPort = \
|
replyDomain, replyPort = \
|
||||||
getDomainFromActor(inReplyTo)
|
getDomainFromActor(inReplyTo)
|
||||||
if isBlockedDomain(baseDir, replyDomain):
|
if isBlockedDomain(baseDir, replyDomain):
|
||||||
|
if debug:
|
||||||
print('WARN: post contains reply from ' +
|
print('WARN: post contains reply from ' +
|
||||||
str(actor) +
|
str(actor) +
|
||||||
' to a blocked domain: ' + replyDomain)
|
' to a blocked domain: ' + replyDomain)
|
||||||
|
|
@ -405,6 +406,7 @@ def savePostToInboxQueue(baseDir: str, httpPrefix: str,
|
||||||
if replyNickname and replyDomain:
|
if replyNickname and replyDomain:
|
||||||
if isBlocked(baseDir, nickname, domain,
|
if isBlocked(baseDir, nickname, domain,
|
||||||
replyNickname, replyDomain):
|
replyNickname, replyDomain):
|
||||||
|
if debug:
|
||||||
print('WARN: post contains reply from ' +
|
print('WARN: post contains reply from ' +
|
||||||
str(actor) +
|
str(actor) +
|
||||||
' to a blocked account: ' +
|
' to a blocked account: ' +
|
||||||
|
|
@ -1438,6 +1440,7 @@ def _receiveAnnounce(recentPostsCache: {},
|
||||||
__version__, httpPrefix,
|
__version__, httpPrefix,
|
||||||
domain, onionDomain)
|
domain, onionDomain)
|
||||||
if pubKey:
|
if pubKey:
|
||||||
|
if debug:
|
||||||
print('DEBUG: public key obtained for announce: ' +
|
print('DEBUG: public key obtained for announce: ' +
|
||||||
lookupActor)
|
lookupActor)
|
||||||
break
|
break
|
||||||
|
|
@ -1693,6 +1696,7 @@ def _validPostContent(baseDir: str, nickname: str, domain: str,
|
||||||
print('REJECT: reply to post which does not ' +
|
print('REJECT: reply to post which does not ' +
|
||||||
'allow comments: ' + originalPostId)
|
'allow comments: ' + originalPostId)
|
||||||
return False
|
return False
|
||||||
|
if debug:
|
||||||
print('ACCEPT: post content is valid')
|
print('ACCEPT: post content is valid')
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
@ -1735,6 +1739,7 @@ def _obtainAvatarForReplyPost(session, baseDir: str, httpPrefix: str,
|
||||||
__version__, httpPrefix,
|
__version__, httpPrefix,
|
||||||
domain, onionDomain)
|
domain, onionDomain)
|
||||||
if pubKey:
|
if pubKey:
|
||||||
|
if debug:
|
||||||
print('DEBUG: public key obtained for reply: ' + lookupActor)
|
print('DEBUG: public key obtained for reply: ' + lookupActor)
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -88,6 +88,7 @@ def getJson(session, url: str, headers: {}, params: {},
|
||||||
version='1.2.0', httpPrefix='https',
|
version='1.2.0', httpPrefix='https',
|
||||||
domain='testdomain', timeoutSec=20, quiet=False) -> {}:
|
domain='testdomain', timeoutSec=20, quiet=False) -> {}:
|
||||||
if not isinstance(url, str):
|
if not isinstance(url, str):
|
||||||
|
if not quiet:
|
||||||
print('url: ' + str(url))
|
print('url: ' + str(url))
|
||||||
print('ERROR: getJson failed, url should be a string')
|
print('ERROR: getJson failed, url should be a string')
|
||||||
return None
|
return None
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue