From 9d2d853e1b3b1f167be16ffe53530cbe83790ad1 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Thu, 3 Apr 2014 14:25:54 +0200 Subject: [PATCH] fixed #27 --- src/eu/siacs/conversations/ui/ManageAccountActivity.java | 6 +++++- src/eu/siacs/conversations/xmpp/XmppConnection.java | 3 ++- .../conversations/xmpp/stanzas/streammgmt/EnablePacket.java | 6 ++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/eu/siacs/conversations/ui/ManageAccountActivity.java b/src/eu/siacs/conversations/ui/ManageAccountActivity.java index 122c8eee3..e505bb416 100644 --- a/src/eu/siacs/conversations/ui/ManageAccountActivity.java +++ b/src/eu/siacs/conversations/ui/ManageAccountActivity.java @@ -468,7 +468,11 @@ public class ManageAccountActivity extends XmppActivity { try { xmppConnectionService.generatePgpAnnouncement(selectedAccountForActionMode); } catch (UserInputRequiredException e) { - Log.d("gultsch","already came back. ignoring"); + try { + startIntentSenderForResult(e.getPendingIntent().getIntentSender(), REQUEST_ANNOUNCE_PGP, null, 0, 0, 0); + } catch (SendIntentException e1) { + Log.d(LOGTAG,"sending intent failed"); + } } } } diff --git a/src/eu/siacs/conversations/xmpp/XmppConnection.java b/src/eu/siacs/conversations/xmpp/XmppConnection.java index 01a024dc1..e50ccd05f 100644 --- a/src/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/eu/siacs/conversations/xmpp/XmppConnection.java @@ -583,7 +583,8 @@ public class XmppConnection implements Runnable { .getContent().split("/")[1]; account.setResource(resource); if (streamFeatures.hasChild("sm")) { - EnablePacket enable = new EnablePacket(); + String xmlns = streamFeatures.findChild("sm").getAttribute("xmlns"); + EnablePacket enable = new EnablePacket(xmlns); tagWriter.writeStanzaAsync(enable); } sendInitialPresence(); diff --git a/src/eu/siacs/conversations/xmpp/stanzas/streammgmt/EnablePacket.java b/src/eu/siacs/conversations/xmpp/stanzas/streammgmt/EnablePacket.java index ae6a513aa..f6a0adb2d 100644 --- a/src/eu/siacs/conversations/xmpp/stanzas/streammgmt/EnablePacket.java +++ b/src/eu/siacs/conversations/xmpp/stanzas/streammgmt/EnablePacket.java @@ -9,5 +9,11 @@ public class EnablePacket extends AbstractStanza { this.setAttribute("xmlns","urn:xmpp:sm:3"); this.setAttribute("resume", "true"); } + + public EnablePacket(String xmlns) { + super("enable"); + this.setAttribute("xmlns",xmlns); + this.setAttribute("resume", "true"); + } }