aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/entities/Contact.java
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2016-02-28 21:48:09 +0100
committersteckbrief <steckbrief@chefmail.de>2016-02-28 21:48:09 +0100
commitcd0c6ce48e2ac36d9524908acbbc79690b193d9a (patch)
treee03621214377147d44a13917485baf16b607a11a /src/main/java/eu/siacs/conversations/entities/Contact.java
parent8fb6204288d55f8af16ae47e32fa6c049284cadd (diff)
parentc393e6089177f31683c4cecfdb359802de1b5e0c (diff)
Merge tag '1.10.1' into trz/merge_1.10.1
Conflicts: README.md build.gradle src/main/java/eu/siacs/conversations/entities/ListItem.java src/main/java/eu/siacs/conversations/parser/MessageParser.java src/main/java/eu/siacs/conversations/services/XmppConnectionService.java src/main/java/eu/siacs/conversations/ui/ConversationFragment.java src/main/res/menu/message_context.xml src/main/res/xml/preferences.xml
Diffstat (limited to 'src/main/java/eu/siacs/conversations/entities/Contact.java')
-rw-r--r--src/main/java/eu/siacs/conversations/entities/Contact.java19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/Contact.java b/src/main/java/eu/siacs/conversations/entities/Contact.java
index be6325e5..bdde12e3 100644
--- a/src/main/java/eu/siacs/conversations/entities/Contact.java
+++ b/src/main/java/eu/siacs/conversations/entities/Contact.java
@@ -46,7 +46,7 @@ public class Contact implements ListItem, Blockable {
protected String photoUri;
protected JSONObject keys = new JSONObject();
protected JSONArray groups = new JSONArray();
- protected Presences presences = new Presences();
+ protected final Presences presences = new Presences();
protected Account account;
protected Avatar avatar;
@@ -122,6 +122,17 @@ public class Contact implements ListItem, Blockable {
}
}
+ @Override
+ public String getDisplayJid() {
+ if (Config.LOCK_DOMAINS_IN_CONVERSATIONS && jid != null && jid.getDomainpart().equals(Config.DOMAIN_LOCK)) {
+ return jid.getLocalpart();
+ } else if (jid != null) {
+ return jid.toString();
+ } else {
+ return null;
+ }
+ }
+
public String getProfilePhoto() {
return this.photoUri;
}
@@ -228,10 +239,6 @@ public class Contact implements ListItem, Blockable {
return this.presences;
}
- public void setPresences(Presences pres) {
- this.presences = pres;
- }
-
public void updatePresence(final String resource, final Presence presence) {
this.presences.updatePresence(resource, presence);
}
@@ -392,11 +399,13 @@ public class Contact implements ListItem, Blockable {
this.resetOption(Options.TO);
this.setOption(Options.FROM);
this.resetOption(Options.PREEMPTIVE_GRANT);
+ this.resetOption(Options.PENDING_SUBSCRIPTION_REQUEST);
break;
case "both":
this.setOption(Options.TO);
this.setOption(Options.FROM);
this.resetOption(Options.PREEMPTIVE_GRANT);
+ this.resetOption(Options.PENDING_SUBSCRIPTION_REQUEST);
break;
case "none":
this.resetOption(Options.FROM);