This commit is contained in:
Daniel Gultsch 2014-04-03 14:25:54 +02:00
parent 24d6e8615c
commit 9d2d853e1b
3 changed files with 13 additions and 2 deletions

View file

@ -468,7 +468,11 @@ public class ManageAccountActivity extends XmppActivity {
try { try {
xmppConnectionService.generatePgpAnnouncement(selectedAccountForActionMode); xmppConnectionService.generatePgpAnnouncement(selectedAccountForActionMode);
} catch (UserInputRequiredException e) { } 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");
}
} }
} }
} }

View file

@ -583,7 +583,8 @@ public class XmppConnection implements Runnable {
.getContent().split("/")[1]; .getContent().split("/")[1];
account.setResource(resource); account.setResource(resource);
if (streamFeatures.hasChild("sm")) { if (streamFeatures.hasChild("sm")) {
EnablePacket enable = new EnablePacket(); String xmlns = streamFeatures.findChild("sm").getAttribute("xmlns");
EnablePacket enable = new EnablePacket(xmlns);
tagWriter.writeStanzaAsync(enable); tagWriter.writeStanzaAsync(enable);
} }
sendInitialPresence(); sendInitialPresence();

View file

@ -9,5 +9,11 @@ public class EnablePacket extends AbstractStanza {
this.setAttribute("xmlns","urn:xmpp:sm:3"); this.setAttribute("xmlns","urn:xmpp:sm:3");
this.setAttribute("resume", "true"); this.setAttribute("resume", "true");
} }
public EnablePacket(String xmlns) {
super("enable");
this.setAttribute("xmlns",xmlns);
this.setAttribute("resume", "true");
}
} }