Skip to content
Snippets Groups Projects
Commit 89c837d3 authored by Sébastien Blin's avatar Sébastien Blin
Browse files

account: add the ability to remove deamon contacts

Create a removeContact method to allow an account to remove contacts.

Change-Id: I7145f0ead20cd194a70e1978d1cb547a4898abb0
parent a9cc13be
Branches
No related tags found
No related merge requests found
......@@ -1434,6 +1434,34 @@ bool Account::sendContactRequest( Certificate* c )
return true;
}
bool Account::removeContact( const URI& uri )
{
if (uri.isEmpty())
return false;
ConfigurationManager::instance().removeContact(id(), uri, false);
return true;
}
bool Account::removeContact(const ContactMethod* c)
{
if (!c)
return false;
return removeContact(c->uri());
}
bool Account::removeContact( Certificate* c )
{
if ((!c) || (c->remoteId().isEmpty()))
return false;
ConfigurationManager::instance().removeContact(id(), c->remoteId(), false);
return true;
}
uint Account::internalId() const
{
return d_ptr->m_InternalId;
......
......@@ -482,6 +482,9 @@ class LIB_EXPORT Account : public ItemBase {
Q_INVOKABLE bool sendContactRequest(Certificate* c);
Q_INVOKABLE bool sendContactRequest(const ContactMethod* c);
Q_INVOKABLE bool sendContactRequest(const URI& uri);
Q_INVOKABLE bool removeContact(Certificate* c);
Q_INVOKABLE bool removeContact(const ContactMethod* c);
Q_INVOKABLE bool removeContact(const URI& uri);
Q_INVOKABLE QString accountDetail(const QString& param) const;
//Setters
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment