diff options
author | steckbrief <steckbrief@chefmail.de> | 2018-05-11 19:49:27 +0200 |
---|---|---|
committer | steckbrief <steckbrief@chefmail.de> | 2018-05-11 19:49:27 +0200 |
commit | bff97731deed4c599dcb6c3a2887c9f47165dd3f (patch) | |
tree | 1a1479be225fef127146f58d69f32a947c4d013e /src/main/java/de/thedevstack/conversationsplus/crypto/axolotl/AxolotlServiceImpl.java | |
parent | 1d8c547b447d68daf079d9db2b1d792fc631e462 (diff) |
introduces JidUtil for Jid creation, fixes duplication of childs while adding childs with xmlns and name
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/crypto/axolotl/AxolotlServiceImpl.java')
-rw-r--r-- | src/main/java/de/thedevstack/conversationsplus/crypto/axolotl/AxolotlServiceImpl.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/crypto/axolotl/AxolotlServiceImpl.java b/src/main/java/de/thedevstack/conversationsplus/crypto/axolotl/AxolotlServiceImpl.java index 3569a7a5..cdf78761 100644 --- a/src/main/java/de/thedevstack/conversationsplus/crypto/axolotl/AxolotlServiceImpl.java +++ b/src/main/java/de/thedevstack/conversationsplus/crypto/axolotl/AxolotlServiceImpl.java @@ -52,6 +52,7 @@ import de.thedevstack.conversationsplus.xmpp.jid.InvalidJidException; import de.thedevstack.conversationsplus.xmpp.jid.Jid; import de.thedevstack.conversationsplus.xmpp.stanzas.IqPacket; import de.thedevstack.conversationsplus.xmpp.stanzas.IqPacketReceiver; +import de.thedevstack.conversationsplus.xmpp.jid.JidUtil; public class AxolotlServiceImpl implements OnAdvancedStreamFeaturesLoaded, AxolotlService { @@ -166,7 +167,7 @@ public class AxolotlServiceImpl implements OnAdvancedStreamFeaturesLoaded, Axolo Bundle information = CryptoHelper.extractCertificateInformation(certificate); try { final String cn = information.getString("subject_cn"); - final Jid jid = Jid.fromString(bareJid); + final Jid jid = JidUtil.fromString(bareJid); Log.d(Config.LOGTAG,"setting common name for "+jid+" to "+cn); account.getRoster().getContact(jid).setCommonName(cn); } catch (final InvalidJidException ignored) { @@ -660,7 +661,7 @@ public class AxolotlServiceImpl implements OnAdvancedStreamFeaturesLoaded, Axolo final AxolotlAddress address = session.getRemoteAddress(); final IdentityKey identityKey = session.getIdentityKey(); try { - IqPacket packet = mXmppConnectionService.getIqGenerator().retrieveVerificationForDevice(Jid.fromString(address.getName()), address.getDeviceId()); + IqPacket packet = mXmppConnectionService.getIqGenerator().retrieveVerificationForDevice(JidUtil.fromString(address.getName()), address.getDeviceId()); mXmppConnectionService.sendIqPacket(account, packet, new OnIqPacketReceived() { @Override public void onIqPacketReceived(Account account, IqPacket packet) { @@ -681,7 +682,7 @@ public class AxolotlServiceImpl implements OnAdvancedStreamFeaturesLoaded, Axolo Bundle information = CryptoHelper.extractCertificateInformation(verification.first[0]); try { final String cn = information.getString("subject_cn"); - final Jid jid = Jid.fromString(address.getName()); + final Jid jid = JidUtil.fromString(address.getName()); Log.d(Config.LOGTAG,"setting common name for "+jid+" to "+cn); account.getRoster().getContact(jid).setCommonName(cn); } catch (final InvalidJidException ignored) { @@ -733,7 +734,7 @@ public class AxolotlServiceImpl implements OnAdvancedStreamFeaturesLoaded, Axolo try { IqPacket bundlesPacket = mXmppConnectionService.getIqGenerator().retrieveBundlesForDevice( - Jid.fromString(address.getName()), address.getDeviceId()); + JidUtil.fromString(address.getName()), address.getDeviceId()); Log.d(Config.LOGTAG, AxolotlServiceImpl.getLogprefix(account) + "Retrieving bundle: " + bundlesPacket); mXmppConnectionService.sendIqPacket(account, bundlesPacket, new OnIqPacketReceived() { |