diff --git a/src/api/contactmodel.h b/src/api/contactmodel.h index b0abbc32edc667706f5a8f1407e3d990c6b7e528..0bacb15a45fc71ae13f2f33c4a4c636bd788545e 100644 --- a/src/api/contactmodel.h +++ b/src/api/contactmodel.h @@ -152,6 +152,12 @@ Q_SIGNALS: * @param transferInfo DataTransferInfo structure from daemon */ void newAccountTransfer(long long dringId, datatransfer::Info info) const; + /** + * Connect this signal to know when a contact is banned or unbanned + * @param contactUri + * @param banned whether contact was banned or unbanned + */ + void bannedStatusChanged(const std::string& contactUri, bool banned) const; private: std::unique_ptr<ContactModelPimpl> pimpl_; diff --git a/src/contactmodel.cpp b/src/contactmodel.cpp index 150f4cba3c013bb9fc49d4911a5e55e27501099d..a6dd776cc60b4ebeed132b682fdd335685e00d14 100644 --- a/src/contactmodel.cpp +++ b/src/contactmodel.cpp @@ -565,6 +565,7 @@ ContactModelPimpl::slotContactAdded(const std::string& accountId, const std::str if (isBanned) { // Update the smartlist linked.owner.conversationModel->refreshFilter(); + emit linked.bannedStatusChanged(contactUri, false); } else { emit linked.contactAdded(contactUri); } @@ -618,6 +619,7 @@ ContactModelPimpl::slotContactRemoved(const std::string& accountId, const std::s if (banned) { // Update the smartlist linked.owner.conversationModel->refreshFilter(); + emit linked.bannedStatusChanged(contactUri, true); } else { emit linked.contactRemoved(contactUri); }