From bff97731deed4c599dcb6c3a2887c9f47165dd3f Mon Sep 17 00:00:00 2001 From: steckbrief Date: Fri, 11 May 2018 19:49:27 +0200 Subject: introduces JidUtil for Jid creation, fixes duplication of childs while adding childs with xmlns and name --- .../de/thedevstack/conversationsplus/crypto/OtrService.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/main/java/de/thedevstack/conversationsplus/crypto/OtrService.java') diff --git a/src/main/java/de/thedevstack/conversationsplus/crypto/OtrService.java b/src/main/java/de/thedevstack/conversationsplus/crypto/OtrService.java index 34023d9f..56ee4dbc 100644 --- a/src/main/java/de/thedevstack/conversationsplus/crypto/OtrService.java +++ b/src/main/java/de/thedevstack/conversationsplus/crypto/OtrService.java @@ -35,6 +35,7 @@ import de.thedevstack.conversationsplus.xmpp.chatstate.ChatState; import de.thedevstack.conversationsplus.xmpp.jid.InvalidJidException; import de.thedevstack.conversationsplus.xmpp.jid.Jid; import de.thedevstack.conversationsplus.xmpp.stanzas.MessagePacket; +import de.thedevstack.conversationsplus.xmpp.jid.JidUtil; public class OtrService extends OtrCryptoEngineImpl implements OtrEngineHost { @@ -102,7 +103,7 @@ public class OtrService extends OtrCryptoEngineImpl implements OtrEngineHost { @Override public void askForSecret(SessionID id, InstanceTag instanceTag, String question) { try { - final Jid jid = Jid.fromSessionID(id); + final Jid jid = JidUtil.fromSessionID(id); Conversation conversation = this.mXmppConnectionService.find(this.account,jid); if (conversation!=null) { conversation.smp().hint = question; @@ -182,7 +183,7 @@ public class OtrService extends OtrCryptoEngineImpl implements OtrEngineHost { packet.setBody(body); MessageGenerator.addMessageHints(packet); try { - Jid jid = Jid.fromSessionID(session); + Jid jid = JidUtil.fromSessionID(session); Conversation conversation = mXmppConnectionService.find(account,jid); if (conversation != null && conversation.setOutgoingChatState(Config.DEFAULT_CHATSTATE)) { if (ConversationsPlusPreferences.chatStates()) { @@ -227,7 +228,7 @@ public class OtrService extends OtrCryptoEngineImpl implements OtrEngineHost { private void setSmpStatus(SessionID id, int status) { try { - final Jid jid = Jid.fromSessionID(id); + final Jid jid = JidUtil.fromSessionID(id); Conversation conversation = this.mXmppConnectionService.find(this.account,jid); if (conversation!=null) { conversation.smp().status = status; @@ -259,7 +260,7 @@ public class OtrService extends OtrCryptoEngineImpl implements OtrEngineHost { public void sendOtrErrorMessage(SessionID session, String errorText) { try { - Jid jid = Jid.fromSessionID(session); + Jid jid = JidUtil.fromSessionID(session); Conversation conversation = mXmppConnectionService.find(account, jid); String id = conversation == null ? null : conversation.getLastReceivedOtrMessageId(); if (id != null) { @@ -285,7 +286,7 @@ public class OtrService extends OtrCryptoEngineImpl implements OtrEngineHost { public void verify(SessionID id, String fingerprint, boolean approved) { Logging.d(Config.LOGTAG,"OtrService.verify("+id.toString()+","+fingerprint+","+String.valueOf(approved)+")"); try { - final Jid jid = Jid.fromSessionID(id); + final Jid jid = JidUtil.fromSessionID(id); Conversation conversation = this.mXmppConnectionService.find(this.account,jid); if (conversation!=null) { if (approved) { -- cgit v1.2.3