diff options
Diffstat (limited to 'toxcore/Messenger.c')
-rw-r--r-- | toxcore/Messenger.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index da326b88..81a347be 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c | |||
@@ -562,7 +562,7 @@ int m_set_statusmessage(Messenger *m, uint8_t *status, uint16_t length) | |||
562 | return 0; | 562 | return 0; |
563 | } | 563 | } |
564 | 564 | ||
565 | int m_set_userstatus(Messenger *m, USERSTATUS status) | 565 | int m_set_userstatus(Messenger *m, uint8_t status) |
566 | { | 566 | { |
567 | if (status >= USERSTATUS_INVALID) { | 567 | if (status >= USERSTATUS_INVALID) { |
568 | return -1; | 568 | return -1; |
@@ -616,12 +616,12 @@ int m_copy_self_statusmessage(Messenger *m, uint8_t *buf, uint32_t maxlen) | |||
616 | return MIN(maxlen, m->statusmessage_length); | 616 | return MIN(maxlen, m->statusmessage_length); |
617 | } | 617 | } |
618 | 618 | ||
619 | USERSTATUS m_get_userstatus(Messenger *m, int32_t friendnumber) | 619 | uint8_t m_get_userstatus(Messenger *m, int32_t friendnumber) |
620 | { | 620 | { |
621 | if (friend_not_valid(m, friendnumber)) | 621 | if (friend_not_valid(m, friendnumber)) |
622 | return USERSTATUS_INVALID; | 622 | return USERSTATUS_INVALID; |
623 | 623 | ||
624 | USERSTATUS status = m->friendlist[friendnumber].userstatus; | 624 | uint8_t status = m->friendlist[friendnumber].userstatus; |
625 | 625 | ||
626 | if (status >= USERSTATUS_INVALID) { | 626 | if (status >= USERSTATUS_INVALID) { |
627 | status = USERSTATUS_NONE; | 627 | status = USERSTATUS_NONE; |
@@ -630,7 +630,7 @@ USERSTATUS m_get_userstatus(Messenger *m, int32_t friendnumber) | |||
630 | return status; | 630 | return status; |
631 | } | 631 | } |
632 | 632 | ||
633 | USERSTATUS m_get_self_userstatus(Messenger *m) | 633 | uint8_t m_get_self_userstatus(Messenger *m) |
634 | { | 634 | { |
635 | return m->userstatus; | 635 | return m->userstatus; |
636 | } | 636 | } |
@@ -663,10 +663,9 @@ static int send_statusmessage(Messenger *m, int32_t friendnumber, uint8_t *statu | |||
663 | return write_cryptpacket_id(m, friendnumber, PACKET_ID_STATUSMESSAGE, status, length); | 663 | return write_cryptpacket_id(m, friendnumber, PACKET_ID_STATUSMESSAGE, status, length); |
664 | } | 664 | } |
665 | 665 | ||
666 | static int send_userstatus(Messenger *m, int32_t friendnumber, USERSTATUS status) | 666 | static int send_userstatus(Messenger *m, int32_t friendnumber, uint8_t status) |
667 | { | 667 | { |
668 | uint8_t stat = status; | 668 | return write_cryptpacket_id(m, friendnumber, PACKET_ID_USERSTATUS, &status, sizeof(status)); |
669 | return write_cryptpacket_id(m, friendnumber, PACKET_ID_USERSTATUS, &stat, sizeof(stat)); | ||
670 | } | 669 | } |
671 | 670 | ||
672 | static int send_user_istyping(Messenger *m, int32_t friendnumber, uint8_t is_typing) | 671 | static int send_user_istyping(Messenger *m, int32_t friendnumber, uint8_t is_typing) |
@@ -698,7 +697,7 @@ static int set_friend_statusmessage(Messenger *m, int32_t friendnumber, uint8_t | |||
698 | return 0; | 697 | return 0; |
699 | } | 698 | } |
700 | 699 | ||
701 | static void set_friend_userstatus(Messenger *m, int32_t friendnumber, USERSTATUS status) | 700 | static void set_friend_userstatus(Messenger *m, int32_t friendnumber, uint8_t status) |
702 | { | 701 | { |
703 | m->friendlist[friendnumber].userstatus = status; | 702 | m->friendlist[friendnumber].userstatus = status; |
704 | } | 703 | } |
@@ -756,7 +755,7 @@ void m_callback_statusmessage(Messenger *m, void (*function)(Messenger *m, int32 | |||
756 | m->friend_statuschange_userdata = userdata; | 755 | m->friend_statuschange_userdata = userdata; |
757 | } | 756 | } |
758 | 757 | ||
759 | void m_callback_userstatus(Messenger *m, void (*function)(Messenger *m, int32_t, USERSTATUS, void *), void *userdata) | 758 | void m_callback_userstatus(Messenger *m, void (*function)(Messenger *m, int32_t, uint8_t, void *), void *userdata) |
760 | { | 759 | { |
761 | m->friend_userstatuschange = function; | 760 | m->friend_userstatuschange = function; |
762 | m->friend_userstatuschange_userdata = userdata; | 761 | m->friend_userstatuschange_userdata = userdata; |