diff --git a/src/callbackshandler.cpp b/src/callbackshandler.cpp index 687c461477c30169063bd27befb245a26fb176aa..ef616b27e173ca08d4115937a52748f9ecb6d3f3 100644 --- a/src/callbackshandler.cpp +++ b/src/callbackshandler.cpp @@ -263,10 +263,9 @@ CallbacksHandler::slotNewBuddySubscription(const QString& accountId, bool status, const QString& message) { - Q_UNUSED(accountId) Q_UNUSED(status) Q_UNUSED(message) - emit newBuddySubscription(uri, status); + emit newBuddySubscription(accountId, uri, status); } void diff --git a/src/callbackshandler.h b/src/callbackshandler.h index 8d64d2c074f2b30dfdd5115411cafe340e3ede32..b88c1c51b93dcf2c5ac9401e658227d24ec37a44 100644 --- a/src/callbackshandler.h +++ b/src/callbackshandler.h @@ -62,10 +62,11 @@ Q_SIGNALS: const MapStringString& payloads); /** * Connect this signal to get information when a peer is online. + * @param accountId related account. * @param contactUri the peer. * @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. * @param contactUri the peer. diff --git a/src/contactmodel.cpp b/src/contactmodel.cpp index bc5ef10f1817c8a0ce492efbcc8253cc6c70b0c0..632b386b07df04e7be1efead53da113e9f7b171d 100644 --- a/src/contactmodel.cpp +++ b/src/contactmodel.cpp @@ -123,10 +123,11 @@ public: public Q_SLOTS: /** * Listen CallbacksHandler when a presence update occurs + * @param accountId * @param contactUri * @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 @@ -714,8 +715,12 @@ ContactModelPimpl::fillWithJamiContacts() } 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_); auto it = contacts.find(contactUri);