Link announce to web interface

master
Bob Mottram 2019-07-31 17:47:45 +01:00
parent 22e562bd59
commit 662cfe5744
2 changed files with 28 additions and 1 deletions

View File

@ -77,6 +77,7 @@ from utils import getNicknameFromActor
from utils import getDomainFromActor
from manualapprove import manualDenyFollowRequest
from manualapprove import manualApproveFollowRequest
from announce import createAnnounce
import os
import sys
@ -640,6 +641,33 @@ class PubServer(BaseHTTPRequestHandler):
self.server.GETbusy=False
return
if authorized and '?repeat=' in self.path:
repeatUrl=self.path.split('?repeat=')[1]
actor=self.path.split('?repeat=')[0]
self.postToNickname=getNicknameFromActor(actor)
if not self.server.session:
self.server.session= \
createSession(self.server.domain,self.server.port,self.server.useTor)
announceJson= \
createAnnounce(self.server.session, \
self.server.baseDir, \
self.server.federationList, \
self.postToNickname, \
self.server.domain,self.server.port, \
'https://www.w3.org/ns/activitystreams#Public', \
None,self.server.httpPrefix, \
repeatUrl,False,False, \
self.server.sendThreads, \
self.server.postLog, \
self.server.personCache, \
self.server.cachedWebfingers, \
self.server.debug)
if announceJson:
self._postToOutbox(announceJson)
self._redirect_headers(actor+'/inbox',cookie)
self.server.GETbusy=False
return
inReplyTo=None
if authorized and '?replyto=' in self.path:
inReplyTo=self.path.split('?replyto=')[1]

View File

@ -637,7 +637,6 @@ def htmlTimeline(session,baseDir: str,wfRequest: {},personCache: {}, \
tlStr+=individualPostAsHtml(baseDir,session,wfRequest,personCache, \
nickname,domain,port,item,None,True,showIndividualPostIcons)
tlStr+=htmlFooter()
print(tlStr)
return tlStr
def htmlInbox(session,baseDir: str,wfRequest: {},personCache: {}, \