Skip to content
Snippets Groups Projects
Unverified Commit a0fafe5c authored by Sébastien Blin's avatar Sébastien Blin
Browse files

contactmodel: buddy subscriptions must check related account

Change-Id: I69a2e9f23b3a4cb5ce33bdcdb69fc2dce853d9f5
parent 87124a9d
Branches
No related tags found
No related merge requests found
...@@ -263,10 +263,9 @@ CallbacksHandler::slotNewBuddySubscription(const QString& accountId, ...@@ -263,10 +263,9 @@ CallbacksHandler::slotNewBuddySubscription(const QString& accountId,
bool status, bool status,
const QString& message) const QString& message)
{ {
Q_UNUSED(accountId)
Q_UNUSED(status) Q_UNUSED(status)
Q_UNUSED(message) Q_UNUSED(message)
emit newBuddySubscription(uri, status); emit newBuddySubscription(accountId, uri, status);
} }
void void
......
...@@ -62,10 +62,11 @@ Q_SIGNALS: ...@@ -62,10 +62,11 @@ Q_SIGNALS:
const MapStringString& payloads); const MapStringString& payloads);
/** /**
* Connect this signal to get information when a peer is online. * Connect this signal to get information when a peer is online.
* @param accountId related account.
* @param contactUri the peer. * @param contactUri the peer.
* @param present if the peer is online. * @param present if the peer is online.
*/ */
void newBuddySubscription(const QString& contactUri, bool present); void newBuddySubscription(const QString& accountId, const QString& contactUri, bool present);
/** /**
* Connect this signal to get information when peer discovery changes. * Connect this signal to get information when peer discovery changes.
* @param contactUri the peer. * @param contactUri the peer.
......
...@@ -123,10 +123,11 @@ public: ...@@ -123,10 +123,11 @@ public:
public Q_SLOTS: public Q_SLOTS:
/** /**
* Listen CallbacksHandler when a presence update occurs * Listen CallbacksHandler when a presence update occurs
* @param accountId
* @param contactUri * @param contactUri
* @param status * @param status
*/ */
void slotNewBuddySubscription(const QString& uri, bool status); void slotNewBuddySubscription(const QString& accountId, const QString& uri, bool status);
/** /**
* Listen CallbacksHandler when a contact is added * Listen CallbacksHandler when a contact is added
...@@ -714,8 +715,12 @@ ContactModelPimpl::fillWithJamiContacts() ...@@ -714,8 +715,12 @@ ContactModelPimpl::fillWithJamiContacts()
} }
void void
ContactModelPimpl::slotNewBuddySubscription(const QString& contactUri, bool status) ContactModelPimpl::slotNewBuddySubscription(const QString& accountId,
const QString& contactUri,
bool status)
{ {
if (accountId != linked.owner.id)
return;
{ {
std::lock_guard<std::mutex> lk(contactsMtx_); std::lock_guard<std::mutex> lk(contactsMtx_);
auto it = contacts.find(contactUri); auto it = contacts.find(contactUri);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment