aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-04-12 21:19:13 +0200
committerChristian Schneppe <christian@pix-art.de>2018-04-12 21:19:13 +0200
commitf1a68dfaa801a2d95727ad7691cfd50b1789f192 (patch)
treef06a625e9ce846fe221f30cf039438e5c32229b9 /src/main/java/de/pixart/messenger
parentbdf27d85ec984412c63df782b2dd66a365d10142 (diff)
fix getNextEncryption
Diffstat (limited to 'src/main/java/de/pixart/messenger')
-rw-r--r--src/main/java/de/pixart/messenger/entities/Conversation.java9
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationFragment.java14
2 files changed, 10 insertions, 13 deletions
diff --git a/src/main/java/de/pixart/messenger/entities/Conversation.java b/src/main/java/de/pixart/messenger/entities/Conversation.java
index 8e8d2a28a..91257c6ff 100644
--- a/src/main/java/de/pixart/messenger/entities/Conversation.java
+++ b/src/main/java/de/pixart/messenger/entities/Conversation.java
@@ -758,13 +758,14 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
defaultEncryption = Message.ENCRYPTION_NONE;
}
int encryption = this.getIntAttribute(ATTRIBUTE_NEXT_ENCRYPTION, defaultEncryption);
- // don't ignore OTR
- /*if (encryption == Message.ENCRYPTION_OTR) {
+
+ if (encryption == Message.ENCRYPTION_OTR) {
+ return encryption;
+ } else if (encryption < 0) {
return defaultEncryption;
} else {
return encryption;
- }*/
- return encryption;
+ }
}
public void setNextEncryption(int encryption) {
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
index 50fea03f7..dc64d26b3 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
@@ -1561,15 +1561,11 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
}
selectPresenceToAttachFile(attachmentChoice);
} else {
- final ConversationFragment fragment = (ConversationFragment) getFragmentManager()
- .findFragmentByTag("conversation");
- if (fragment != null) {
- fragment.showNoPGPKeyDialog(false, (dialog, which) -> {
- conversation.setNextEncryption(Message.ENCRYPTION_NONE);
- activity.xmppConnectionService.updateConversation(conversation);
- selectPresenceToAttachFile(attachmentChoice);
- });
- }
+ showNoPGPKeyDialog(false, (dialog, which) -> {
+ conversation.setNextEncryption(Message.ENCRYPTION_NONE);
+ activity.xmppConnectionService.updateConversation(conversation);
+ selectPresenceToAttachFile(attachmentChoice);
+ });
}
} else {
activity.showInstallPgpDialog();