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,6 +609,8 @@ public class Conversation extends AbstractEntity implements Blockable {
public int getNextEncryption() {
final AxolotlService axolotlService = getAccount().getAxolotlService();
int next = this.getIntAttribute(ATTRIBUTE_NEXT_ENCRYPTION, -1);
if (next == -1) {
if (Config.X509_VERIFICATION && mode == MODE_SINGLE) {
if (axolotlService != null && axolotlService.isContactAxolotlCapable(getContact())) {
return Message.ENCRYPTION_AXOLOTL;
@ -616,8 +618,6 @@ public class Conversation extends AbstractEntity implements Blockable {
return Message.ENCRYPTION_NONE;
}
}
int next = this.getIntAttribute(ATTRIBUTE_NEXT_ENCRYPTION, -1);
if (next == -1) {
int outgoing = this.getMostRecentlyUsedOutgoingEncryption();
if (outgoing == Message.ENCRYPTION_NONE) {
next = this.getMostRecentlyUsedIncomingEncryption();