call messageSent() from UI thread after encrypting pgp message

This commit is contained in:
Daniel Gultsch 2017-03-19 20:15:07 +01:00
parent ce336690e2
commit 30ed6b3cec

View file

@ -1689,9 +1689,12 @@ public class ConversationActivity extends XmppActivity
public void success(Message message) {
message.setEncryption(Message.ENCRYPTION_DECRYPTED);
xmppConnectionService.sendMessage(message);
if (mConversationFragment != null) {
runOnUiThread(new Runnable() {
@Override
public void run() {
mConversationFragment.messageSent();
}
});
}
@Override
@ -1699,15 +1702,14 @@ public class ConversationActivity extends XmppActivity
runOnUiThread(new Runnable() {
@Override
public void run() {
mConversationFragment.doneSendingPgpMessage();
Toast.makeText(ConversationActivity.this,
R.string.unable_to_connect_to_keychain,
Toast.LENGTH_SHORT
).show();
}
});
if (mConversationFragment != null) {
mConversationFragment.doneSendingPgpMessage();
}
}
});
}