self.radioButtonSpecific.setText(_translate("MainWindow","Send to one or more specific people",None))
self.labelSendBroadcastWarning.setText(_translate("MainWindow","Be aware that broadcasts are only encrypted with your address. Anyone who knows your address can read them.",None))
self.radioButtonBroadcast.setText(_translate("MainWindow","Broadcast to everyone who is subscribed to your address",None))
self.textEditMessage.setHtml(_translate("MainWindow","<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\"\"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
self.labelSendBroadcastWarning.setText(_translate("MainWindow","Be aware that broadcasts are only encrypted with your address. Anyone who knows your address can read them.",None))
sqlExecute('''INSERT INTO pubkeys VALUES (?,?,?,?,?)''',*t)
self.possibleNewPubkey(ripe =ripe)
self.possibleNewPubkey(address)
ifaddressVersion==4:
iflen(data)<350:# sanity check.
@ -296,7 +298,7 @@ class objectProcessor(threading.Thread):
# At this point we know that we have been waiting on this pubkey.
# This function will command the workerThread to start work on
# the messages that require it.
self.possibleNewPubkey(address=toAddress)
self.possibleNewPubkey(toAddress)
# Display timing data
timeRequiredToProcessPubkey=time.time(
@ -325,8 +327,10 @@ class objectProcessor(threading.Thread):
ifdata[-32:]inshared.ackdataForWhichImWatching:
logger.info('This msg IS an acknowledgement bound for me.')
delshared.ackdataForWhichImWatching[data[-32:]]
sqlExecute('UPDATE sent SET status=? WHERE ackdata=?',
'ackreceived',data[-32:])
sqlExecute('UPDATE sent SET status=?, lastactiontime=? WHERE ackdata=?',
'ackreceived',
int(time.time()),
data[-32:])
shared.UISignalQueue.put(('updateSentItemStatusByAckdata',(data[-32:],tr.translateText("MainWindow",'Acknowledgement of the message received. %1').arg(l10n.formatTimestamp()))))
return
else:
@ -441,7 +445,7 @@ class objectProcessor(threading.Thread):
# person.
sqlExecute(
'''INSERT INTO pubkeys VALUES (?,?,?,?,?)''',
ripe.digest(),
fromAddress,
sendersAddressVersionNumber,
decryptedData[:endOfThePublicKeyPosition],
int(time.time()),
@ -450,10 +454,7 @@ class objectProcessor(threading.Thread):
# Check to see whether we happen to be awaiting this
# pubkey in order to send a message. If we are, it will do the POW
# and send it.
ifsendersAddressVersionNumber<=3:
self.possibleNewPubkey(ripe=ripe.digest())
elifsendersAddressVersionNumber>=4:
self.possibleNewPubkey(address=fromAddress)
self.possibleNewPubkey(fromAddress)
# If this message is bound for one of my version 3 addresses (or
# higher), then we must check to make sure it meets our demanded
@ -548,8 +549,25 @@ class objectProcessor(threading.Thread):
@ -801,8 +818,8 @@ class objectProcessor(threading.Thread):
"""
logger.info('We have been awaiting the arrival of this pubkey.')
sqlExecute(
'''UPDATE sent SET status='doingmsgpow' WHERE toripe=? AND (status='awaitingpubkey' or status='doingpubkeypow') and folder='sent'''',
ripe)
'''UPDATE sent SET status='doingmsgpow', retrynumber=0 WHERE toaddress=? AND (status='awaitingpubkey' or status='doingpubkeypow') AND folder='sent'''',
# Let us resend getpubkey objects if we have not yet heard a pubkey, and also msg objects if we have not yet heard an acknowledgement
queryreturn=sqlQuery(
'''select toaddress, toripe, fromaddress, subject, message, ackdata, lastactiontime, status, pubkeyretrynumber, msgretrynumber FROM sent WHERE ((status='awaitingpubkey' OR status='msgsent') AND folder='sent' AND lastactiontime>?) ''',
int(time.time())-shared.maximumLengthOfTimeToBotherResendingMessages)# If the message's folder='trash' then we'll ignore it.
'''select toaddress, ackdata, status FROM sent WHERE ((status='awaitingpubkey' OR status='msgsent') AND folder='sent' AND sleeptill<? AND senttime>?) ''',
# Let's also clear and reload shared.inventorySets to keep it from
# taking up an unnecessary amount of memory.
@ -126,32 +126,26 @@ class singleCleaner(threading.Thread):
time.sleep(300)
defresendPubkey(pubkeyretrynumber,toripe):
print'It has been a long time and we haven\'t heard a response to our getpubkey request. Sending again.'
defresendPubkeyRequest(address):
logger.debug('It has been a long time and we haven\'t heard a response to our getpubkey request. Sending again.')
try:
delshared.neededPubkeys[
toripe]# We need to take this entry out of the shared.neededPubkeys structure because the shared.workerQueue checks to see whether the entry is already present and will not do the POW and send the message because it assumes that it has already done it recently.
address]# We need to take this entry out of the shared.neededPubkeys structure because the shared.workerQueue checks to see whether the entry is already present and will not do the POW and send the message because it assumes that it has already done it recently.
except:
pass
shared.UISignalQueue.put((
'updateStatusBar','Doing work necessary to again attempt to request a public key...'))
t=()
sqlExecute(
'''UPDATE sent SET lastactiontime=?, pubkeyretrynumber=?, status='msgqueued' WHERE toripe=?''',
int(time.time()),
pubkeyretrynumber+1,
toripe)
'''UPDATE sent SET status='msgqueued' WHERE toaddress=?''',
address)
shared.workerQueue.put(('sendmessage',''))
defresendMsg(msgretrynumber,ackdata):
print'It has been a long time and we haven\'t heard an acknowledgement to our msg. Sending again.'
defresendMsg(ackdata):
logger.debug('It has been a long time and we haven\'t heard an acknowledgement to our msg. Sending again.')
sqlExecute(
'''UPDATE sent SET lastactiontime=?, msgretrynumber=?, status=? WHERE ackdata=?''',
int(time.time()),
msgretrynumber+1,
'msgqueued',
ackdata)
'''UPDATE sent SET status='msgqueued' WHERE ackdata=?''',
ackdata)
shared.workerQueue.put(('sendmessage',''))
shared.UISignalQueue.put((
'updateStatusBar','Doing work necessary to again attempt to deliver a message...'))