#Right now, PyBitmessage only support connecting to stream 1. It doesn't yet contain logic to expand into further streams.
softwareVersion='0.1.1'
softwareVersion='0.1.2'
verbose=2
maximumAgeOfAnObjectThatIAmWillingToAccept=216000#Equals two days and 12 hours.
lengthOfTimeToLeaveObjectsInInventory=237600#Equals two days and 18 hours. This should be longer than maximumAgeOfAnObjectThatIAmWillingToAccept so that we don't process messages twice.
@ -44,9 +44,10 @@ import random
importsqlite3
importthreading#used for the locks, not for the threads
importcStringIO
fromemail.parserimportParser
#from email.parser import Parser
fromtimeimportstrftime,localtime
importos
importstring
#For each stream to which we connect, one outgoingSynSender thread will exist and will create 8 connections with peers.
classoutgoingSynSender(QThread):
@ -476,9 +477,14 @@ class receiveDataThread(QThread):
print'fromAddress:',fromAddress
ifmessageEncodingType==2:
headers=Parser().parsestr(message)
subject=headers['subject']
body=headers['body']
bodyPositionIndex=string.find(message,'\nBody:')
print'bodyPositionIndex',bodyPositionIndex
ifbodyPositionIndex>1:
subject=message[8:bodyPositionIndex]
body=message[bodyPositionIndex+6:]
else:
subject=''
body=message
elifmessageEncodingType==1:
body=message
subject=''
@ -696,9 +702,13 @@ class receiveDataThread(QThread):
toLabel=addressInKeysFile
ifmessageEncodingType==2:
headers=Parser().parsestr(message)
subject=headers['subject']
body=headers['body']
bodyPositionIndex=string.find(message,'\nBody:')
ifbodyPositionIndex>1:
subject=message[8:bodyPositionIndex]
body=message[bodyPositionIndex+6:]
else:
subject=''
body=message
elifmessageEncodingType==1:
body=message
subject=''
@ -2453,10 +2463,9 @@ class MyForm(QtGui.QMainWindow):
#Below this point, it would be good if all of the necessary global data structures were initialized.
self.listOfOutgoingSynSenderThreads=[]#if we don't maintain this list, the threads will get garbage-collected.
self.connectToStream(1)
@ -2804,6 +2813,12 @@ class MyForm(QtGui.QMainWindow):
isEnabled=config.getboolean(addressInKeysFile,'enabled')#I realize that this is poor programming practice but I don't care. It's easier for others to read.