summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/isode')
-rw-r--r--src/com/isode/stroke/client/BlockListImpl.java24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/com/isode/stroke/client/BlockListImpl.java b/src/com/isode/stroke/client/BlockListImpl.java
index a85f86c..e8a4619 100644
--- a/src/com/isode/stroke/client/BlockListImpl.java
+++ b/src/com/isode/stroke/client/BlockListImpl.java
@@ -39,19 +39,19 @@ public class BlockListImpl extends BlockList {
return items;
}
- public void setItems(final Vector<JID> items) {
- for (final JID jid : this.items) {
- if(items.contains(jid)) {
- onItemRemoved.emit(jid);
- }
- }
+ public void setItems(final Vector<JID> newItems) {
+ for (final JID jid : items) {
+ if(!newItems.contains(jid)) {
+ onItemRemoved.emit(jid);
+ }
+ }
- for (final JID jid : items) {
- if(this.items.contains(jid)) {
- onItemAdded.emit(jid);
- }
- }
- this.items = items;
+ for (final JID jid : newItems) {
+ if(!this.items.contains(jid)) {
+ onItemAdded.emit(jid);
+ }
+ }
+ this.items = newItems;
}
public void addItem(final JID item) {