Skip to content

Commit 573174f

Browse files
committed
整理:APP通知转发规则描述去掉任意卡 #516
1 parent a83f0da commit 573174f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

app/src/main/java/com/idormy/sms/forwarder/database/entity/Rule.kt

+4-4
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ data class Rule(
5959
companion object {
6060
val TAG: String = Rule::class.java.simpleName
6161

62-
fun getRuleMatch(filed: String?, check: String?, value: String?, simSlot: String?, senderList: List<Sender>? = null): String {
62+
fun getRuleMatch(type: String?, filed: String?, check: String?, value: String?, simSlot: String?, senderList: List<Sender>? = null): String {
6363
val blank = if (App.isNeedSpaceBetweenWords) " " else ""
6464
val sb = StringBuilder()
65-
sb.append(SIM_SLOT_MAP[simSlot]).append(blank).append(getString(R.string.rule_card)).append(blank)
65+
if (type != "app") sb.append(SIM_SLOT_MAP[simSlot]).append(blank).append(getString(R.string.rule_card)).append(blank)
6666
when (filed) {
6767
null, FILED_TRANSPOND_ALL -> sb.append(getString(R.string.rule_all_fw_to))
6868
FILED_CALL_TYPE -> sb.append(getString(R.string.rule_when))
@@ -127,9 +127,9 @@ data class Rule(
127127

128128
fun getName(appendSenderList: Boolean = true): String {
129129
return if (appendSenderList) {
130-
getRuleMatch(filed, check, value, simSlot, senderList)
130+
getRuleMatch(type, filed, check, value, simSlot, senderList)
131131
} else {
132-
getRuleMatch(filed, check, value, simSlot, null)
132+
getRuleMatch(type, filed, check, value, simSlot, null)
133133
}
134134
}
135135

app/src/main/java/com/idormy/sms/forwarder/fragment/LogsFragment.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ class LogsFragment : BaseFragment<FragmentLogsBinding?>(), MsgPagingAdapter.OnIt
188188
override fun onLogsClicked(view: View?, item: LogsDetail) {
189189
Log.d(TAG, "item: $item")
190190
val ruleStr = StringBuilder()
191-
ruleStr.append(Rule.getRuleMatch(item.ruleFiled, item.ruleCheck, item.ruleValue, item.ruleSimSlot)).append(item.senderName)
191+
ruleStr.append(Rule.getRuleMatch(item.type, item.ruleFiled, item.ruleCheck, item.ruleValue, item.ruleSimSlot)).append(item.senderName)
192192
val detailStr = StringBuilder()
193193
detailStr.append(getString(R.string.rule)).append(ruleStr.toString()).append("\n\n")
194194
@SuppressLint("SimpleDateFormat") val utcFormatter = SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault())

0 commit comments

Comments
 (0)