mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-06-12 05:07:46 +02:00
feat: scope content
- refactor image loader - rules
This commit is contained in:
@ -16,7 +16,7 @@ import me.rhunk.snapenhance.bridge.types.BridgeFileType
|
||||
import me.rhunk.snapenhance.bridge.types.FileActionType
|
||||
import me.rhunk.snapenhance.core.BuildConfig
|
||||
import me.rhunk.snapenhance.core.messaging.MessagingRule
|
||||
import me.rhunk.snapenhance.core.messaging.MessagingScope
|
||||
import me.rhunk.snapenhance.core.messaging.SocialScope
|
||||
import me.rhunk.snapenhance.data.LocalePair
|
||||
import me.rhunk.snapenhance.util.SerializableDataObject
|
||||
import java.util.concurrent.CompletableFuture
|
||||
@ -136,7 +136,7 @@ class BridgeClient(
|
||||
|
||||
fun passGroupsAndFriends(groups: List<String>, friends: List<String>) = service.passGroupsAndFriends(groups, friends)
|
||||
|
||||
fun getRulesFromId(type: MessagingScope, targetUuid: String): List<MessagingRule> {
|
||||
fun getRulesFromId(type: SocialScope, targetUuid: String): List<MessagingRule> {
|
||||
return service.getRules(type.name, targetUuid).map {
|
||||
SerializableDataObject.fromJson(it, MessagingRule::class.java)
|
||||
}.toList()
|
||||
|
@ -8,18 +8,21 @@ enum class Mode {
|
||||
WHITELIST
|
||||
}
|
||||
|
||||
enum class MessagingScope {
|
||||
FRIEND,
|
||||
GROUP
|
||||
enum class SocialScope(
|
||||
val key: String,
|
||||
val tabRoute: String,
|
||||
) {
|
||||
FRIEND("friend", "friend_info/{id}"),
|
||||
GROUP("group", "group_info/{id}"),
|
||||
}
|
||||
|
||||
enum class ConversationFeature(
|
||||
val value: String,
|
||||
val messagingScope: MessagingScope,
|
||||
enum class MessagingRuleType(
|
||||
val key: String,
|
||||
val socialScope: SocialScope,
|
||||
) {
|
||||
DOWNLOAD("download", MessagingScope.FRIEND),
|
||||
STEALTH("stealth", MessagingScope.GROUP),
|
||||
AUTO_SAVE("auto_save", MessagingScope.GROUP);
|
||||
DOWNLOAD("download", SocialScope.FRIEND),
|
||||
STEALTH("stealth", SocialScope.GROUP),
|
||||
AUTO_SAVE("auto_save", SocialScope.GROUP);
|
||||
}
|
||||
|
||||
data class FriendStreaks(
|
||||
@ -47,9 +50,8 @@ data class MessagingFriendInfo(
|
||||
|
||||
data class MessagingRule(
|
||||
val id: Int,
|
||||
val messagingScope: MessagingScope,
|
||||
val socialScope: SocialScope,
|
||||
val targetUuid: String,
|
||||
val enabled: Boolean,
|
||||
val mode: Mode?,
|
||||
//val mode: Mode?,
|
||||
val subject: String
|
||||
) : SerializableDataObject()
|
Reference in New Issue
Block a user