Merge pull request #672 from Inhishonor/deduplicate-messages

Add a deduplicate message feature
This commit is contained in:
octoshrimpy
2026-01-11 23:21:33 -05:00
committed by GitHub
24 changed files with 539 additions and 3 deletions
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M280,240L280,240L280,400Q280,400 280,481.5Q280,563 280,680Q280,701 280,721Q280,741 280,760L280,760Q280,760 280,760Q280,760 280,760L280,240ZM450,840L280,840Q247,840 223.5,816.5Q200,793 200,760L200,240L160,240L160,160L360,160L360,120L600,120L600,160L800,160L800,240L760,240L760,412Q743,407 720.5,403.5Q698,400 680,400L680,240L280,240L280,760Q280,760 280,760Q280,760 280,760L412,760Q418,781 428,801.5Q438,822 450,840ZM360,680L400,680Q400,617 420,576.5Q440,536 440,536L440,320L360,320L360,680ZM520,450Q537,439 558.5,428Q580,417 600,412L600,320L520,320L520,450ZM680,880Q597,880 538.5,821.5Q480,763 480,680Q480,597 538.5,538.5Q597,480 680,480Q763,480 821.5,538.5Q880,597 880,680Q880,763 821.5,821.5Q763,880 680,880ZM746,774L774,746L700,672L700,560L660,560L660,688L746,774Z"/>
</vector>
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M440,440L440,160L880,160L880,440L440,440ZM80,800L80,520L480,520L480,800L80,800ZM80,440L80,160L360,160L360,440L80,440ZM520,360L800,360L800,240L520,240L520,360ZM160,720L400,720L400,600L160,600L160,720ZM160,360L280,360L280,240L160,240L160,360ZM520,360L520,360L520,360L520,360ZM400,600L400,600L400,600L400,600ZM280,360L280,360L280,360L280,360ZM680,880L668,820Q656,815 645.5,809.5Q635,804 624,796L566,814L526,746L572,706Q570,693 570,680Q570,667 572,654L526,614L566,546L624,564Q635,556 645.5,550.5Q656,545 668,540L680,480L760,480L772,540Q784,545 794.5,550.5Q805,556 816,564L874,546L914,614L868,654Q870,667 870,680Q870,693 868,706L914,746L874,814L816,796Q805,804 794.5,809.5Q784,815 772,820L760,880L680,880ZM720,760Q753,760 776.5,736.5Q800,713 800,680Q800,647 776.5,623.5Q753,600 720,600Q687,600 663.5,623.5Q640,647 640,680Q640,713 663.5,736.5Q687,760 720,760Z"/>
</vector>
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M600,720L600,640L760,640L760,720L600,720ZM600,400L600,320L880,320L880,400L600,400ZM600,560L600,480L840,480L840,560L600,560ZM120,320L80,320L80,240L240,240L240,180L400,180L400,240L560,240L560,320L520,320L520,680Q520,713 496.5,736.5Q473,760 440,760L200,760Q167,760 143.5,736.5Q120,713 120,680L120,320ZM200,320L200,680Q200,680 200,680Q200,680 200,680L440,680Q440,680 440,680Q440,680 440,680L440,320L200,320ZM200,320L200,320L200,680Q200,680 200,680Q200,680 200,680L200,680Q200,680 200,680Q200,680 200,680L200,320Z"/>
</vector>
@@ -139,6 +139,21 @@
</LinearLayout>
<LinearLayout
android:id="@+id/messageUtils"
style="@style/DrawerRow">
<ImageView
style="@style/DrawerIcon"
android:src="@drawable/dashboard_2_gear"
app:tint="?android:attr/textColorSecondary" />
<dev.octoshrimpy.quik.common.widget.QkTextView
style="@style/DrawerText"
android:text="@string/message_management_title" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2019 Moez Bhatti <moez.bhatti@gmail.com>
~
~ This file is part of QKSMS.
~
~ QKSMS is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ QKSMS is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/contentView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:attr/windowBackground">
<LinearLayout
android:id="@+id/parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="16dp"
android:paddingBottom="16dp">
<dev.octoshrimpy.quik.common.widget.QkTextView
style="@style/PreferenceCategory"
android:text="@string/deduplicate_messages_category" />
<dev.octoshrimpy.quik.common.widget.PreferenceView
android:id="@+id/deduplicateMessages"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:icon="@drawable/delete_sweep"
app:summary="@string/deduplicate_messages_summary"
app:title="@string/deduplicate_messages_title" />
<dev.octoshrimpy.quik.common.widget.QkTextView
android:id="@+id/deduplicationProgressText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
android:textColor="?android:attr/textColorTertiary"
app:textSize="secondary"
android:paddingStart="72dp" />
<ProgressBar
android:id="@+id/deduplicationProgress"
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="72dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:indeterminate="true"
app:layout_constraintBottom_toBottomOf="parent" />
<dev.octoshrimpy.quik.common.widget.PreferenceView
android:id="@+id/autoDeduplicate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:icon="@drawable/auto_delete"
app:summary="@string/auto_deduplicate_messages_summary"
app:title="@string/auto_deduplicate_messages_title"
app:widget="@layout/settings_switch_widget" />
</LinearLayout>
</ScrollView>
@@ -87,6 +87,7 @@
<string name="drawer_scheduled">Scheduled</string>
<string name="drawer_blocking">Blocking</string>
<string name="drawer_more">More</string>
<string name="message_management_title">Message Management</string>
<string name="drawer_settings">Settings</string>
<string name="drawer_plus" translatable="false">DEPRECATED - drawer_plus</string>
<string name="drawer_help">Help &amp; feedback</string>
@@ -388,6 +389,16 @@
<item quantity="other">Continue to %s and allow these numbers</item>
</plurals>
<string name="deduplicate_messages_category">Deduplicate Messages</string>
<string name="deduplicate_messages_title">Remove Duplicate Messages</string>
<string name="deduplicate_messages_summary">Scans through message database and deletes all messages that exactly match original messages</string>
<string name="deduplicate_message_confirmation_dialog_message">Your message database will be scanned for duplicates, and then those duplicates will be removed.\nThis will automatically delete messages, only proceed if you understand the consequences.</string>
<string name="auto_deduplicate_messages_title">Automatically Deduplicate Messages</string>
<string name="auto_deduplicate_messages_summary">Deduplication will be performed during sync. Please note, this will automatically delete messages, and while the chance of there being a false duplicate is very low, it is still possible.\nPlease exercise caution.</string>
<string name="deduplicating_messages_finished">Finished deduplicating messages!</string>
<string name="deduplicating_messages_no_messages">No duplicate messages found.</string>
<string name="deduplicating_messages_failed">Deduplicating messages failed, please try again</string>
<string name="about_title">About</string>
<string name="about_version_title">Version</string>
<string name="about_developer_title">Developer</string>