diff --git a/src/org/thoughtcrime/securesms/ConversationAdapter.java b/src/org/thoughtcrime/securesms/ConversationAdapter.java index 47fca05329..064b472bf2 100644 --- a/src/org/thoughtcrime/securesms/ConversationAdapter.java +++ b/src/org/thoughtcrime/securesms/ConversationAdapter.java @@ -23,9 +23,8 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AbsListView; -import android.widget.CursorAdapter; +import android.support.v4.widget.CursorAdapter; -import org.thoughtcrime.securesms.util.GroupUtil; import org.whispersystems.textsecure.crypto.MasterSecret; import org.thoughtcrime.securesms.database.DatabaseFactory; import org.thoughtcrime.securesms.database.MmsSmsColumns; @@ -33,7 +32,6 @@ import org.thoughtcrime.securesms.database.MmsSmsDatabase; import org.thoughtcrime.securesms.database.SmsDatabase; import org.thoughtcrime.securesms.database.model.MessageRecord; import org.thoughtcrime.securesms.util.LRUCache; -import org.whispersystems.textsecure.push.PushMessageProtos.PushMessageContent.GroupContext; import java.lang.ref.SoftReference; import java.util.Collections; @@ -67,14 +65,13 @@ public class ConversationAdapter extends CursorAdapter implements AbsListView.Re public ConversationAdapter(Context context, MasterSecret masterSecret, Handler failedIconClickHandler, boolean groupThread, boolean pushDestination) { - super(context, null); + super(context, null, true); this.context = context; this.masterSecret = masterSecret; this.failedIconClickHandler = failedIconClickHandler; this.groupThread = groupThread; this.pushDestination = pushDestination; - this.inflater = (LayoutInflater)context - .getSystemService(Context.LAYOUT_INFLATER_SERVICE); + this.inflater = LayoutInflater.from(context); } @Override diff --git a/src/org/thoughtcrime/securesms/ConversationFragment.java b/src/org/thoughtcrime/securesms/ConversationFragment.java index 9517d0fc17..8f2208a8cb 100644 --- a/src/org/thoughtcrime/securesms/ConversationFragment.java +++ b/src/org/thoughtcrime/securesms/ConversationFragment.java @@ -16,7 +16,7 @@ import android.view.LayoutInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; -import android.widget.CursorAdapter; +import android.support.v4.widget.CursorAdapter; import android.widget.ListView; import com.actionbarsherlock.app.SherlockListFragment; diff --git a/src/org/thoughtcrime/securesms/database/MmsDatabase.java b/src/org/thoughtcrime/securesms/database/MmsDatabase.java index 7ba85c4a39..c70eaa8671 100644 --- a/src/org/thoughtcrime/securesms/database/MmsDatabase.java +++ b/src/org/thoughtcrime/securesms/database/MmsDatabase.java @@ -281,8 +281,9 @@ public class MmsDatabase extends Database implements MmsSmsColumns { notifyConversationListeners(getThreadIdForMessage(messageId)); } - public void markAsForcedSms(long id) { - updateMailboxBitmask(id, 0, Types.MESSAGE_FORCE_SMS_BIT); + public void markAsForcedSms(long messageId) { + updateMailboxBitmask(messageId, 0, Types.MESSAGE_FORCE_SMS_BIT); + notifyConversationListeners(getThreadIdForMessage(messageId)); } public void markAsPendingSecureSmsFallback(long messageId) { diff --git a/src/org/thoughtcrime/securesms/transport/UniversalTransport.java b/src/org/thoughtcrime/securesms/transport/UniversalTransport.java index 80c84dba1a..eff7cc51e6 100644 --- a/src/org/thoughtcrime/securesms/transport/UniversalTransport.java +++ b/src/org/thoughtcrime/securesms/transport/UniversalTransport.java @@ -167,6 +167,7 @@ public class UniversalTransport { if (!isSmsFallbackApprovalRequired) { Log.w("UniversalTransport", "Falling back to MMS"); + DatabaseFactory.getMmsDatabase(context).markAsForcedSms(mediaMessage.getDatabaseMessageId()); return mmsTransport.deliver(mediaMessage); } else if (!Session.hasEncryptCapableSession(context, masterSecret, recipient)) { Log.w("UniversalTransport", "Marking message as pending insecure SMS fallback"); @@ -188,6 +189,7 @@ public class UniversalTransport { if (!isSmsFallbackApprovalRequired) { Log.w("UniversalTransport", "Falling back to SMS"); + DatabaseFactory.getSmsDatabase(context).markAsForcedSms(smsMessage.getId()); smsTransport.deliver(smsMessage); } else if (!Session.hasEncryptCapableSession(context, masterSecret, recipient)) { Log.w("UniversalTransport", "Marking message as pending insecure fallback.");