commit 4999ca451de2ad03236b3c087e0b2ec47cc26a50
parent 62ff1d998f2b00da17b2c1fe6038b549a8e3718f
Author: TheVisual <132447890+TheVisual@users.noreply.github.com>
Date: Tue, 14 May 2024 14:33:04 -0500
feat(bulk_messaging_action): streaks filters (#1028)
Co-authored-by: rhunk <101876869+rhunk@users.noreply.github.com>
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/core/src/main/kotlin/me/rhunk/snapenhance/core/action/impl/BulkMessagingAction.kt b/core/src/main/kotlin/me/rhunk/snapenhance/core/action/impl/BulkMessagingAction.kt
@@ -71,6 +71,8 @@ class BulkMessagingAction : AbstractAction() {
DELETED,
SUGGESTED,
BUSINESS_ACCOUNTS,
+ STREAKS,
+ NON_STREAKS,
}
private val translation by lazy { context.translation.getCategory("bulk_messaging_action") }
@@ -158,6 +160,8 @@ class BulkMessagingAction : AbstractAction() {
Filter.SUGGESTED -> friend.friendLinkType == FriendLinkType.SUGGESTED.value
Filter.DELETED -> friend.friendLinkType == FriendLinkType.DELETED.value
Filter.BUSINESS_ACCOUNTS -> friend.businessCategory > 0
+ Filter.STREAKS -> friend.friendLinkType == FriendLinkType.MUTUAL.value && friend.addedTimestamp > 0 && friend.streakLength != 0
+ Filter.NON_STREAKS -> friend.friendLinkType == FriendLinkType.MUTUAL.value&& friend.addedTimestamp > 0 && friend.streakLength == 0
} && nameFilter.takeIf { it.isNotBlank() }?.let { name ->
friend.mutableUsername?.contains(
name,