Onionr/onionr/static-data/default-plugins/pms/loadinbox.py

13 lines
417 B
Python
Raw Permalink Normal View History

2019-03-02 19:17:18 +00:00
import onionrblockapi
def load_inbox(myCore):
inbox_list = []
deleted = myCore.keyStore.get('deleted_mail')
if deleted is None:
deleted = []
for blockHash in myCore.getBlocksByType('pm'):
block = onionrblockapi.Block(blockHash, core=myCore)
block.decrypt()
if block.decrypted and blockHash not in deleted:
inbox_list.append(blockHash)
return inbox_list