mirror of https://gitlab.com/bashrc2/epicyon
Show actor
parent
81d990c066
commit
ce708fa7fa
|
@ -134,7 +134,7 @@ def readFollowList(filename: str):
|
||||||
return followlist
|
return followlist
|
||||||
|
|
||||||
class PubServer(BaseHTTPRequestHandler):
|
class PubServer(BaseHTTPRequestHandler):
|
||||||
protocol_version = 'HTTP/1.1'
|
protocol_version = 'HTTP/1.0'
|
||||||
|
|
||||||
def _login_headers(self,fileFormat: str,length: int) -> None:
|
def _login_headers(self,fileFormat: str,length: int) -> None:
|
||||||
self.send_response(200)
|
self.send_response(200)
|
||||||
|
|
17
inbox.py
17
inbox.py
|
@ -176,7 +176,9 @@ def savePostToInboxQueue(baseDir: str,httpPrefix: str,nickname: str, domain: str
|
||||||
# isn't written to file
|
# isn't written to file
|
||||||
postNickname=None
|
postNickname=None
|
||||||
postDomain=None
|
postDomain=None
|
||||||
|
actor=None
|
||||||
if postJsonObject.get('actor'):
|
if postJsonObject.get('actor'):
|
||||||
|
actor=postJsonObject['actor']
|
||||||
postNickname=getNicknameFromActor(postJsonObject['actor'])
|
postNickname=getNicknameFromActor(postJsonObject['actor'])
|
||||||
postDomain,postPort=getDomainFromActor(postJsonObject['actor'])
|
postDomain,postPort=getDomainFromActor(postJsonObject['actor'])
|
||||||
if isBlocked(baseDir,nickname,domain,postNickname,postDomain):
|
if isBlocked(baseDir,nickname,domain,postNickname,postDomain):
|
||||||
|
@ -191,12 +193,13 @@ def savePostToInboxQueue(baseDir: str,httpPrefix: str,nickname: str, domain: str
|
||||||
if isinstance(postJsonObject['object']['content'], str):
|
if isinstance(postJsonObject['object']['content'], str):
|
||||||
if isFiltered(baseDir,nickname,domain,postJsonObject['object']['content']):
|
if isFiltered(baseDir,nickname,domain,postJsonObject['object']['content']):
|
||||||
return None
|
return None
|
||||||
|
originalPostId=None
|
||||||
if postJsonObject.get('id'):
|
if postJsonObject.get('id'):
|
||||||
postId=postJsonObject['id'].replace('/activity','')
|
originalPostId=postJsonObject['id'].replace('/activity','')
|
||||||
else:
|
|
||||||
statusNumber,published = getStatusNumber()
|
statusNumber,published = getStatusNumber()
|
||||||
postId=httpPrefix+'://'+originalDomain+'/users/'+nickname+'/statuses/'+statusNumber
|
postId=httpPrefix+'://'+originalDomain+'/users/'+nickname+'/statuses/'+statusNumber
|
||||||
|
postJsonObject['id']=postId
|
||||||
|
|
||||||
currTime=datetime.datetime.utcnow()
|
currTime=datetime.datetime.utcnow()
|
||||||
published=currTime.strftime("%Y-%m-%dT%H:%M:%SZ")
|
published=currTime.strftime("%Y-%m-%dT%H:%M:%SZ")
|
||||||
|
@ -216,7 +219,9 @@ def savePostToInboxQueue(baseDir: str,httpPrefix: str,nickname: str, domain: str
|
||||||
sharedInboxItem=True
|
sharedInboxItem=True
|
||||||
|
|
||||||
newQueueItem = {
|
newQueueItem = {
|
||||||
|
'originalId': originalPostId,
|
||||||
'id': postId,
|
'id': postId,
|
||||||
|
'actor': actor,
|
||||||
'nickname': nickname,
|
'nickname': nickname,
|
||||||
'domain': domain,
|
'domain': domain,
|
||||||
'postNickname': postNickname,
|
'postNickname': postNickname,
|
||||||
|
@ -1093,7 +1098,7 @@ def runInboxQueue(projectVersion: str, \
|
||||||
if accountMaxPostsPerDay>0 or domainMaxPostsPerDay>0:
|
if accountMaxPostsPerDay>0 or domainMaxPostsPerDay>0:
|
||||||
pprint(quotas)
|
pprint(quotas)
|
||||||
|
|
||||||
print('Obtaining public key for '+queueJson['id'])
|
print('Obtaining public key for actor '+queueJson['actor'])
|
||||||
|
|
||||||
# Try a few times to obtain the public key
|
# Try a few times to obtain the public key
|
||||||
pubKey=None
|
pubKey=None
|
||||||
|
|
Loading…
Reference in New Issue