aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-06-15 13:53:34 +0200
committerChristian Schneppe <christian@pix-art.de>2016-06-19 20:02:12 +0200
commit018ee63ef49c504d8874aa4c122d2f9494473817 (patch)
tree299629155432a625545e06b3624037dc0eafe6ec /src/main/java/eu
parent2049593bfa141f5eb4a064d191ab8a8ee689f2ee (diff)
only dismiss sent message after encryption
Diffstat (limited to 'src/main/java/eu')
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationActivity.java21
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationFragment.java4
2 files changed, 16 insertions, 9 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
index b3a8b0141..db150a751 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
@@ -1752,21 +1752,30 @@ public class ConversationActivity extends XmppActivity
new UiCallback<Message>() {
@Override
- public void userInputRequried(PendingIntent pi,
- Message message) {
- ConversationActivity.this.runIntent(pi,
- ConversationActivity.REQUEST_SEND_MESSAGE);
+ public void userInputRequried(PendingIntent pi,Message message) {
+ ConversationActivity.this.runIntent(pi,ConversationActivity.REQUEST_SEND_MESSAGE);
}
@Override
public void success(Message message) {
message.setEncryption(Message.ENCRYPTION_DECRYPTED);
xmppConnectionService.sendMessage(message);
+ if (mConversationFragment != null) {
+ mConversationFragment.messageSent();
+ }
}
@Override
- public void error(int error, Message message) {
-
+ public void error(final int error, Message message) {
+ runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ Toast.makeText(ConversationActivity.this,
+ R.string.unable_to_connect_to_keychain,
+ Toast.LENGTH_SHORT
+ ).show();
+ }
+ });
}
});
}
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
index f0d13ea96..df11918f6 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
@@ -927,7 +927,7 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
}
}
- private void messageSent() {
+ protected void messageSent() {
mEditMessage.setText("");
updateChatMsgHint();
new Handler().post(new Runnable() {
@@ -1183,7 +1183,6 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
@Override
public void success(Contact contact) {
- messageSent();
activity.encryptTextMessage(message);
}
@@ -1221,7 +1220,6 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
warning.show();
}
activity.encryptTextMessage(message);
- messageSent();
} else {
showNoPGPKeyDialog(true,
new DialogInterface.OnClickListener() {