Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
Simple-Sms
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhangchengbo
Simple-Sms
Commits
8f570ef2
Commit
8f570ef2
authored
Nov 21, 2025
by
zhangchengbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:[加入黑名单]后,消息列表Message依旧展示
parent
89e27fb3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
Context.kt
app/src/main/kotlin/com/secspace/sms/extensions/Context.kt
+5
-4
No files found.
app/src/main/kotlin/com/secspace/sms/extensions/Context.kt
View file @
8f570ef2
...
...
@@ -35,6 +35,7 @@ import com.secspace.sms.messaging.SmsSender
import
com.secspace.sms.models.*
import
com.simplemobiletools.commons.extensions.*
import
com.simplemobiletools.commons.helpers.*
import
com.simplemobiletools.commons.models.BlockedNumber
import
com.simplemobiletools.commons.models.PhoneNumber
import
com.simplemobiletools.commons.models.SimpleContact
import
java.io.FileNotFoundException
...
...
@@ -82,13 +83,13 @@ fun Context.getMessages(
val
selectionArgs
=
arrayOf
(
threadId
.
toString
())
val
sortOrder
=
"${Sms.DATE} DESC LIMIT $limit"
val
blockStatus
=
HashMap
<
String
,
Boolean
>()
val
blockedNumbers
=
getBlockedNumbers
()
//
val blockStatus = HashMap<String, Boolean>()
//
val blockedNumbers = getBlockedNumbers()
var
messages
=
ArrayList
<
Message
>()
queryCursor
(
uri
,
projection
,
selection
,
selectionArgs
,
sortOrder
,
showErrors
=
true
)
{
cursor
->
val
senderNumber
=
cursor
.
getStringValue
(
Sms
.
ADDRESS
)
?:
return
@queryCursor
val
isNumberBlocked
=
if
(
blockStatus
.
containsKey
(
senderNumber
))
{
/*
val isNumberBlocked = if (blockStatus.containsKey(senderNumber)) {
blockStatus[senderNumber]!!
} else {
val isBlocked = isNumberBlocked(senderNumber, blockedNumbers)
...
...
@@ -98,7 +99,7 @@ fun Context.getMessages(
if (isNumberBlocked) {
return@queryCursor
}
}
*/
val
id
=
cursor
.
getLongValue
(
Sms
.
_ID
)
val
body
=
cursor
.
getStringValue
(
Sms
.
BODY
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment