mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
m_addfriend_norequest now prevents you from adding your own id as friend.
This commit is contained in:
parent
edf799133c
commit
b0f9e6db6f
|
@ -220,6 +220,9 @@ int m_addfriend_norequest(Messenger *m, uint8_t *client_id)
|
||||||
if (realloc_friendlist(m, m->numfriends + 1) != 0)
|
if (realloc_friendlist(m, m->numfriends + 1) != 0)
|
||||||
return FAERR_NOMEM;
|
return FAERR_NOMEM;
|
||||||
|
|
||||||
|
if (memcmp(client_id, m->net_crypto->self_public_key, crypto_box_PUBLICKEYBYTES) == 0)
|
||||||
|
return FAERR_OWNKEY;
|
||||||
|
|
||||||
memset(&(m->friendlist[m->numfriends]), 0, sizeof(Friend));
|
memset(&(m->friendlist[m->numfriends]), 0, sizeof(Friend));
|
||||||
|
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user