Show actor

master
Bob Mottram 2019-08-16 10:35:06 +01:00
parent 81d990c066
commit ce708fa7fa
2 changed files with 12 additions and 7 deletions

View File

@ -134,7 +134,7 @@ def readFollowList(filename: str):
return followlist
class PubServer(BaseHTTPRequestHandler):
protocol_version = 'HTTP/1.1'
protocol_version = 'HTTP/1.0'
def _login_headers(self,fileFormat: str,length: int) -> None:
self.send_response(200)

View File

@ -176,7 +176,9 @@ def savePostToInboxQueue(baseDir: str,httpPrefix: str,nickname: str, domain: str
# isn't written to file
postNickname=None
postDomain=None
actor=None
if postJsonObject.get('actor'):
actor=postJsonObject['actor']
postNickname=getNicknameFromActor(postJsonObject['actor'])
postDomain,postPort=getDomainFromActor(postJsonObject['actor'])
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 isFiltered(baseDir,nickname,domain,postJsonObject['object']['content']):
return None
originalPostId=None
if postJsonObject.get('id'):
postId=postJsonObject['id'].replace('/activity','')
else:
statusNumber,published = getStatusNumber()
postId=httpPrefix+'://'+originalDomain+'/users/'+nickname+'/statuses/'+statusNumber
originalPostId=postJsonObject['id'].replace('/activity','')
statusNumber,published = getStatusNumber()
postId=httpPrefix+'://'+originalDomain+'/users/'+nickname+'/statuses/'+statusNumber
postJsonObject['id']=postId
currTime=datetime.datetime.utcnow()
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
newQueueItem = {
'originalId': originalPostId,
'id': postId,
'actor': actor,
'nickname': nickname,
'domain': domain,
'postNickname': postNickname,
@ -1093,7 +1098,7 @@ def runInboxQueue(projectVersion: str, \
if accountMaxPostsPerDay>0 or domainMaxPostsPerDay>0:
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
pubKey=None