fixed broken waitforshare, work on mail, work on new plugin api endpoint
parent
b038d758b9
commit
64be7ebff3
|
@ -410,7 +410,7 @@ class API:
|
|||
return Response(resp)
|
||||
|
||||
@app.route('/waitforshare/<name>', methods=['post'])
|
||||
def waitforshare():
|
||||
def waitforshare(name):
|
||||
assert name.isalnum()
|
||||
if name in self.publicAPI.hideBlocks:
|
||||
self.publicAPI.hideBlocks.remove(name)
|
||||
|
@ -455,6 +455,18 @@ class API:
|
|||
def getHumanReadable(name):
|
||||
return Response(self._core._utils.getHumanReadableID(name))
|
||||
|
||||
@app.route('/apipoints/<path:subpath>')
|
||||
def pluginEndpoints(subpath=''):
|
||||
# TODO have a variable for the plugin to set data to that we can use for the response
|
||||
if len(subpath) > 1:
|
||||
data = subpath.split('/')
|
||||
if len(data) > 1:
|
||||
plName = data[0]
|
||||
events.event('pluginRequest', plName, subpath)
|
||||
else:
|
||||
abort(404)
|
||||
return Response('Success')
|
||||
|
||||
self.httpServer = WSGIServer((self.host, bindPort), app, log=None, handler_class=FDSafeHandler)
|
||||
self.httpServer.serve_forever()
|
||||
|
||||
|
|
|
@ -586,7 +586,7 @@ class OnionrCommunicatorDaemon:
|
|||
proxyType = 'i2p'
|
||||
logger.info("Uploading block to " + peer)
|
||||
if not self._core._utils.doPostRequest(url, data=data, proxyType=proxyType) == False:
|
||||
self._core._utils.localCommand('waitforshare/' + bl)
|
||||
self._core._utils.localCommand('waitforshare/' + bl, post=True)
|
||||
finishedUploads.append(bl)
|
||||
for x in finishedUploads:
|
||||
try:
|
||||
|
|
|
@ -832,7 +832,7 @@ class Core:
|
|||
retData = False
|
||||
else:
|
||||
# Tell the api server through localCommand to wait for the daemon to upload this block to make stastical analysis more difficult
|
||||
self._utils.localCommand('waitforshare/' + retData)
|
||||
self._utils.localCommand('/waitforshare/' + retData, post=True)
|
||||
self.addToBlockDB(retData, selfInsert=True, dataSaved=True)
|
||||
#self.setBlockType(retData, meta['type'])
|
||||
self._utils.processBlockMetadata(retData)
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
From: <input type='text' id='fromUser' readonly> Signature: <span id='sigValid'></span>
|
||||
</div>
|
||||
<div id='signatureValidity'></div>
|
||||
<div id='threadDisplay'>
|
||||
<div id='threadDisplay' class='pre messageContent'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -65,3 +65,13 @@ input{
|
|||
.good{
|
||||
color: greenyellow;
|
||||
}
|
||||
|
||||
.pre{
|
||||
padding-top: 1em;
|
||||
word-wrap: break-word;
|
||||
font-family: monospace;
|
||||
white-space: pre;
|
||||
}
|
||||
.messageContent{
|
||||
font-size: 1.5em;
|
||||
}
|
Loading…
Reference in New Issue