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)
|
return Response(resp)
|
||||||
|
|
||||||
@app.route('/waitforshare/<name>', methods=['post'])
|
@app.route('/waitforshare/<name>', methods=['post'])
|
||||||
def waitforshare():
|
def waitforshare(name):
|
||||||
assert name.isalnum()
|
assert name.isalnum()
|
||||||
if name in self.publicAPI.hideBlocks:
|
if name in self.publicAPI.hideBlocks:
|
||||||
self.publicAPI.hideBlocks.remove(name)
|
self.publicAPI.hideBlocks.remove(name)
|
||||||
|
@ -454,6 +454,18 @@ class API:
|
||||||
@app.route('/getHumanReadable/<name>')
|
@app.route('/getHumanReadable/<name>')
|
||||||
def getHumanReadable(name):
|
def getHumanReadable(name):
|
||||||
return Response(self._core._utils.getHumanReadableID(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 = WSGIServer((self.host, bindPort), app, log=None, handler_class=FDSafeHandler)
|
||||||
self.httpServer.serve_forever()
|
self.httpServer.serve_forever()
|
||||||
|
|
|
@ -586,7 +586,7 @@ class OnionrCommunicatorDaemon:
|
||||||
proxyType = 'i2p'
|
proxyType = 'i2p'
|
||||||
logger.info("Uploading block to " + peer)
|
logger.info("Uploading block to " + peer)
|
||||||
if not self._core._utils.doPostRequest(url, data=data, proxyType=proxyType) == False:
|
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)
|
finishedUploads.append(bl)
|
||||||
for x in finishedUploads:
|
for x in finishedUploads:
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -832,7 +832,7 @@ class Core:
|
||||||
retData = False
|
retData = False
|
||||||
else:
|
else:
|
||||||
# Tell the api server through localCommand to wait for the daemon to upload this block to make stastical analysis more difficult
|
# 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.addToBlockDB(retData, selfInsert=True, dataSaved=True)
|
||||||
#self.setBlockType(retData, meta['type'])
|
#self.setBlockType(retData, meta['type'])
|
||||||
self._utils.processBlockMetadata(retData)
|
self._utils.processBlockMetadata(retData)
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
From: <input type='text' id='fromUser' readonly> Signature: <span id='sigValid'></span>
|
From: <input type='text' id='fromUser' readonly> Signature: <span id='sigValid'></span>
|
||||||
</div>
|
</div>
|
||||||
<div id='signatureValidity'></div>
|
<div id='signatureValidity'></div>
|
||||||
<div id='threadDisplay'>
|
<div id='threadDisplay' class='pre messageContent'>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -64,4 +64,14 @@ input{
|
||||||
|
|
||||||
.good{
|
.good{
|
||||||
color: greenyellow;
|
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