|
|
|
@ -201,7 +201,7 @@ mesh::Packet* BaseChatMesh::composeMsgPacket(const ContactInfo& recipient, uint3 |
|
|
|
return createDatagram(PAYLOAD_TYPE_TXT_MSG, recipient.id, recipient.shared_secret, temp, 5 + text_len); |
|
|
|
} |
|
|
|
|
|
|
|
int BaseChatMesh::sendMessage(const ContactInfo& recipient, uint32_t timestamp, uint8_t attempt, const char* text, uint32_t& expected_ack) { |
|
|
|
int BaseChatMesh::sendMessage(const ContactInfo& recipient, uint32_t timestamp, uint8_t attempt, const char* text, uint32_t& expected_ack, uint32_t& est_timeout) { |
|
|
|
mesh::Packet* pkt = composeMsgPacket(recipient, timestamp, attempt, text, expected_ack); |
|
|
|
if (pkt == NULL) return MSG_SEND_FAILED; |
|
|
|
|
|
|
|
@ -210,11 +210,11 @@ int BaseChatMesh::sendMessage(const ContactInfo& recipient, uint32_t timestamp, |
|
|
|
int rc; |
|
|
|
if (recipient.out_path_len < 0) { |
|
|
|
sendFlood(pkt); |
|
|
|
txt_send_timeout = futureMillis(calcFloodTimeoutMillisFor(t)); |
|
|
|
txt_send_timeout = futureMillis(est_timeout = calcFloodTimeoutMillisFor(t)); |
|
|
|
rc = MSG_SEND_SENT_FLOOD; |
|
|
|
} else { |
|
|
|
sendDirect(pkt, recipient.out_path, recipient.out_path_len); |
|
|
|
txt_send_timeout = futureMillis(calcDirectTimeoutMillisFor(t, recipient.out_path_len)); |
|
|
|
txt_send_timeout = futureMillis(est_timeout = calcDirectTimeoutMillisFor(t, recipient.out_path_len)); |
|
|
|
rc = MSG_SEND_SENT_DIRECT; |
|
|
|
} |
|
|
|
return rc; |
|
|
|
|