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

presence: allow resubscription to presence


Change-Id: Ie0096fbead1c75e08eaa4a6e83d7741c839cb922
Reviewed-by: default avatarSébastien Blin <sebastien.blin@savoirfairelinux.com>
parent 56743ebf
No related branches found
No related tags found
No related merge requests found
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
#include "dbus/configurationmanager.h" #include "dbus/configurationmanager.h"
#include "dbus/callmanager.h" #include "dbus/callmanager.h"
#include "dbus/instancemanager.h" #include "dbus/instancemanager.h"
#include "dbus/presencemanager.h"
#include "codecmodel.h" #include "codecmodel.h"
#include "private/pendingcontactrequestmodel_p.h" #include "private/pendingcontactrequestmodel_p.h"
#include "person.h" #include "person.h"
...@@ -836,6 +837,21 @@ AccountModel::EditState AccountModel::editState() const ...@@ -836,6 +837,21 @@ AccountModel::EditState AccountModel::editState() const
return s_CurrentState; return s_CurrentState;
} }
///Client can call this to force subscribe/resubscribe to all buddies
void
AccountModel::subscribeToBuddies(const QString &accountId)
{
Account* account = getById(accountId.toLatin1());
if (account && account->protocol() == Account::Protocol::RING) {
const auto account_contacts = static_cast<QVector<QMap<QString, QString>>>(ConfigurationManager::instance().getContacts(accountId.toUtf8().constData()));
for (auto contact_info : account_contacts) {
PresenceManager::instance().subscribeBuddy(accountId,
contact_info["id"],
true);
}
}
}
///Called when codec bitrate changes ///Called when codec bitrate changes
void AccountModelPrivate::slotMediaParametersChanged(const QString& accountId) void AccountModelPrivate::slotMediaParametersChanged(const QString& accountId)
{ {
......
...@@ -79,6 +79,7 @@ public: ...@@ -79,6 +79,7 @@ public:
bool isIP2IPSupported ( ) const; bool isIP2IPSupported ( ) const;
bool isRingSupported ( ) const; bool isRingSupported ( ) const;
EditState editState ( ) const; EditState editState ( ) const;
void subscribeToBuddies (const QString &accountID ) ;
Account* selectedAccount ( ) const; Account* selectedAccount ( ) const;
QList<Account*> accountsToMigrate ( ) const; QList<Account*> accountsToMigrate ( ) const;
QVector<QMap<QString, QString>> getContacts (const Account* account ) const; QVector<QMap<QString, QString>> getContacts (const Account* account ) const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment