From ac70966c41be612e5befccb836f82cb37ddfd184 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Wed, 24 Jul 2019 13:23:31 -0500 Subject: [PATCH] progress in removing core --- onionr/onionr.py | 2 +- onionr/onionrblocks/insert.py | 8 ++++---- onionr/onionrcommands/daemonlaunch.py | 4 ++-- onionr/static-data/default-plugins/pms/main.py | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/onionr/onionr.py b/onionr/onionr.py index 4d2d5886..c7f7adcf 100755 --- a/onionr/onionr.py +++ b/onionr/onionr.py @@ -348,7 +348,7 @@ class Onionr: Displays a "command not found" message ''' - logger.error('Command not found.', timestamp = False, terminal=True) + logger.error('Invalid command.', timestamp = False, terminal=True) def showHelpSuggestion(self): ''' diff --git a/onionr/onionrblocks/insert.py b/onionr/onionrblocks/insert.py index 041c21e5..175055fa 100644 --- a/onionr/onionrblocks/insert.py +++ b/onionr/onionrblocks/insert.py @@ -138,11 +138,11 @@ def insert_block(data, header='txt', sign=False, encryptType='', symKey='', asym pass coredb.blockmetadb.add.add_to_block_DB(retData, selfInsert=True, dataSaved=True) blockmetadata.process_block_metadata(retData) - ''' + if retData != False: if plaintextPeer == onionrvalues.DENIABLE_PEER_ADDRESS: - events.event('insertdeniable', {'content': plaintext, 'meta': plaintextMeta, 'hash': retData, 'peer': bytesconverter.bytes_to_str(asymPeer)}, onionr = self.onionrInst, threaded = True) + events.event('insertdeniable', {'content': plaintext, 'meta': plaintextMeta, 'hash': retData, 'peer': bytesconverter.bytes_to_str(asymPeer)}, threaded = True) else: - events.event('insertblock', {'content': plaintext, 'meta': plaintextMeta, 'hash': retData, 'peer': bytesconverter.bytes_to_str(asymPeer)}, onionr = self.onionrInst, threaded = True) - ''' + events.event('insertblock', {'content': plaintext, 'meta': plaintextMeta, 'hash': retData, 'peer': bytesconverter.bytes_to_str(asymPeer)}, threaded = True) + return retData \ No newline at end of file diff --git a/onionr/onionrcommands/daemonlaunch.py b/onionr/onionrcommands/daemonlaunch.py index 7785e20d..87ab28aa 100755 --- a/onionr/onionrcommands/daemonlaunch.py +++ b/onionr/onionrcommands/daemonlaunch.py @@ -126,13 +126,13 @@ def kill_daemon(o_inst): events.event('daemon_stop', onionr = o_inst) net = NetController(o_inst.config.get('client.port', 59496)) try: - daemonqueue.daemon_queue_qdd('shutdown') + daemonqueue.daemon_queue_add('shutdown') except sqlite3.OperationalError: pass net.killTor() except Exception as e: - logger.error('Failed to shutdown daemon.', error = e, timestamp = False, terminal=True) + logger.error('Failed to shutdown daemon: ' + str(e), error = e, timestamp = False, terminal=True) return def start(o_inst, input = False, override = False): diff --git a/onionr/static-data/default-plugins/pms/main.py b/onionr/static-data/default-plugins/pms/main.py index 523c7d39..48ec75b0 100755 --- a/onionr/static-data/default-plugins/pms/main.py +++ b/onionr/static-data/default-plugins/pms/main.py @@ -305,7 +305,7 @@ def add_deleted(keyStore, bHash): def on_insertblock(api, data={}): meta = json.loads(data['meta']) if meta['type'] == 'pm': - sentboxTools = sentboxdb.SentBox(api.get_core()) + sentboxTools = sentboxdb.SentBox() sentboxTools.addToSent(data['hash'], data['peer'], data['content'], meta['subject']) def on_init(api, data = None):