mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-17 19:38:52 +01:00
Don't unblock numbers not reported by SIA
This commit is contained in:
@@ -23,6 +23,22 @@ import io.reactivex.Single
|
||||
|
||||
interface BlockingClient {
|
||||
|
||||
enum class Capability {
|
||||
BLOCK_WITHOUT_PERMISSION,
|
||||
BLOCK_WITH_PERMISSION ,
|
||||
CANT_BLOCK
|
||||
}
|
||||
|
||||
enum class Action {
|
||||
BLOCK,
|
||||
UNBLOCK,
|
||||
|
||||
// We only need these for Should I Answer, because they don't allow us to block numbers in their app directly.
|
||||
// This means there's a good chance that if a number is blocked in QK, it won't be blocked there, so we
|
||||
// shouldn't unblock the conversation in that case
|
||||
DO_NOTHING
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the target blocking client is available for use, ie. it is installed
|
||||
*/
|
||||
@@ -31,12 +47,12 @@ interface BlockingClient {
|
||||
/**
|
||||
* Returns the level of access that the given blocking client provides to QKSMS
|
||||
*/
|
||||
fun getClientCapability(): BlockingClientCapability
|
||||
fun getClientCapability(): Capability
|
||||
|
||||
/**
|
||||
* Return a Single<Boolean> which emits whether or not the given [address] should be blocked
|
||||
* Returns the recommendation action to perform given a message from the [address]
|
||||
*/
|
||||
fun isBlocked(address: String): Single<Boolean>
|
||||
fun getAction(address: String): Single<Action>
|
||||
|
||||
/**
|
||||
* Blocks the numbers or opens the manager
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
package com.moez.QKSMS.blocking
|
||||
|
||||
enum class BlockingClientCapability {
|
||||
BLOCK_WITHOUT_PERMISSION,
|
||||
BLOCK_WITH_PERMISSION ,
|
||||
CANT_BLOCK
|
||||
}
|
||||
Reference in New Issue
Block a user