better new message handling, subscription with adding new contact, out of roster contacts handling

This commit is contained in:
Blue 2019-06-18 18:08:03 +03:00
parent bb509be29a
commit b2699e0087
11 changed files with 100 additions and 23 deletions

View file

@ -556,3 +556,13 @@ void Models::Roster::removeAccount(const QString& account)
acc->deleteLater();
}
QString Models::Roster::getContactName(const QString& account, const QString& jid)
{
std::multimap<ElId, Contact*>::const_iterator cItr = contacts.find({account, jid});
if (cItr == contacts.end()) {
qDebug() << "An attempt to get a name of non existing contact " << account << ":" << jid << ", skipping";
return "";
}
return cItr->second->getContactName();
}