aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-10-16 16:09:54 +0200
committeriNPUTmice <daniel@gultsch.de>2014-10-16 16:09:54 +0200
commit0fd634ae52a0e6b8d58c88b687cffe9db7d39956 (patch)
tree2f4f3c19d30e549be4d34c188617d2f3e18a4318 /src/eu
parentc1a55608df588df12b562598e985f427cdd9a9db (diff)
simplified determination whether otr needs starting in a session
Diffstat (limited to 'src/eu')
-rw-r--r--src/eu/siacs/conversations/entities/Conversation.java9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/eu/siacs/conversations/entities/Conversation.java b/src/eu/siacs/conversations/entities/Conversation.java
index e29981fd..c984933f 100644
--- a/src/eu/siacs/conversations/entities/Conversation.java
+++ b/src/eu/siacs/conversations/entities/Conversation.java
@@ -72,8 +72,6 @@ public class Conversation extends AbstractEntity {
private byte[] symmetricKey;
- private boolean otrSessionNeedsStarting = false;
-
private Bookmark bookmark;
public Conversation(String name, Account account, String contactJid,
@@ -264,10 +262,7 @@ public class Conversation extends AbstractEntity {
try {
if (sendStart) {
this.otrSession.startSession();
- this.otrSessionNeedsStarting = false;
return this.otrSession;
- } else {
- this.otrSessionNeedsStarting = true;
}
return this.otrSession;
} catch (OtrException e) {
@@ -283,12 +278,12 @@ public class Conversation extends AbstractEntity {
public void resetOtrSession() {
this.otrFingerprint = null;
- this.otrSessionNeedsStarting = false;
this.otrSession = null;
}
public void startOtrIfNeeded() {
- if (this.otrSession != null && this.otrSessionNeedsStarting) {
+ if (this.otrSession != null
+ && this.otrSession.getSessionStatus() != SessionStatus.ENCRYPTED) {
try {
this.otrSession.startSession();
} catch (OtrException e) {