From 0e5a0a07fd32d185d2d4c43df9494fafcace9208 Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Sat, 6 Sep 2014 18:21:31 +0200 Subject: made otr a little bit more solid when there is no presence subscription --- src/eu/siacs/conversations/ui/EditAccountActivity.java | 2 +- src/eu/siacs/conversations/ui/XmppActivity.java | 1 - src/eu/siacs/conversations/ui/adapter/MessageAdapter.java | 5 +++++ 3 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src/eu/siacs/conversations/ui') diff --git a/src/eu/siacs/conversations/ui/EditAccountActivity.java b/src/eu/siacs/conversations/ui/EditAccountActivity.java index 6cee8386..bc946115 100644 --- a/src/eu/siacs/conversations/ui/EditAccountActivity.java +++ b/src/eu/siacs/conversations/ui/EditAccountActivity.java @@ -325,7 +325,7 @@ public class EditAccountActivity extends XmppActivity { this.mServerInfoPep.setText(R.string.server_info_unavailable); } String fingerprint = this.mAccount - .getOtrFingerprint(getApplicationContext()); + .getOtrFingerprint(xmppConnectionService); if (fingerprint != null) { this.mOtrFingerprintHeadline.setVisibility(View.VISIBLE); this.mOtrFingerprint.setVisibility(View.VISIBLE); diff --git a/src/eu/siacs/conversations/ui/XmppActivity.java b/src/eu/siacs/conversations/ui/XmppActivity.java index 7d903e86..6ff83357 100644 --- a/src/eu/siacs/conversations/ui/XmppActivity.java +++ b/src/eu/siacs/conversations/ui/XmppActivity.java @@ -377,7 +377,6 @@ public abstract class XmppActivity extends Activity { Toast toast = Toast.makeText(this, R.string.missing_presence_updates, Toast.LENGTH_LONG); - toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0); toast.show(); } conversation.setNextPresence(null); diff --git a/src/eu/siacs/conversations/ui/adapter/MessageAdapter.java b/src/eu/siacs/conversations/ui/adapter/MessageAdapter.java index ccf25a33..074e38fb 100644 --- a/src/eu/siacs/conversations/ui/adapter/MessageAdapter.java +++ b/src/eu/siacs/conversations/ui/adapter/MessageAdapter.java @@ -495,6 +495,11 @@ public class MessageAdapter extends ArrayAdapter { } } else if (item.getEncryption() == Message.ENCRYPTION_DECRYPTION_FAILED) { displayDecryptionFailed(viewHolder); + } else if (item.getEncryption() == Message.ENCRYPTION_OTR + && item.getStatus() == Message.STATUS_RECEPTION_FAILED + && item.getType() == Message.TYPE_TEXT) { + displayInfoMessage(viewHolder, + R.string.unable_to_decrypt_otr_message); } else { displayTextMessage(viewHolder, item); } -- cgit v1.2.3