Hide scheduled media from conversation settings.

This commit is contained in:
Sagar
2025-03-31 20:46:06 +05:30
committed by Greyson Parrelli
parent 02ee1c794b
commit 1f95e0dd39
3 changed files with 12 additions and 8 deletions

View File

@@ -11,14 +11,13 @@ import androidx.annotation.MenuRes
import androidx.annotation.StringRes
import androidx.appcompat.widget.Toolbar
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.ConcatAdapter
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import org.thoughtcrime.securesms.LoggingFragment
import org.thoughtcrime.securesms.R
import org.thoughtcrime.securesms.util.Material3OnScrollHelper
import org.thoughtcrime.securesms.util.adapter.mapping.MappingAdapter
import java.lang.UnsupportedOperationException
/**
* The DSL API can be completely replaced by compose.
@@ -29,7 +28,7 @@ abstract class DSLSettingsFragment(
@MenuRes private val menuId: Int = -1,
@LayoutRes layoutId: Int = R.layout.dsl_settings_fragment,
protected var layoutManagerProducer: (Context) -> RecyclerView.LayoutManager = { context -> LinearLayoutManager(context) }
) : Fragment(layoutId) {
) : LoggingFragment(layoutId) {
protected var recyclerView: RecyclerView? = null
private set

View File

@@ -111,7 +111,8 @@ class MediaTable internal constructor(context: Context?, databaseHelper: SignalD
(${AttachmentTable.DATA_FILE} IS NOT NULL OR (${AttachmentTable.CONTENT_TYPE} LIKE 'video/%' AND ${AttachmentTable.REMOTE_INCREMENTAL_DIGEST} IS NOT NULL) OR (${AttachmentTable.THUMBNAIL_FILE} IS NOT NULL)) AND
${AttachmentTable.CONTENT_TYPE} NOT LIKE 'image/svg%' AND
(${AttachmentTable.CONTENT_TYPE} LIKE 'image/%' OR ${AttachmentTable.CONTENT_TYPE} LIKE 'video/%') AND
${MessageTable.LINK_PREVIEWS} IS NULL
${MessageTable.LINK_PREVIEWS} IS NULL AND
${MessageTable.SCHEDULED_DATE} < 0
"""
)
@@ -119,7 +120,8 @@ class MediaTable internal constructor(context: Context?, databaseHelper: SignalD
BASE_MEDIA_QUERY,
"""
${AttachmentTable.DATA_FILE} IS NOT NULL AND
${AttachmentTable.CONTENT_TYPE} LIKE 'audio/%'
${AttachmentTable.CONTENT_TYPE} LIKE 'audio/%' AND
${MessageTable.SCHEDULED_DATE} < 0
"""
)
@@ -128,7 +130,8 @@ class MediaTable internal constructor(context: Context?, databaseHelper: SignalD
"""
${AttachmentTable.DATA_FILE} IS NOT NULL AND
${AttachmentTable.CONTENT_TYPE} NOT LIKE 'text/x-signal-plain' AND
${MessageTable.LINK_PREVIEWS} IS NULL
${MessageTable.LINK_PREVIEWS} IS NULL AND
${MessageTable.SCHEDULED_DATE} < 0
"""
)
@@ -142,7 +145,8 @@ class MediaTable internal constructor(context: Context?, databaseHelper: SignalD
${AttachmentTable.CONTENT_TYPE} NOT LIKE 'image/%' AND
${AttachmentTable.CONTENT_TYPE} NOT LIKE 'video/%' AND
${AttachmentTable.CONTENT_TYPE} NOT LIKE 'audio/%' AND
${AttachmentTable.CONTENT_TYPE} NOT LIKE 'text/x-signal-plain'
${AttachmentTable.CONTENT_TYPE} NOT LIKE 'text/x-signal-plain' AND
${MessageTable.SCHEDULED_DATE} < 0
)
)"""
)

View File

@@ -33,6 +33,7 @@ import org.signal.core.util.ByteSize;
import org.signal.core.util.DimensionUnit;
import org.signal.core.util.concurrent.LifecycleDisposable;
import org.signal.core.util.logging.Log;
import org.thoughtcrime.securesms.LoggingFragment;
import org.thoughtcrime.securesms.R;
import org.thoughtcrime.securesms.attachments.DatabaseAttachment;
import org.thoughtcrime.securesms.components.DeleteSyncEducationDialog;
@@ -56,7 +57,7 @@ import java.util.Objects;
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
public final class MediaOverviewPageFragment extends Fragment
public final class MediaOverviewPageFragment extends LoggingFragment
implements MediaGalleryAllAdapter.ItemClickListener,
MediaGalleryAllAdapter.AudioItemListener,
LoaderManager.LoaderCallbacks<GroupedThreadMediaLoader.GroupedThreadMedia>