diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-12-20 17:23:03 +0100 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-12-20 17:23:03 +0100 |
commit | 15176417132a88364efeb64713f8ac1267001cc4 (patch) | |
tree | 1603ac6d4ee9979a7de9b7763688b9925f60a7b9 /src/main/java/eu/siacs/conversations/entities | |
parent | ce4848f74225a59ddc8469a2a3e3481519c0f0d5 (diff) |
get rid of special self presence object and incorporate that into roster
Diffstat (limited to 'src/main/java/eu/siacs/conversations/entities')
-rw-r--r-- | src/main/java/eu/siacs/conversations/entities/Account.java | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/Account.java b/src/main/java/eu/siacs/conversations/entities/Account.java index 538d0ec2..d9001017 100644 --- a/src/main/java/eu/siacs/conversations/entities/Account.java +++ b/src/main/java/eu/siacs/conversations/entities/Account.java @@ -116,10 +116,9 @@ public class Account extends AbstractEntity { protected boolean online = false; private OtrEngine otrEngine = null; private XmppConnection xmppConnection = null; - private Presences presences = new Presences(); private long mEndGracePeriod = 0L; private String otrFingerprint; - private Roster roster = null; + private final Roster roster = new Roster(this); private List<Bookmark> bookmarks = new CopyOnWriteArrayList<>(); public Account() { @@ -328,20 +327,8 @@ public class Account extends AbstractEntity { this.rosterVersion = version; } - public void updatePresence(String resource, int status) { - this.presences.updatePresence(resource, status); - } - - public void removePresence(String resource) { - this.presences.removePresence(resource); - } - - public void clearPresences() { - this.presences = new Presences(); - } - public int countPresences() { - return this.presences.size(); + return this.getRoster().getContact(this.getJid().toBareJid()).getPresences().size(); } public String getPgpSignature() { @@ -357,9 +344,6 @@ public class Account extends AbstractEntity { } public Roster getRoster() { - if (this.roster == null) { - this.roster = new Roster(this); - } return this.roster; } |