MCPcopy Index your code
hub / github.com/Bitmessage/PyBitmessage / send

Method send

src/class_smtpServer.py:67–91  ·  view source on GitHub ↗
(self, fromAddress, toAddress, subject, message)

Source from the content-addressed store, hash-verified

65 self.channel = smtpServerChannel(self, conn, addr)
66
67 def send(self, fromAddress, toAddress, subject, message):
68 status, addressVersionNumber, streamNumber, ripe = decodeAddress(toAddress)
69 stealthLevel = BMConfigParser().safeGetInt('bitmessagesettings', 'ackstealthlevel')
70 ackdata = genAckPayload(streamNumber, stealthLevel)
71 t = ()
72 sqlExecute(
73 '''INSERT INTO sent VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)''',
74 '',
75 toAddress,
76 ripe,
77 fromAddress,
78 subject,
79 message,
80 ackdata,
81 int(time.time()), # sentTime (this will never change)
82 int(time.time()), # lastActionTime
83 0, # sleepTill time. This will get set when the POW gets done.
84 'msgqueued',
85 0, # retryNumber
86 'sent', # folder
87 2, # encodingtype
88 min(BMConfigParser().getint('bitmessagesettings', 'ttl'), 86400 * 2) # not necessary to have a TTL higher than 2 days
89 )
90
91 queues.workerQueue.put(('sendmessage', toAddress))
92
93 def decode_header(self, hdr):
94 ret = []

Callers 1

process_messageMethod · 0.95

Calls 6

decodeAddressFunction · 0.90
BMConfigParserClass · 0.90
genAckPayloadFunction · 0.90
sqlExecuteFunction · 0.90
safeGetIntMethod · 0.80
putMethod · 0.80

Tested by

no test coverage detected