From ad960b393d04b22265b449abac05d5d5bf2eab8a Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Thu, 22 May 2014 12:57:47 +0200 Subject: [PATCH] implementet missing methods on the new roster mgmt --- src/eu/siacs/conversations/entities/Roster.java | 17 ++++++++++++++--- .../services/XmppConnectionService.java | 3 +++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/eu/siacs/conversations/entities/Roster.java b/src/eu/siacs/conversations/entities/Roster.java index 7c18d80a..1b4bc954 100644 --- a/src/eu/siacs/conversations/entities/Roster.java +++ b/src/eu/siacs/conversations/entities/Roster.java @@ -31,12 +31,23 @@ public class Roster { } public void clearPresences() { - // TODO Auto-generated method stub - + for(Contact contact : getContacts()) { + contact.clearPresences(); + } } public void markAllAsNotInRoster() { - + for(Contact contact : getContacts()) { + contact.resetOption(Contact.Options.IN_ROSTER); + } + } + + public void clearSystemAccounts() { + for(Contact contact : getContacts()) { + contact.setPhotoUri(null); + contact.setSystemName(null); + contact.setSystemAccount(null); + } } public List getContacts() { diff --git a/src/eu/siacs/conversations/services/XmppConnectionService.java b/src/eu/siacs/conversations/services/XmppConnectionService.java index 63ce6a5b..c01c7a1a 100644 --- a/src/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/eu/siacs/conversations/services/XmppConnectionService.java @@ -894,6 +894,9 @@ public class XmppConnectionService extends Service { new OnPhoneContactsLoadedListener() { @Override public void onPhoneContactsLoaded(List phoneContacts) { + for(Account account : accounts) { + account.getRoster().clearSystemAccounts(); + } for (Bundle phoneContact : phoneContacts) { for (Account account : accounts) { String jid = phoneContact.getString("jid");