From a55ddb889efb2645b5d72df23edca5bfdf4b8951 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 25 Apr 2014 23:14:43 +0200 Subject: [PATCH] fixed #75 --- src/eu/siacs/conversations/crypto/PgpEngine.java | 3 ++- src/eu/siacs/conversations/services/XmppConnectionService.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/eu/siacs/conversations/crypto/PgpEngine.java b/src/eu/siacs/conversations/crypto/PgpEngine.java index 869a84375..308a17d9a 100644 --- a/src/eu/siacs/conversations/crypto/PgpEngine.java +++ b/src/eu/siacs/conversations/crypto/PgpEngine.java @@ -118,11 +118,12 @@ public class PgpEngine { return 0; } - public String generateSignature(String status) + public String generateSignature(Account account, String status) throws UserInputRequiredException { Intent params = new Intent(); params.putExtra(OpenPgpApi.EXTRA_REQUEST_ASCII_ARMOR, true); params.setAction(OpenPgpApi.ACTION_SIGN); + params.putExtra(OpenPgpApi.EXTRA_ACCOUNT_NAME, account.getJid()); InputStream is = new ByteArrayInputStream(status.getBytes()); ByteArrayOutputStream os = new ByteArrayOutputStream(); Intent result = api.executeApi(params, is, os); diff --git a/src/eu/siacs/conversations/services/XmppConnectionService.java b/src/eu/siacs/conversations/services/XmppConnectionService.java index 981e6baa1..5b2480e05 100644 --- a/src/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/eu/siacs/conversations/services/XmppConnectionService.java @@ -1311,7 +1311,7 @@ public class XmppConnectionService extends Service { public void generatePgpAnnouncement(Account account) throws PgpEngine.UserInputRequiredException { if (account.getStatus() == Account.STATUS_ONLINE) { - String signature = getPgpEngine().generateSignature("online"); + String signature = getPgpEngine().generateSignature(account,"online"); account.setKey("pgp_signature", signature); databaseBackend.updateAccount(account); sendPgpPresence(account, signature);