made our spanish friends happy. fixed #68

This commit is contained in:
Daniel Gultsch 2014-04-20 20:53:36 +02:00
parent d140ef6390
commit 04418484a2
1 changed files with 22 additions and 21 deletions

View File

@ -152,8 +152,10 @@ public class Contact extends AbstractEntity implements Serializable {
return false; return false;
} else { } else {
return (domainParts[0].equals("conf") return (domainParts[0].equals("conf")
|| domainParts[0].equals("conference") || domainParts[0] || domainParts[0].equals("conference")
.equals("muc")); || domainParts[0].equals("muc")
|| domainParts[0].equals("sala")
|| domainParts[0].equals("salas"));
} }
} }
} }
@ -198,7 +200,8 @@ public class Contact extends AbstractEntity implements Serializable {
Set<String> set = new HashSet<String>(); Set<String> set = new HashSet<String>();
try { try {
if (this.keys.has("otr_fingerprints")) { if (this.keys.has("otr_fingerprints")) {
JSONArray fingerprints = this.keys.getJSONArray("otr_fingerprints"); JSONArray fingerprints = this.keys
.getJSONArray("otr_fingerprints");
for (int i = 0; i < fingerprints.length(); ++i) { for (int i = 0; i < fingerprints.length(); ++i) {
set.add(fingerprints.getString(i)); set.add(fingerprints.getString(i));
} }
@ -262,7 +265,7 @@ public class Contact extends AbstractEntity implements Serializable {
String ask = item.getAttribute("ask"); String ask = item.getAttribute("ask");
String subscription = item.getAttribute("subscription"); String subscription = item.getAttribute("subscription");
if (subscription!=null) { if (subscription != null) {
if (subscription.equals("to")) { if (subscription.equals("to")) {
this.resetSubscriptionOption(Contact.Subscription.FROM); this.resetSubscriptionOption(Contact.Subscription.FROM);
this.setSubscriptionOption(Contact.Subscription.TO); this.setSubscriptionOption(Contact.Subscription.TO);
@ -275,14 +278,13 @@ public class Contact extends AbstractEntity implements Serializable {
} }
} }
if ((ask!=null)&&(ask.equals("subscribe"))) { if ((ask != null) && (ask.equals("subscribe"))) {
this.setSubscriptionOption(Contact.Subscription.ASKING); this.setSubscriptionOption(Contact.Subscription.ASKING);
} else { } else {
this.resetSubscriptionOption(Contact.Subscription.ASKING); this.resetSubscriptionOption(Contact.Subscription.ASKING);
} }
} }
public class Subscription { public class Subscription {
public static final int TO = 0; public static final int TO = 0;
public static final int FROM = 1; public static final int FROM = 1;
@ -290,7 +292,6 @@ public class Contact extends AbstractEntity implements Serializable {
public static final int PREEMPTIVE_GRANT = 4; public static final int PREEMPTIVE_GRANT = 4;
} }
public void flagAsNotInRoster() { public void flagAsNotInRoster() {
this.inRoster = false; this.inRoster = false;
} }