fixed stuck at omemo encryption when x509 verification is being used

This commit is contained in:
Daniel Gultsch 2015-12-27 17:29:19 +01:00
parent f49158a44b
commit bcf99db3df

View file

@ -609,15 +609,15 @@ public class Conversation extends AbstractEntity implements Blockable {
public int getNextEncryption() { public int getNextEncryption() {
final AxolotlService axolotlService = getAccount().getAxolotlService(); final AxolotlService axolotlService = getAccount().getAxolotlService();
if (Config.X509_VERIFICATION && mode == MODE_SINGLE) {
if (axolotlService != null && axolotlService.isContactAxolotlCapable(getContact())) {
return Message.ENCRYPTION_AXOLOTL;
} else {
return Message.ENCRYPTION_NONE;
}
}
int next = this.getIntAttribute(ATTRIBUTE_NEXT_ENCRYPTION, -1); int next = this.getIntAttribute(ATTRIBUTE_NEXT_ENCRYPTION, -1);
if (next == -1) { if (next == -1) {
if (Config.X509_VERIFICATION && mode == MODE_SINGLE) {
if (axolotlService != null && axolotlService.isContactAxolotlCapable(getContact())) {
return Message.ENCRYPTION_AXOLOTL;
} else {
return Message.ENCRYPTION_NONE;
}
}
int outgoing = this.getMostRecentlyUsedOutgoingEncryption(); int outgoing = this.getMostRecentlyUsedOutgoingEncryption();
if (outgoing == Message.ENCRYPTION_NONE) { if (outgoing == Message.ENCRYPTION_NONE) {
next = this.getMostRecentlyUsedIncomingEncryption(); next = this.getMostRecentlyUsedIncomingEncryption();