encrypt pgp messages to self

This commit is contained in:
Daniel Gultsch 2015-11-26 17:44:11 +01:00
parent fd6ed5b989
commit 23ef1c660a
1 changed files with 8 additions and 8 deletions

View File

@ -130,18 +130,18 @@ public class PgpEngine {
} }
} }
public void encrypt(final Message message, public void encrypt(final Message message, final UiCallback<Message> callback) {
final UiCallback<Message> callback) {
Intent params = new Intent(); Intent params = new Intent();
params.setAction(OpenPgpApi.ACTION_ENCRYPT); params.setAction(OpenPgpApi.ACTION_ENCRYPT);
if (message.getConversation().getMode() == Conversation.MODE_SINGLE) { final Conversation conversation = message.getConversation();
long[] keys = { message.getConversation().getContact() if (conversation.getMode() == Conversation.MODE_SINGLE) {
.getPgpKeyId() }; long[] keys = {
conversation.getContact().getPgpKeyId(),
conversation.getAccount().getPgpId()
};
params.putExtra(OpenPgpApi.EXTRA_KEY_IDS, keys); params.putExtra(OpenPgpApi.EXTRA_KEY_IDS, keys);
} else { } else {
params.putExtra(OpenPgpApi.EXTRA_KEY_IDS, message.getConversation() params.putExtra(OpenPgpApi.EXTRA_KEY_IDS, conversation.getMucOptions().getPgpKeyIds());
.getMucOptions().getPgpKeyIds());
} }
if (!message.needsUploading()) { if (!message.needsUploading()) {