Skip to content
Snippets Groups Projects
Commit 3471a99e authored by Sébastien Blin's avatar Sébastien Blin Committed by Andreas Traczyk
Browse files

presence: do subscriptions in new models

Change-Id: Ide3be0bd204a06473f50808f16c2b28957bbde20
parent 90e6e57c
No related branches found
No related tags found
No related merge requests found
...@@ -541,7 +541,6 @@ ContactModelPimpl::fillsWithRINGContacts() { ...@@ -541,7 +541,6 @@ ContactModelPimpl::fillsWithRINGContacts() {
profileInfo.avatar = photo.toStdString(); profileInfo.avatar = photo.toStdString();
profileInfo.alias = alias.toStdString(); profileInfo.alias = alias.toStdString();
profileInfo.type = profile::Type::PENDING; profileInfo.type = profile::Type::PENDING;
contact::Info contactInfo; contact::Info contactInfo;
contactInfo.profileInfo = profileInfo; contactInfo.profileInfo = profileInfo;
contactInfo.registeredName = ""; contactInfo.registeredName = "";
...@@ -655,6 +654,9 @@ ContactModelPimpl::slotContactRemoved(const std::string& accountId, const std::s ...@@ -655,6 +654,9 @@ ContactModelPimpl::slotContactRemoved(const std::string& accountId, const std::s
emit behaviorController.trustRequestTreated(linked.owner.id, contactUri); emit behaviorController.trustRequestTreated(linked.owner.id, contactUri);
} }
if (contact->second.profileInfo.type != profile::Type::SIP)
PresenceManager::instance().subscribeBuddy(linked.owner.id.c_str(), contactUri.c_str(), false);
if (banned) { if (banned) {
contact->second.isBanned = true; contact->second.isBanned = true;
// Update bannedContacts index // Update bannedContacts index
...@@ -699,6 +701,7 @@ ContactModelPimpl::addToContacts(const std::string& contactId, const profile::Ty ...@@ -699,6 +701,7 @@ ContactModelPimpl::addToContacts(const std::string& contactId, const profile::Ty
if (type == profile::Type::RING) { if (type == profile::Type::RING) {
ConfigurationManager::instance().lookupAddress(QString::fromStdString(linked.owner.id), ConfigurationManager::instance().lookupAddress(QString::fromStdString(linked.owner.id),
"", QString::fromStdString(contactId)); "", QString::fromStdString(contactId));
PresenceManager::instance().subscribeBuddy(linked.owner.id.c_str(), contactId.c_str(), !banned);
} }
contactInfo.profileInfo.type = type; // Because PENDING should not be stored in the database contactInfo.profileInfo.type = type; // Because PENDING should not be stored in the database
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment