commit
17726e2433
|
@ -2060,7 +2060,7 @@ class singleCleaner(QThread):
|
||||||
sqlSubmitQueue.put('''UPDATE sent SET lastactiontime=?, pubkeyretrynumber=? WHERE toripe=?''')
|
sqlSubmitQueue.put('''UPDATE sent SET lastactiontime=?, pubkeyretrynumber=? WHERE toripe=?''')
|
||||||
sqlSubmitQueue.put(t)
|
sqlSubmitQueue.put(t)
|
||||||
sqlReturnQueue.get()
|
sqlReturnQueue.get()
|
||||||
#self.emit(SIGNAL("updateSentItemStatusByHash(PyQt_PyObject,PyQt_PyObject)"),toripe,'Public key requested again. ' + strftime(config.get('bitmessagesettings', 'timeformat'),localtime(int(time.time()))))
|
#self.emit(SIGNAL("updateSentItemStatusByHash(PyQt_PyObject,PyQt_PyObject)"),toripe,'Public key requested again. ' + unicode(strftime(config.get('bitmessagesettings', 'timeformat'),localtime(int(time.time())))))
|
||||||
else:# status == sentmessage
|
else:# status == sentmessage
|
||||||
if int(time.time()) - lastactiontime > (maximumAgeOfAnObjectThatIAmWillingToAccept * (2 ** (msgretrynumber))):
|
if int(time.time()) - lastactiontime > (maximumAgeOfAnObjectThatIAmWillingToAccept * (2 ** (msgretrynumber))):
|
||||||
print 'It has been a long time and we haven\'t heard an acknowledgement to our msg. Sending again.'
|
print 'It has been a long time and we haven\'t heard an acknowledgement to our msg. Sending again.'
|
||||||
|
@ -2068,7 +2068,7 @@ class singleCleaner(QThread):
|
||||||
sqlSubmitQueue.put('''UPDATE sent SET lastactiontime=?, msgretrynumber=?, status=? WHERE ackdata=?''')
|
sqlSubmitQueue.put('''UPDATE sent SET lastactiontime=?, msgretrynumber=?, status=? WHERE ackdata=?''')
|
||||||
sqlSubmitQueue.put(t)
|
sqlSubmitQueue.put(t)
|
||||||
sqlReturnQueue.get()
|
sqlReturnQueue.get()
|
||||||
#self.emit(SIGNAL("updateSentItemStatusByAckdata(PyQt_PyObject,PyQt_PyObject)"),ackdata,'Message sent again because the acknowledgement was never received. ' + strftime(config.get('bitmessagesettings', 'timeformat'),localtime(int(time.time()))))
|
#self.emit(SIGNAL("updateSentItemStatusByAckdata(PyQt_PyObject,PyQt_PyObject)"),ackdata,'Message sent again because the acknowledgement was never received. ' + unicode(strftime(config.get('bitmessagesettings', 'timeformat'),localtime(int(time.time())))))
|
||||||
workerQueue.put(('sendmessage',toaddress))
|
workerQueue.put(('sendmessage',toaddress))
|
||||||
self.emit(SIGNAL("updateStatusBar(PyQt_PyObject)"),"Doing work necessary to again attempt to deliver a message...")
|
self.emit(SIGNAL("updateStatusBar(PyQt_PyObject)"),"Doing work necessary to again attempt to deliver a message...")
|
||||||
sqlLock.release()
|
sqlLock.release()
|
||||||
|
@ -2298,7 +2298,7 @@ class singleWorker(QThread):
|
||||||
print 'sending inv (within sendBroadcast function)'
|
print 'sending inv (within sendBroadcast function)'
|
||||||
broadcastToSendDataQueues((streamNumber, 'sendinv', inventoryHash))
|
broadcastToSendDataQueues((streamNumber, 'sendinv', inventoryHash))
|
||||||
|
|
||||||
self.emit(SIGNAL("updateSentItemStatusByAckdata(PyQt_PyObject,PyQt_PyObject)"),ackdata,'Broadcast sent at '+strftime(config.get('bitmessagesettings', 'timeformat'),localtime(int(time.time()))))
|
self.emit(SIGNAL("updateSentItemStatusByAckdata(PyQt_PyObject,PyQt_PyObject)"),ackdata,'Broadcast sent at '+unicode(strftime(config.get('bitmessagesettings', 'timeformat'),localtime(int(time.time())))))
|
||||||
|
|
||||||
#Update the status of the message in the 'sent' table to have a 'broadcastsent' status
|
#Update the status of the message in the 'sent' table to have a 'broadcastsent' status
|
||||||
sqlLock.acquire()
|
sqlLock.acquire()
|
||||||
|
@ -2360,7 +2360,7 @@ class singleWorker(QThread):
|
||||||
print 'sending inv (within sendBroadcast function)'
|
print 'sending inv (within sendBroadcast function)'
|
||||||
broadcastToSendDataQueues((streamNumber, 'sendinv', inventoryHash))
|
broadcastToSendDataQueues((streamNumber, 'sendinv', inventoryHash))
|
||||||
|
|
||||||
self.emit(SIGNAL("updateSentItemStatusByAckdata(PyQt_PyObject,PyQt_PyObject)"),ackdata,'Broadcast sent at '+strftime(config.get('bitmessagesettings', 'timeformat'),localtime(int(time.time()))))
|
self.emit(SIGNAL("updateSentItemStatusByAckdata(PyQt_PyObject,PyQt_PyObject)"),ackdata,'Broadcast sent at '+unicode(strftime(config.get('bitmessagesettings', 'timeformat'),localtime(int(time.time())))))
|
||||||
|
|
||||||
#Update the status of the message in the 'sent' table to have a 'broadcastsent' status
|
#Update the status of the message in the 'sent' table to have a 'broadcastsent' status
|
||||||
sqlLock.acquire()
|
sqlLock.acquire()
|
||||||
|
@ -2551,7 +2551,7 @@ class singleWorker(QThread):
|
||||||
inventoryHash = calculateInventoryHash(payload)
|
inventoryHash = calculateInventoryHash(payload)
|
||||||
objectType = 'msg'
|
objectType = 'msg'
|
||||||
inventory[inventoryHash] = (objectType, toStreamNumber, payload, int(time.time()))
|
inventory[inventoryHash] = (objectType, toStreamNumber, payload, int(time.time()))
|
||||||
self.emit(SIGNAL("updateSentItemStatusByAckdata(PyQt_PyObject,PyQt_PyObject)"),ackdata,'Message sent. Waiting on acknowledgement. Sent on ' + strftime(config.get('bitmessagesettings', 'timeformat'),localtime(int(time.time()))))
|
self.emit(SIGNAL("updateSentItemStatusByAckdata(PyQt_PyObject,PyQt_PyObject)"),ackdata,'Message sent. Waiting on acknowledgement. Sent on ' + unicode(strftime(config.get('bitmessagesettings', 'timeformat'),localtime(int(time.time())))))
|
||||||
print 'sending inv (within sendmsg function)'
|
print 'sending inv (within sendmsg function)'
|
||||||
broadcastToSendDataQueues((streamNumber, 'sendinv', inventoryHash))
|
broadcastToSendDataQueues((streamNumber, 'sendinv', inventoryHash))
|
||||||
|
|
||||||
|
@ -2602,7 +2602,7 @@ class singleWorker(QThread):
|
||||||
broadcastToSendDataQueues((streamNumber, 'sendinv', inventoryHash))
|
broadcastToSendDataQueues((streamNumber, 'sendinv', inventoryHash))
|
||||||
|
|
||||||
self.emit(SIGNAL("updateStatusBar(PyQt_PyObject)"),'Broacasting the public key request. This program will auto-retry if they are offline.')
|
self.emit(SIGNAL("updateStatusBar(PyQt_PyObject)"),'Broacasting the public key request. This program will auto-retry if they are offline.')
|
||||||
self.emit(SIGNAL("updateSentItemStatusByHash(PyQt_PyObject,PyQt_PyObject)"),ripe,'Sending public key request. Waiting for reply. Requested at ' + strftime(config.get('bitmessagesettings', 'timeformat'),localtime(int(time.time()))))
|
self.emit(SIGNAL("updateSentItemStatusByHash(PyQt_PyObject,PyQt_PyObject)"),ripe,'Sending public key request. Waiting for reply. Requested at ' + unicode(strftime(config.get('bitmessagesettings', 'timeformat'),localtime(int(time.time())))))
|
||||||
|
|
||||||
def generateFullAckMessage(self,ackdata,toStreamNumber,embeddedTime):
|
def generateFullAckMessage(self,ackdata,toStreamNumber,embeddedTime):
|
||||||
nonce = 0
|
nonce = 0
|
||||||
|
@ -3598,7 +3598,7 @@ class MyForm(QtGui.QMainWindow):
|
||||||
newItem.setData(Qt.UserRole,unicode(message,'utf-8)'))
|
newItem.setData(Qt.UserRole,unicode(message,'utf-8)'))
|
||||||
newItem.setFlags( QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled )
|
newItem.setFlags( QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled )
|
||||||
self.ui.tableWidgetInbox.setItem(0,2,newItem)
|
self.ui.tableWidgetInbox.setItem(0,2,newItem)
|
||||||
newItem = myTableWidgetItem(strftime(config.get('bitmessagesettings', 'timeformat'),localtime(int(received))))
|
newItem = myTableWidgetItem(unicode(strftime(config.get('bitmessagesettings', 'timeformat'),localtime(int(received)))))
|
||||||
newItem.setData(Qt.UserRole,QByteArray(msgid))
|
newItem.setData(Qt.UserRole,QByteArray(msgid))
|
||||||
newItem.setData(33,int(received))
|
newItem.setData(33,int(received))
|
||||||
newItem.setFlags( QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled )
|
newItem.setFlags( QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled )
|
||||||
|
@ -3651,17 +3651,17 @@ class MyForm(QtGui.QMainWindow):
|
||||||
if status == 'findingpubkey':
|
if status == 'findingpubkey':
|
||||||
newItem = myTableWidgetItem('Waiting on their public key. Will request it again soon.')
|
newItem = myTableWidgetItem('Waiting on their public key. Will request it again soon.')
|
||||||
elif status == 'sentmessage':
|
elif status == 'sentmessage':
|
||||||
newItem = myTableWidgetItem('Message sent. Waiting on acknowledgement. Sent at ' + strftime(config.get('bitmessagesettings', 'timeformat'),localtime(lastactiontime)))
|
newItem = myTableWidgetItem('Message sent. Waiting on acknowledgement. Sent at ' + unicode(strftime(config.get('bitmessagesettings', 'timeformat'),localtime(lastactiontime))))
|
||||||
elif status == 'doingpow':
|
elif status == 'doingpow':
|
||||||
newItem = myTableWidgetItem('Need to do work to send message. Work is queued.')
|
newItem = myTableWidgetItem('Need to do work to send message. Work is queued.')
|
||||||
elif status == 'ackreceived':
|
elif status == 'ackreceived':
|
||||||
newItem = myTableWidgetItem('Acknowledgement of the message received ' + strftime(config.get('bitmessagesettings', 'timeformat'),localtime(int(lastactiontime))))
|
newItem = myTableWidgetItem('Acknowledgement of the message received ' + unicode(strftime(config.get('bitmessagesettings', 'timeformat'),localtime(int(lastactiontime)))))
|
||||||
elif status == 'broadcastpending':
|
elif status == 'broadcastpending':
|
||||||
newItem = myTableWidgetItem('Doing the work necessary to send broadcast...')
|
newItem = myTableWidgetItem('Doing the work necessary to send broadcast...')
|
||||||
elif status == 'broadcastsent':
|
elif status == 'broadcastsent':
|
||||||
newItem = myTableWidgetItem('Broadcast on ' + strftime(config.get('bitmessagesettings', 'timeformat'),localtime(int(lastactiontime))))
|
newItem = myTableWidgetItem('Broadcast on ' + unicode(strftime(config.get('bitmessagesettings', 'timeformat'),localtime(int(lastactiontime)))))
|
||||||
else:
|
else:
|
||||||
newItem = myTableWidgetItem('Unknown status. ' + strftime(config.get('bitmessagesettings', 'timeformat'),localtime(int(lastactiontime))))
|
newItem = myTableWidgetItem('Unknown status. ' + unicode(strftime(config.get('bitmessagesettings', 'timeformat'),localtime(int(lastactiontime)))))
|
||||||
newItem.setData(Qt.UserRole,QByteArray(ackdata))
|
newItem.setData(Qt.UserRole,QByteArray(ackdata))
|
||||||
newItem.setData(33,int(lastactiontime))
|
newItem.setData(33,int(lastactiontime))
|
||||||
newItem.setFlags( QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled )
|
newItem.setFlags( QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled )
|
||||||
|
@ -3721,7 +3721,7 @@ class MyForm(QtGui.QMainWindow):
|
||||||
#self.ui.pushButtonStatusIcon.setIcon(QIcon(":/newPrefix/images/yellowicon.png"))
|
#self.ui.pushButtonStatusIcon.setIcon(QIcon(":/newPrefix/images/yellowicon.png"))
|
||||||
self.statusbar = self.statusBar()
|
self.statusbar = self.statusBar()
|
||||||
self.statusbar.insertPermanentWidget(0,self.ui.pushButtonStatusIcon)
|
self.statusbar.insertPermanentWidget(0,self.ui.pushButtonStatusIcon)
|
||||||
self.ui.labelStartupTime.setText('Since startup on ' + strftime(config.get('bitmessagesettings', 'timeformat'),localtime(int(time.time()))))
|
self.ui.labelStartupTime.setText('Since startup on ' + unicode(strftime(config.get('bitmessagesettings', 'timeformat'),localtime(int(time.time())))))
|
||||||
self.numberOfMessagesProcessed = 0
|
self.numberOfMessagesProcessed = 0
|
||||||
self.numberOfBroadcastsProcessed = 0
|
self.numberOfBroadcastsProcessed = 0
|
||||||
self.numberOfPubkeysProcessed = 0
|
self.numberOfPubkeysProcessed = 0
|
||||||
|
@ -4072,7 +4072,7 @@ class MyForm(QtGui.QMainWindow):
|
||||||
newItem = QtGui.QTableWidgetItem(unicode(subject,'utf-8)'))
|
newItem = QtGui.QTableWidgetItem(unicode(subject,'utf-8)'))
|
||||||
newItem.setData(Qt.UserRole,unicode(message,'utf-8)'))
|
newItem.setData(Qt.UserRole,unicode(message,'utf-8)'))
|
||||||
self.ui.tableWidgetSent.setItem(0,2,newItem)
|
self.ui.tableWidgetSent.setItem(0,2,newItem)
|
||||||
newItem = myTableWidgetItem('Just pressed ''send'' '+strftime(config.get('bitmessagesettings', 'timeformat'),localtime(int(time.time()))))
|
newItem = myTableWidgetItem('Just pressed ''send'' ' + unicode(strftime(config.get('bitmessagesettings', 'timeformat'),localtime(int(time.time())))))
|
||||||
newItem.setData(Qt.UserRole,QByteArray(ackdata))
|
newItem.setData(Qt.UserRole,QByteArray(ackdata))
|
||||||
newItem.setData(33,int(time.time()))
|
newItem.setData(33,int(time.time()))
|
||||||
self.ui.tableWidgetSent.setItem(0,3,newItem)
|
self.ui.tableWidgetSent.setItem(0,3,newItem)
|
||||||
|
@ -4129,7 +4129,7 @@ class MyForm(QtGui.QMainWindow):
|
||||||
newItem = QtGui.QTableWidgetItem(unicode(subject,'utf-8)'))
|
newItem = QtGui.QTableWidgetItem(unicode(subject,'utf-8)'))
|
||||||
newItem.setData(Qt.UserRole,unicode(message,'utf-8)'))
|
newItem.setData(Qt.UserRole,unicode(message,'utf-8)'))
|
||||||
self.ui.tableWidgetSent.setItem(0,2,newItem)
|
self.ui.tableWidgetSent.setItem(0,2,newItem)
|
||||||
#newItem = QtGui.QTableWidgetItem('Doing work necessary to send broadcast...'+strftime(config.get('bitmessagesettings', 'timeformat'),localtime(int(time.time()))))
|
#newItem = QtGui.QTableWidgetItem('Doing work necessary to send broadcast...'+ unicode(strftime(config.get('bitmessagesettings', 'timeformat'),localtime(int(time.time())))))
|
||||||
newItem = myTableWidgetItem('Work is queued.')
|
newItem = myTableWidgetItem('Work is queued.')
|
||||||
newItem.setData(Qt.UserRole,QByteArray(ackdata))
|
newItem.setData(Qt.UserRole,QByteArray(ackdata))
|
||||||
newItem.setData(33,int(time.time()))
|
newItem.setData(33,int(time.time()))
|
||||||
|
@ -4234,8 +4234,8 @@ class MyForm(QtGui.QMainWindow):
|
||||||
newItem = QtGui.QTableWidgetItem(unicode(subject,'utf-8)'))
|
newItem = QtGui.QTableWidgetItem(unicode(subject,'utf-8)'))
|
||||||
newItem.setData(Qt.UserRole,unicode(message,'utf-8)'))
|
newItem.setData(Qt.UserRole,unicode(message,'utf-8)'))
|
||||||
self.ui.tableWidgetSent.setItem(0,2,newItem)
|
self.ui.tableWidgetSent.setItem(0,2,newItem)
|
||||||
#newItem = QtGui.QTableWidgetItem('Doing work necessary to send broadcast...'+strftime(config.get('bitmessagesettings', 'timeformat'),localtime(int(time.time()))))
|
#newItem = QtGui.QTableWidgetItem('Doing work necessary to send broadcast...'+ unicode(strftime(config.get('bitmessagesettings', 'timeformat'),localtime(int(time.time())))))
|
||||||
newItem = myTableWidgetItem('Work is queued. '+strftime(config.get('bitmessagesettings', 'timeformat'),localtime(int(time.time()))))
|
newItem = myTableWidgetItem('Work is queued. '+ unicode(strftime(config.get('bitmessagesettings', 'timeformat'),localtime(int(time.time())))))
|
||||||
newItem.setData(Qt.UserRole,QByteArray(ackdata))
|
newItem.setData(Qt.UserRole,QByteArray(ackdata))
|
||||||
newItem.setData(33,int(time.time()))
|
newItem.setData(33,int(time.time()))
|
||||||
self.ui.tableWidgetSent.setItem(0,3,newItem)
|
self.ui.tableWidgetSent.setItem(0,3,newItem)
|
||||||
|
@ -4300,7 +4300,7 @@ class MyForm(QtGui.QMainWindow):
|
||||||
newItem = QtGui.QTableWidgetItem(unicode(subject,'utf-8)'))
|
newItem = QtGui.QTableWidgetItem(unicode(subject,'utf-8)'))
|
||||||
newItem.setData(Qt.UserRole,unicode(message,'utf-8)'))
|
newItem.setData(Qt.UserRole,unicode(message,'utf-8)'))
|
||||||
self.ui.tableWidgetInbox.setItem(0,2,newItem)
|
self.ui.tableWidgetInbox.setItem(0,2,newItem)
|
||||||
newItem = myTableWidgetItem(strftime(config.get('bitmessagesettings', 'timeformat'),localtime(int(time.time()))))
|
newItem = myTableWidgetItem(unicode(strftime(config.get('bitmessagesettings', 'timeformat'),localtime(int(time.time())))))
|
||||||
newItem.setData(Qt.UserRole,QByteArray(inventoryHash))
|
newItem.setData(Qt.UserRole,QByteArray(inventoryHash))
|
||||||
newItem.setData(33,int(time.time()))
|
newItem.setData(33,int(time.time()))
|
||||||
self.ui.tableWidgetInbox.setItem(0,3,newItem)
|
self.ui.tableWidgetInbox.setItem(0,3,newItem)
|
||||||
|
|
|
@ -50,7 +50,7 @@ def readDefaultKnownNodes(appdata):
|
||||||
for stream, storedValue in knownNodes.items():
|
for stream, storedValue in knownNodes.items():
|
||||||
for host,value in storedValue.items():
|
for host,value in storedValue.items():
|
||||||
port, storedtime = storedValue[host]
|
port, storedtime = storedValue[host]
|
||||||
print host, '\t', port, '\t', strftime('%a, %d %b %Y %I:%M %p',localtime(storedtime))
|
print host, '\t', port, '\t', unicode(strftime('%a, %d %b %Y %I:%M %p',localtime(storedtime)))
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ def readPubkeys():
|
||||||
output = cur.fetchall()
|
output = cur.fetchall()
|
||||||
for row in output:
|
for row in output:
|
||||||
hash, havecorrectnonce, transmitdata, time, usedpersonally = row
|
hash, havecorrectnonce, transmitdata, time, usedpersonally = row
|
||||||
print 'Hash:', hash.encode('hex'), '\tHave correct nonce:', havecorrectnonce, '\tTime first broadcast:', strftime('%a, %d %b %Y %I:%M %p',localtime(time)), '\tUsed by me personally:', usedpersonally, '\tFull pubkey message:', transmitdata.encode('hex')
|
print 'Hash:', hash.encode('hex'), '\tHave correct nonce:', havecorrectnonce, '\tTime first broadcast:', unicode(strftime('%a, %d %b %Y %I:%M %p',localtime(time))), '\tUsed by me personally:', usedpersonally, '\tFull pubkey message:', transmitdata.encode('hex')
|
||||||
|
|
||||||
def readInventory():
|
def readInventory():
|
||||||
print 'Printing everything in inventory table:'
|
print 'Printing everything in inventory table:'
|
||||||
|
@ -69,7 +69,7 @@ def readInventory():
|
||||||
output = cur.fetchall()
|
output = cur.fetchall()
|
||||||
for row in output:
|
for row in output:
|
||||||
hash, objecttype, streamnumber, payload, receivedtime = row
|
hash, objecttype, streamnumber, payload, receivedtime = row
|
||||||
print 'Hash:', hash.encode('hex'), objecttype, streamnumber, '\t', payload.encode('hex'), '\t', strftime('%a, %d %b %Y %I:%M %p',localtime(receivedtime))
|
print 'Hash:', hash.encode('hex'), objecttype, streamnumber, '\t', payload.encode('hex'), '\t', unicode(strftime('%a, %d %b %Y %I:%M %p',localtime(receivedtime)))
|
||||||
|
|
||||||
|
|
||||||
def takeInboxMessagesOutOfTrash():
|
def takeInboxMessagesOutOfTrash():
|
||||||
|
|
Loading…
Reference in New Issue
Block a user