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