Refactor notification for encrypted messages.

Closes #1184
This commit is contained in:
agrajaghh 2014-03-16 23:16:08 +01:00 committed by Moxie Marlinspike
parent 1833e57c38
commit 55ee288c36

View File

@ -40,6 +40,7 @@ import android.util.Log;
import org.thoughtcrime.securesms.R; import org.thoughtcrime.securesms.R;
import org.thoughtcrime.securesms.RoutingActivity; import org.thoughtcrime.securesms.RoutingActivity;
import org.thoughtcrime.securesms.crypto.MasterSecret; import org.thoughtcrime.securesms.crypto.MasterSecret;
import org.thoughtcrime.securesms.database.SmsDatabase;
import org.thoughtcrime.securesms.database.DatabaseFactory; import org.thoughtcrime.securesms.database.DatabaseFactory;
import org.thoughtcrime.securesms.database.MmsSmsDatabase; import org.thoughtcrime.securesms.database.MmsSmsDatabase;
import org.thoughtcrime.securesms.database.PushDatabase; import org.thoughtcrime.securesms.database.PushDatabase;
@ -341,8 +342,7 @@ public class MessageNotifier {
threadRecipients = DatabaseFactory.getThreadDatabase(context).getRecipientsForThreadId(threadId); threadRecipients = DatabaseFactory.getThreadDatabase(context).getRecipientsForThreadId(threadId);
} }
// XXXX This is so fucked up. FIX ME! if (SmsDatabase.Types.isDecryptInProgressType(record.getType()) || !record.getBody().isPlaintext()) {
if (body.toString().equals(context.getString(R.string.MessageDisplayHelper_decrypting_please_wait))) {
body = new SpannableString(context.getString(R.string.MessageNotifier_encrypted_message)); 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); body.setSpan(new StyleSpan(android.graphics.Typeface.ITALIC), 0, body.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
} }