aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/crypto
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-05-07 12:33:55 +0200
committerDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-05-07 12:33:55 +0200
commit955b7dbc7e56e2bf631a5ccf10ad306938511af4 (patch)
treec3762be120e65f33f361d6857f3fc7a6bb86aabe /src/eu/siacs/conversations/crypto
parent6b20a213b06d848fef583bee855e4bfb8e430837 (diff)
wee bit of code cleanup
Diffstat (limited to 'src/eu/siacs/conversations/crypto')
-rw-r--r--src/eu/siacs/conversations/crypto/PgpEngine.java10
1 files changed, 7 insertions, 3 deletions
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() {