summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/Controllers/BlockListController.cpp')
-rw-r--r--Swift/Controllers/BlockListController.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/Swift/Controllers/BlockListController.cpp b/Swift/Controllers/BlockListController.cpp
index e7bc45d..6bdb513 100644
--- a/Swift/Controllers/BlockListController.cpp
+++ b/Swift/Controllers/BlockListController.cpp
@@ -145,11 +145,13 @@ void BlockListController::handleBlockListChanged() {
blockListBeforeEdit = blockListManager_->getBlockList()->getItems();
foreach (const JID& jid, jidsToBlock) {
- blockListBeforeEdit.push_back(jid);
+ if (std::find(blockListBeforeEdit.begin(), blockListBeforeEdit.end(), jid) == blockListBeforeEdit.end()) {
+ blockListBeforeEdit.push_back(jid);
+ }
}
foreach (const JID& jid, jidsToUnblock) {
- blockListBeforeEdit.erase(std::remove(blockListBeforeEdit.begin(), blockListBeforeEdit.end(), jid), blockListBeforeEdit.end());;
+ blockListBeforeEdit.erase(std::remove(blockListBeforeEdit.begin(), blockListBeforeEdit.end(), jid), blockListBeforeEdit.end());
}
blockListEditorWidget_->setCurrentBlockList(blockListBeforeEdit);