Skip to content
Snippets Groups Projects
Commit 2a6d1153 authored by Emmanuel Lepage Vallée's avatar Emmanuel Lepage Vallée Committed by Nicolas Jager
Browse files

contactmethod: Add an `isDuplicate()` accessor


Will help makes some other algorithm saner

Change-Id: I5fae9bab47c6b508a95cf318c1a5a9fdb26d4bb3
Reviewed-by: default avatarNicolas Jäger <nicolas.jager@savoirfairelinux.com>
parent a1f07277
No related branches found
No related tags found
No related merge requests found
......@@ -439,6 +439,21 @@ QString ContactMethod::getBestId() const
return d_ptr->m_RegisteredName.isEmpty() ? d_ptr->m_Uri : d_ptr->m_RegisteredName;
}
/**
* Return if this ContactMethod pointer is the `master` one or a deduplicated
* proxy.
*
* Contact methods can be merged over time to avoid both the memory overhead
* and diverging statistics / presence / messaging. As explained in `merge()`,
* the old pointers are kept alive as they are proxies to the real object
* (d_ptr). This accessor helps some algorithm detect if they can safely get
* rid of this CM as a "better" one already exists (assuming the track all CMs).
*/
bool ContactMethod::isDuplicate() const
{
return d_ptr->m_lParents.first() != this;
}
///Is this number bookmarked
bool ContactMethod::isBookmarked() const
{
......
......@@ -133,6 +133,7 @@ public:
Certificate* certificate () const;
QString registeredName () const;
QString getBestId () const;
bool isDuplicate () const;
/*
* Returns roles associated on ContactMethod based on Call::Roles
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment