Skip to content

Commit

Permalink
整理:APP通知转发规则描述去掉任意卡 #516
Browse files Browse the repository at this point in the history
  • Loading branch information
pppscn committed Aug 15, 2024
1 parent a83f0da commit 573174f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ data class Rule(
companion object {
val TAG: String = Rule::class.java.simpleName

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

fun getName(appendSenderList: Boolean = true): String {
return if (appendSenderList) {
getRuleMatch(filed, check, value, simSlot, senderList)
getRuleMatch(type, filed, check, value, simSlot, senderList)
} else {
getRuleMatch(filed, check, value, simSlot, null)
getRuleMatch(type, filed, check, value, simSlot, null)
}
}

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

0 comments on commit 573174f

Please sign in to comment.