master
Bob Mottram 2019-08-22 17:15:02 +01:00
parent eacb37be48
commit 95218f9945
2 changed files with 11 additions and 10 deletions

View File

@ -2263,17 +2263,19 @@ class PubServer(BaseHTTPRequestHandler):
# also copy to the actors cache and personCache in memory # also copy to the actors cache and personCache in memory
storePersonInCache(self.server.baseDir,actorJson['id'],actorJson,self.server.personCache) storePersonInCache(self.server.baseDir,actorJson['id'],actorJson,self.server.personCache)
actorCacheFilename=self.server.baseDir+'/cache/actors/'+actorJson['id'].replace('/','#')+'.json' actorCacheFilename=self.server.baseDir+'/cache/actors/'+actorJson['id'].replace('/','#')+'.json'
pprint(actorJson)
print('*************************updating actor cache: '+actorCacheFilename)
with open(actorCacheFilename, 'w') as fp: with open(actorCacheFilename, 'w') as fp:
commentjson.dump(actorJson, fp, indent=4, sort_keys=False) commentjson.dump(actorJson, fp, indent=4, sort_keys=False)
# send actor update to followers # send actor update to followers
updateActorJson={ updateActorJson={
'type': 'Update', 'type': 'Update',
'actor': actorJson['id'], 'actor': actorJson['id'],
'to': ['https://www.w3.org/ns/activitystreams#Public'], 'to': ['https://www.w3.org/ns/activitystreams#Public'],
'object': actorJson 'object': actorJson
} }
self.postToNickname=nickname self.postToNickname=nickname
self._postToOutbox(updateActorJson) self._postToOutbox(updateActorJson)
self._redirect_headers(actorStr,cookie) self._redirect_headers(actorStr,cookie)
self.server.POSTbusy=False self.server.POSTbusy=False
return return

View File

@ -1130,7 +1130,6 @@ def individualPostAsHtml(baseDir: str, \
messageId=postJsonObject['id'].replace('/activity','') messageId=postJsonObject['id'].replace('/activity','')
preferredName=getPreferredName(postJsonObject['actor'],personCache) preferredName=getPreferredName(postJsonObject['actor'],personCache)
print('***************** getPreferredName: '+postJsonObject['actor']+ ' = '+preferredName)
if preferredName: if preferredName:
titleStr+='<a href="'+messageId+'">'+preferredName+'</a>' titleStr+='<a href="'+messageId+'">'+preferredName+'</a>'
else: else: