From 955b7dbc7e56e2bf631a5ccf10ad306938511af4 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 7 May 2014 12:33:55 +0200 Subject: wee bit of code cleanup --- src/eu/siacs/conversations/crypto/PgpEngine.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/eu/siacs/conversations/crypto') diff --git a/src/eu/siacs/conversations/crypto/PgpEngine.java b/src/eu/siacs/conversations/crypto/PgpEngine.java index 35247ef2..5a51a1e8 100644 --- a/src/eu/siacs/conversations/crypto/PgpEngine.java +++ b/src/eu/siacs/conversations/crypto/PgpEngine.java @@ -15,6 +15,7 @@ import org.openintents.openpgp.util.OpenPgpApi; import org.openintents.openpgp.util.OpenPgpApi.IOpenPgpCallback; import eu.siacs.conversations.entities.Account; +import eu.siacs.conversations.entities.Contact; import eu.siacs.conversations.entities.Message; import eu.siacs.conversations.services.XmppConnectionService; import eu.siacs.conversations.xmpp.jingle.JingleFile; @@ -230,8 +231,11 @@ public class PgpEngine { return 0; } case OpenPgpApi.RESULT_CODE_USER_INTERACTION_REQUIRED: + Log.d("xmppService","openpgp user interaction requeried"); return 0; case OpenPgpApi.RESULT_CODE_ERROR: + Log.d("xmppService","openpgp error: "+((OpenPgpError) result + .getParcelableExtra(OpenPgpApi.RESULT_ERROR)).getMessage()); return 0; } return 0; @@ -272,11 +276,11 @@ public class PgpEngine { }); } - public void hasKey(Account account, long keyId, final OnPgpEngineResult callback) { + public void hasKey(Contact contact, final OnPgpEngineResult callback) { Intent params = new Intent(); params.setAction(OpenPgpApi.ACTION_GET_KEY); - params.putExtra(OpenPgpApi.EXTRA_KEY_ID, keyId); - params.putExtra(OpenPgpApi.EXTRA_ACCOUNT_NAME, account.getJid()); + params.putExtra(OpenPgpApi.EXTRA_KEY_ID, contact.getPgpKeyId()); + params.putExtra(OpenPgpApi.EXTRA_ACCOUNT_NAME, contact.getAccount().getJid()); InputStream is = new ByteArrayInputStream(new byte[0]); OutputStream os = new ByteArrayOutputStream(); api.executeApiAsync(params, is, os, new IOpenPgpCallback() { -- cgit v1.2.3