1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Implement deleting a toxme address

This commit is contained in:
tux3 2015-02-20 01:09:32 +01:00
parent 1883b4e25e
commit ae877ccd6d
2 changed files with 12 additions and 0 deletions

View File

@ -125,3 +125,13 @@ bool Toxme::createAddress(ToxID id, QString address,
return (extractError(response) == 0);
}
bool Toxme::deleteAddress(ToxID id)
{
const QString payload{"{\"public_key\":\""+id.toString().left(64)+"\","
"\"timestamp\":"+QString().setNum(time(0))+"}"};
QByteArray response = makeJsonRequest(prepareEncryptedJson(2,payload));
return (extractError(response) == 0);
}

View File

@ -21,6 +21,8 @@ public:
/// The bio is a short optional description of yourself if you want to publish your address.
static bool createAddress(ToxID id, QString address,
bool keepPrivate=true, QString bio=QString());
/// Deletes the address associated with your current Tox ID
static bool deleteAddress(ToxID id);
private:
Toxme()=delete;