decrement counter on friend delete

This commit is contained in:
Jfreegman 2014-02-07 20:11:36 -05:00
parent e9f3477d69
commit 8b91493e32

View File

@ -273,6 +273,9 @@ int m_delfriend(Messenger *m, int friendnumber)
if (friend_not_valid(m, friendnumber)) if (friend_not_valid(m, friendnumber))
return -1; return -1;
if (m->friendlist[friendnumber].status == FRIEND_ONLINE)
--m->numonline_friends;
onion_delfriend(m->onion_c, m->friendlist[friendnumber].onion_friendnum); onion_delfriend(m->onion_c, m->friendlist[friendnumber].onion_friendnum);
crypto_kill(m->net_crypto, m->friendlist[friendnumber].crypt_connection_id); crypto_kill(m->net_crypto, m->friendlist[friendnumber].crypt_connection_id);
free(m->friendlist[friendnumber].statusmessage); free(m->friendlist[friendnumber].statusmessage);