From 1994c3cd890ffed436e3a41bc4a1fb642b056b91 Mon Sep 17 00:00:00 2001 From: irungentoo Date: Tue, 24 Sep 2013 09:57:49 -0400 Subject: [PATCH] Possible bug fixed. --- toxcore/Messenger.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index f125c264..f22a8d57 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c @@ -516,8 +516,10 @@ static int send_userstatus(Messenger *m, int friendnumber, USERSTATUS status) static int send_ping(Messenger *m, int friendnumber) { - m->friendlist[friendnumber].ping_lastsent = unix_time(); - return write_cryptpacket_id(m, friendnumber, PACKET_ID_PING, 0, 0); + int ret = write_cryptpacket_id(m, friendnumber, PACKET_ID_PING, 0, 0); + if (ret == 1) + m->friendlist[friendnumber].ping_lastsent = unix_time(); + return ret; } static int set_friend_statusmessage(Messenger *m, int friendnumber, uint8_t *status, uint16_t length)