Fixed bug where TOX_FAERR_SETNEWNOSPAM would be returned instead of

TOX_FAERR_ALREADYSENT when re adding a confirmed friend.
This commit is contained in:
irungentoo 2014-04-01 16:36:33 -04:00
parent 4f1e02bafa
commit ce412b2c36
No known key found for this signature in database
GPG Key ID: 10349DC9BED89E98

View File

@ -234,6 +234,9 @@ int32_t m_addfriend(Messenger *m, uint8_t *address, uint8_t *data, uint16_t leng
int32_t friend_id = getfriend_id(m, client_id);
if (friend_id != -1) {
if (m->friendlist[friend_id].status >= FRIEND_CONFIRMED)
return FAERR_ALREADYSENT;
uint32_t nospam;
memcpy(&nospam, address + crypto_box_PUBLICKEYBYTES, sizeof(nospam));