Commit 0c2c5a7c authored by mvogt's avatar mvogt

[libcontacts] Track whether contacts have valid IM accounts

Although QContactStatusFlags reports whether an account has any IM
accounts configured, we need to also know whether any of those accounts
are connected to valid telepathy accounts.
parent 380fa722
......@@ -1854,6 +1854,9 @@ bool SeasideCache::updateContactIndexing(const QContact &oldContact, const QCont
oldAddresses.insert(address);
}
// Keep track of whether this contact has any valid IM accounts
bool hasValid = false;
foreach (const QContactOnlineAccount &account, contact.details<QContactOnlineAccount>()) {
const StringPair address(addressPair(account));
if (!validAddressPair(address))
......@@ -1865,6 +1868,13 @@ bool SeasideCache::updateContactIndexing(const QContact &oldContact, const QCont
}
m_onlineAccountIds[address] = iid;
hasValid = true;
}
if (hasValid) {
item->statusFlags |= HasValidOnlineAccount;
} else {
item->statusFlags &= ~HasValidOnlineAccount;
}
if (!oldAddresses.isEmpty()) {
......
......@@ -117,6 +117,11 @@ public:
ContactComplete
};
enum {
// Must be after the highest bit used in QContactStatusFlags::Flag
HasValidOnlineAccount = (QContactStatusFlags::IsOnline << 1)
};
struct ItemData
{
virtual ~ItemData() {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment