From 6c0db66a01eb13c574712d8ae9abc9de2c64b7fe Mon Sep 17 00:00:00 2001 From: Daniel Parnell Date: Sun, 11 Aug 2013 22:15:07 +1000 Subject: [PATCH] Fixed m_sendmessage to return the ID of the message sent --- core/Messenger.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/Messenger.c b/core/Messenger.c index 37ab5e2d..8c88c305 100644 --- a/core/Messenger.c +++ b/core/Messenger.c @@ -231,7 +231,11 @@ uint32_t m_sendmessage(int friendnumber, uint8_t *message, uint32_t length) uint32_t msgid = ++friendlist[friendnumber].message_id; if (msgid == 0) 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)