when activating omemo in conference always check preferences

This commit is contained in:
Daniel Gultsch 2016-10-03 10:42:43 +02:00
parent dcd6ef8f84
commit 7c6d1d19d5
1 changed files with 14 additions and 14 deletions

View File

@ -660,24 +660,24 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded {
} }
public Pair<AxolotlCapability,Jid> isConversationAxolotlCapableDetailed(Conversation conversation) { public Pair<AxolotlCapability,Jid> isConversationAxolotlCapableDetailed(Conversation conversation) {
final List<Jid> jids = getCryptoTargets(conversation); if (conversation.getMucOptions().membersOnly() && conversation.getMucOptions().nonanonymous()) {
for(Jid jid : jids) { final List<Jid> jids = getCryptoTargets(conversation);
if (!hasAny(jid) && (!deviceIds.containsKey(jid) || deviceIds.get(jid).isEmpty())) { for(Jid jid : jids) {
if (conversation.getAccount().getRoster().getContact(jid).trusted()) { if (!hasAny(jid) && (!deviceIds.containsKey(jid) || deviceIds.get(jid).isEmpty())) {
return new Pair<>(AxolotlCapability.MISSING_KEYS,jid); if (conversation.getAccount().getRoster().getContact(jid).trusted()) {
} else { return new Pair<>(AxolotlCapability.MISSING_KEYS,jid);
return new Pair<>(AxolotlCapability.MISSING_PRESENCE,jid); } else {
return new Pair<>(AxolotlCapability.MISSING_PRESENCE,jid);
}
} }
} }
} if (jids.size() > 0) {
if (jids.size() > 0) { return new Pair<>(AxolotlCapability.FULL, null);
return new Pair<>(AxolotlCapability.FULL, null);
} else {
if (conversation.getMucOptions().membersOnly() && conversation.getMucOptions().nonanonymous()) {
return new Pair<>(AxolotlCapability.NO_MEMBERS, null);
} else { } else {
return new Pair<>(AxolotlCapability.WRONG_CONFIGURATION, null); return new Pair<>(AxolotlCapability.NO_MEMBERS, null);
} }
} else {
return new Pair<>(AxolotlCapability.WRONG_CONFIGURATION, null);
} }
} }