From 94933e21cd08c53a23e5ec6c12bc1dc383b1f3ce Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Fri, 29 Jul 2016 19:52:37 +0200 Subject: changed package id inside manifest and project --- .../eu/siacs/conversations/entities/Roster.java | 96 ---------------------- 1 file changed, 96 deletions(-) delete mode 100644 src/main/java/eu/siacs/conversations/entities/Roster.java (limited to 'src/main/java/eu/siacs/conversations/entities/Roster.java') diff --git a/src/main/java/eu/siacs/conversations/entities/Roster.java b/src/main/java/eu/siacs/conversations/entities/Roster.java deleted file mode 100644 index d3ad91816..000000000 --- a/src/main/java/eu/siacs/conversations/entities/Roster.java +++ /dev/null @@ -1,96 +0,0 @@ -package eu.siacs.conversations.entities; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; - -import eu.siacs.conversations.xmpp.jid.Jid; - -public class Roster { - final Account account; - final HashMap contacts = new HashMap<>(); - private String version = null; - - public Roster(Account account) { - this.account = account; - } - - public Contact getContactFromRoster(Jid jid) { - if (jid == null) { - return null; - } - synchronized (this.contacts) { - Contact contact = contacts.get(jid.toBareJid()); - if (contact != null && contact.showInRoster()) { - return contact; - } else { - return null; - } - } - } - - public Contact getContact(final Jid jid) { - synchronized (this.contacts) { - if (!contacts.containsKey(jid.toBareJid())) { - Contact contact = new Contact(jid.toBareJid()); - contact.setAccount(account); - contacts.put(contact.getJid().toBareJid(), contact); - return contact; - } - return contacts.get(jid.toBareJid()); - } - } - - public void clearPresences() { - for (Contact contact : getContacts()) { - contact.clearPresences(); - } - } - - public void markAllAsNotInRoster() { - for (Contact contact : getContacts()) { - contact.resetOption(Contact.Options.IN_ROSTER); - } - } - - public List getWithSystemAccounts() { - List with = getContacts(); - for(Iterator iterator = with.iterator(); iterator.hasNext();) { - Contact contact = iterator.next(); - if (contact.getSystemAccount() == null) { - iterator.remove(); - } - } - return with; - } - - public List getContacts() { - synchronized (this.contacts) { - return new ArrayList<>(this.contacts.values()); - } - } - - public void initContact(final Contact contact) { - if (contact == null) { - return; - } - contact.setAccount(account); - contact.setOption(Contact.Options.IN_ROSTER); - synchronized (this.contacts) { - contacts.put(contact.getJid().toBareJid(), contact); - } - } - - public void setVersion(String version) { - this.version = version; - } - - public String getVersion() { - return this.version; - } - - public Account getAccount() { - return this.account; - } -} -- cgit v1.2.3