Merge pull request #429 from dparnell/pristine

Fixed m_sendmessage to return the ID of the message sent
This commit is contained in:
irungentoo 2013-08-11 06:59:26 -07:00
commit 3a2d453165

View File

@ -231,7 +231,11 @@ uint32_t m_sendmessage(int friendnumber, uint8_t *message, uint32_t length)
uint32_t msgid = ++friendlist[friendnumber].message_id; uint32_t msgid = ++friendlist[friendnumber].message_id;
if (msgid == 0) if (msgid == 0)
msgid = 1; /* otherwise, false error */ msgid = 1; /* otherwise, false error */
return m_sendmessage_withid(friendnumber, msgid, message, length); if(m_sendmessage_withid(friendnumber, msgid, message, length)) {
return msgid;
}
return 0;
} }
uint32_t m_sendmessage_withid(int friendnumber, uint32_t theid, uint8_t *message, uint32_t length) uint32_t m_sendmessage_withid(int friendnumber, uint32_t theid, uint8_t *message, uint32_t length)