From 542cbef53ba4a62405d03cd08b1a6342d5c3cddc Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Sun, 20 Jul 2014 12:36:57 +0200 Subject: hide verify snackbar when otr session is ended. fixed npe --- src/eu/siacs/conversations/entities/Conversation.java | 3 +++ src/eu/siacs/conversations/parser/MessageParser.java | 1 + 2 files changed, 4 insertions(+) diff --git a/src/eu/siacs/conversations/entities/Conversation.java b/src/eu/siacs/conversations/entities/Conversation.java index e04d7bf8..83ea8931 100644 --- a/src/eu/siacs/conversations/entities/Conversation.java +++ b/src/eu/siacs/conversations/entities/Conversation.java @@ -291,6 +291,9 @@ public class Conversation extends AbstractEntity { public String getOtrFingerprint() { if (this.otrFingerprint == null) { try { + if (getOtrSession()== null) { + return ""; + } DSAPublicKey remotePubKey = (DSAPublicKey) getOtrSession() .getRemotePublicKey(); StringBuilder builder = new StringBuilder( diff --git a/src/eu/siacs/conversations/parser/MessageParser.java b/src/eu/siacs/conversations/parser/MessageParser.java index 60d8fc6b..1b03f4ee 100644 --- a/src/eu/siacs/conversations/parser/MessageParser.java +++ b/src/eu/siacs/conversations/parser/MessageParser.java @@ -80,6 +80,7 @@ public class MessageParser extends AbstractParser implements mXmppConnectionService.onOtrSessionEstablished(conversation); } else if ((before != after) && (after == SessionStatus.FINISHED)) { conversation.resetOtrSession(); + mXmppConnectionService.updateConversationUi(); } if ((body == null) || (body.isEmpty())) { return null; -- cgit v1.2.3