예제 #1
0
/* send a text chat message to an online friend
   return the message id if packet was successfully put into the send queue
   return 0 if it was not */
uint32_t m_sendmessage(int friendnumber, uint8_t *message, uint32_t length)
{
    if (friendnumber < 0 || friendnumber >= numfriends)
        return 0;
    uint32_t msgid = ++friendlist[friendnumber].message_id;
    if (msgid == 0)
        msgid = 1; /* otherwise, false error */
    if(m_sendmessage_withid(friendnumber, msgid, message, length)) {
        return msgid;
    }
    
    return 0;
}
예제 #2
0
uint32_t tox_sendmessage_withid(void *tox, int friendnumber, uint32_t theid, uint8_t *message, uint32_t length)
{
    Messenger *m = tox;
    return m_sendmessage_withid(m, friendnumber, theid, message, length);
}
예제 #3
0
파일: tox.c 프로젝트: zan33/ProjectTox-Core
size_t tox_send_message_withid(Tox *tox, int friendnumber, size_t theid, size_t *message, size_t length)
{
    Messenger *m = tox;
    return m_sendmessage_withid(m, friendnumber, theid, message, length);
}