Fixed m_sendmessage to return the ID of the message sent

This commit is contained in:
Daniel Parnell 2013-08-11 22:15:07 +10:00
parent e5e5ec6f57
commit 6c0db66a01

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)