From 78006478858fe074ecea4224063c0e6fc156ce4e Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 25 Jan 2015 13:07:31 +0100 Subject: otr: switch to the otr-state the partner alternate. should also fixed #877 --- src/main/java/eu/siacs/conversations/parser/MessageParser.java | 2 ++ src/main/java/eu/siacs/conversations/ui/ConversationFragment.java | 1 + 2 files changed, 3 insertions(+) (limited to 'src/main/java') diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java index bfe081cd..0f56f734 100644 --- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java +++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java @@ -102,8 +102,10 @@ public class MessageParser extends AbstractParser implements body = otrSession.transformReceiving(body); SessionStatus after = otrSession.getSessionStatus(); if ((before != after) && (after == SessionStatus.ENCRYPTED)) { + conversation.setNextEncryption(Message.ENCRYPTION_OTR); mXmppConnectionService.onOtrSessionEstablished(conversation); } else if ((before != after) && (after == SessionStatus.FINISHED)) { + conversation.setNextEncryption(Message.ENCRYPTION_NONE); conversation.resetOtrSession(); mXmppConnectionService.updateConversationUi(); } diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index c1e02400..49b6d0fb 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -298,6 +298,7 @@ public class ConversationFragment extends Fragment { default: break; } + getActivity().invalidateOptionsMenu(); } } -- cgit v1.2.3