From 55ee288c36e6535c9fb89f15262af690185e4d57 Mon Sep 17 00:00:00 2001 From: agrajaghh Date: Sun, 16 Mar 2014 23:16:08 +0100 Subject: [PATCH] Refactor notification for encrypted messages. Closes #1184 --- .../thoughtcrime/securesms/notifications/MessageNotifier.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/org/thoughtcrime/securesms/notifications/MessageNotifier.java b/src/org/thoughtcrime/securesms/notifications/MessageNotifier.java index 9119510fcf..5594beb3d6 100644 --- a/src/org/thoughtcrime/securesms/notifications/MessageNotifier.java +++ b/src/org/thoughtcrime/securesms/notifications/MessageNotifier.java @@ -40,6 +40,7 @@ import android.util.Log; import org.thoughtcrime.securesms.R; import org.thoughtcrime.securesms.RoutingActivity; import org.thoughtcrime.securesms.crypto.MasterSecret; +import org.thoughtcrime.securesms.database.SmsDatabase; import org.thoughtcrime.securesms.database.DatabaseFactory; import org.thoughtcrime.securesms.database.MmsSmsDatabase; import org.thoughtcrime.securesms.database.PushDatabase; @@ -341,8 +342,7 @@ public class MessageNotifier { threadRecipients = DatabaseFactory.getThreadDatabase(context).getRecipientsForThreadId(threadId); } - // XXXX This is so fucked up. FIX ME! - if (body.toString().equals(context.getString(R.string.MessageDisplayHelper_decrypting_please_wait))) { + if (SmsDatabase.Types.isDecryptInProgressType(record.getType()) || !record.getBody().isPlaintext()) { body = new SpannableString(context.getString(R.string.MessageNotifier_encrypted_message)); body.setSpan(new StyleSpan(android.graphics.Typeface.ITALIC), 0, body.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); }