forked from blue/squawk
Now avatars are properly autogenerated, reduced vCard spam
This commit is contained in:
parent
93c5be412e
commit
0be2648849
9 changed files with 76 additions and 92 deletions
|
@ -98,13 +98,13 @@ void Core::RosterHandler::addedAccount(const QString& jid) {
|
|||
contact->setName(re.name());
|
||||
|
||||
if (newContact) {
|
||||
handleNewContact(contact);
|
||||
QMap<QString, QVariant> cData = contact->getInfo();
|
||||
#if (QXMPP_VERSION) >= QT_VERSION_CHECK(1, 5, 0)
|
||||
cData.insert("trust", QVariant::fromValue(acc->th->getSummary(jid)));
|
||||
#endif
|
||||
int grCount = 0;
|
||||
for (QSet<QString>::const_iterator itr = gr.begin(), end = gr.end(); itr != end; ++itr) {
|
||||
const QString& groupName = *itr;
|
||||
for (const QString& groupName : gr) {
|
||||
addToGroup(jid, groupName);
|
||||
emit acc->addContact(jid, groupName, cData);
|
||||
grCount++;
|
||||
|
@ -117,7 +117,6 @@ void Core::RosterHandler::addedAccount(const QString& jid) {
|
|||
acc->dm->requestInfo(jid);
|
||||
//acc->dm->requestItems(jid);
|
||||
}
|
||||
handleNewContact(contact);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -495,22 +494,23 @@ void Core::RosterHandler::removeContactFromGroupRequest(const QString& jid, cons
|
|||
if (itr == contacts.end()) {
|
||||
qDebug() << "An attempt to remove non existing contact" << lcJid << "of account"
|
||||
<< acc->name << "from the group" << groupName << ", skipping";
|
||||
return;
|
||||
}
|
||||
|
||||
QXmppRosterIq::Item item = acc->rm->getRosterEntry(lcJid);
|
||||
QSet<QString> groups = item.groups();
|
||||
QSet<QString>::const_iterator gItr = groups.find(groupName);
|
||||
if (gItr != groups.end()) {
|
||||
groups.erase(gItr);
|
||||
item.setGroups(groups);
|
||||
|
||||
QXmppRosterIq iq;
|
||||
iq.setType(QXmppIq::Set);
|
||||
iq.addItem(item);
|
||||
acc->client.sendPacket(iq);
|
||||
} else {
|
||||
QXmppRosterIq::Item item = acc->rm->getRosterEntry(lcJid);
|
||||
QSet<QString> groups = item.groups();
|
||||
QSet<QString>::const_iterator gItr = groups.find(groupName);
|
||||
if (gItr != groups.end()) {
|
||||
groups.erase(gItr);
|
||||
item.setGroups(groups);
|
||||
|
||||
QXmppRosterIq iq;
|
||||
iq.setType(QXmppIq::Set);
|
||||
iq.addItem(item);
|
||||
acc->client.sendPacket(iq);
|
||||
} else {
|
||||
qDebug() << "An attempt to remove contact" << lcJid << "of account"
|
||||
<< acc->name << "from the group" << groupName << "but it's not in that group, skipping";
|
||||
}
|
||||
qDebug() << "An attempt to remove contact" << lcJid << "of account"
|
||||
<< acc->name << "from the group" << groupName << "but it's not in that group, skipping";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue