From 8b91493e3214e38ea146d301435813f1d994f08e Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Fri, 7 Feb 2014 20:11:36 -0500 Subject: [PATCH] decrement counter on friend delete --- toxcore/Messenger.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index f0415501..3b09baa2 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c @@ -273,6 +273,9 @@ int m_delfriend(Messenger *m, int friendnumber) if (friend_not_valid(m, friendnumber)) return -1; + if (m->friendlist[friendnumber].status == FRIEND_ONLINE) + --m->numonline_friends; + onion_delfriend(m->onion_c, m->friendlist[friendnumber].onion_friendnum); crypto_kill(m->net_crypto, m->friendlist[friendnumber].crypt_connection_id); free(m->friendlist[friendnumber].statusmessage);