forked from blue/squawk
new fallback icons, new fields in vCard, fix about recreation new avatar on each request
This commit is contained in:
parent
36c71968bc
commit
566fc1f2fb
25 changed files with 629 additions and 205 deletions
|
@ -934,3 +934,23 @@ bool Models::Roster::groupHasContact(const QString& account, const QString& grou
|
|||
return gr->hasContact(contact);
|
||||
}
|
||||
}
|
||||
|
||||
QString Models::Roster::getContactIconPath(const QString& account, const QString& jid)
|
||||
{
|
||||
ElId id(account, jid);
|
||||
std::multimap<ElId, Contact*>::const_iterator cItr = contacts.find(id);
|
||||
QString path = "";
|
||||
if (cItr == contacts.end()) {
|
||||
std::map<ElId, Room*>::const_iterator rItr = rooms.find(id);
|
||||
if (rItr == rooms.end()) {
|
||||
qDebug() << "An attempt to get an icon path of non existing contact" << account << ":" << jid << ", returning empty value";
|
||||
} else {
|
||||
//path = rItr->second->getRoomName();
|
||||
}
|
||||
} else {
|
||||
if (cItr->second->getAvatarState() != Shared::Avatar::empty) {
|
||||
path = cItr->second->getAvatarPath();
|
||||
}
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
|
|
@ -73,6 +73,7 @@ public:
|
|||
|
||||
std::deque<QString> groupList(const QString& account) const;
|
||||
bool groupHasContact(const QString& account, const QString& group, const QString& contactJID) const;
|
||||
QString getContactIconPath(const QString& account, const QString& jid);
|
||||
|
||||
Accounts* accountsModel;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue