aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/entities
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-11-09 16:21:13 +0100
committeriNPUTmice <daniel@gultsch.de>2014-11-09 16:21:13 +0100
commit377bd49ee807b9a06089ad5612ca15b9b00f2e36 (patch)
tree225e53c77c11377b4e64d65b5f33cf9c0c0858e6 /src/main/java/eu/siacs/conversations/entities
parent2b99b694eb25ed6ea82563d8a352be774ecc88d2 (diff)
refactored code to always contain full jid for counterpart
Diffstat (limited to 'src/main/java/eu/siacs/conversations/entities')
-rw-r--r--src/main/java/eu/siacs/conversations/entities/Conversation.java10
-rw-r--r--src/main/java/eu/siacs/conversations/entities/Message.java17
2 files changed, 5 insertions, 22 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/Conversation.java b/src/main/java/eu/siacs/conversations/entities/Conversation.java
index fdffeccb..c8dedd7b 100644
--- a/src/main/java/eu/siacs/conversations/entities/Conversation.java
+++ b/src/main/java/eu/siacs/conversations/entities/Conversation.java
@@ -55,7 +55,7 @@ public class Conversation extends AbstractEntity {
private JSONObject attributes = new JSONObject();
- private String nextPresence;
+ private Jid nextCounterpart;
protected ArrayList<Message> messages = new ArrayList<>();
protected Account account = null;
@@ -345,12 +345,12 @@ public class Conversation extends AbstractEntity {
this.contactJid = jid;
}
- public void setNextPresence(String presence) {
- this.nextPresence = presence;
+ public void setNextCounterpart(Jid jid) {
+ this.nextCounterpart = jid;
}
- public String getNextPresence() {
- return this.nextPresence;
+ public Jid getNextCounterpart() {
+ return this.nextCounterpart;
}
public int getLatestEncryption() {
diff --git a/src/main/java/eu/siacs/conversations/entities/Message.java b/src/main/java/eu/siacs/conversations/entities/Message.java
index f15b7527..550474bb 100644
--- a/src/main/java/eu/siacs/conversations/entities/Message.java
+++ b/src/main/java/eu/siacs/conversations/entities/Message.java
@@ -232,27 +232,10 @@ public class Message extends AbstractEntity {
return this.type;
}
- public void setPresence(String presence) {
- if (presence == null) {
- this.counterpart = this.counterpart.toBareJid();
- } else {
- try {
- this.counterpart = Jid.fromString(this.counterpart.toBareJid() + "/" + presence);
- } catch (final InvalidJidException ignored) {
- // TODO: Handle this?
- }
- }
- }
-
public void setTrueCounterpart(String trueCounterpart) {
this.trueCounterpart = trueCounterpart;
}
- public Jid getPresence() {
- // TODO: This is now the same as getCounterpart()... find usages in code and remove one?
- return counterpart;
- }
-
public void setDownloadable(Downloadable downloadable) {
this.downloadable = downloadable;
}