mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
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:
parent
4f1e02bafa
commit
ce412b2c36
|
@ -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);
|
int32_t friend_id = getfriend_id(m, client_id);
|
||||||
|
|
||||||
if (friend_id != -1) {
|
if (friend_id != -1) {
|
||||||
|
if (m->friendlist[friend_id].status >= FRIEND_CONFIRMED)
|
||||||
|
return FAERR_ALREADYSENT;
|
||||||
|
|
||||||
uint32_t nospam;
|
uint32_t nospam;
|
||||||
memcpy(&nospam, address + crypto_box_PUBLICKEYBYTES, sizeof(nospam));
|
memcpy(&nospam, address + crypto_box_PUBLICKEYBYTES, sizeof(nospam));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user