Add a deduplicate message feature

- Adds a new class of features for message management.
- Adds a manual option to find and delete duplicate messages
- Adds a setting to automatically delete duplicates during sync
- Adds a sha256 hashing function

Co-authored-by: octoshrimpy <octoshrimpy@users.noreply.github.com>
This commit is contained in:
Inhishonor
2026-01-10 13:34:37 -08:00
parent b4bce2c1a9
commit c1d824abbc
24 changed files with 539 additions and 3 deletions
@@ -0,0 +1,33 @@
/*
* Copyright (C) 2017 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/>.
*/
package dev.octoshrimpy.quik.interactor
import dev.octoshrimpy.quik.repository.MessageRepository
import io.reactivex.Flowable
import io.reactivex.schedulers.Schedulers
import javax.inject.Inject
class DeduplicateMessages @Inject constructor(
private val messageRepo: MessageRepository
) : Interactor<Unit>() {
override fun buildObservable(params: Unit): Flowable<MessageRepository.DeduplicationResult> =
messageRepo.deduplicateMessages()
.subscribeOn(Schedulers.io())
}