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
89e27fb3
Commit
89e27fb3
authored
Nov 21, 2025
by
zhangchengbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:[加入黑名单]后,首页conversations会话依旧展示
parent
319cb23b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
5 deletions
+10
-5
MainActivity.kt
...c/main/kotlin/com/secspace/sms/activities/MainActivity.kt
+2
-1
Context.kt
app/src/main/kotlin/com/secspace/sms/extensions/Context.kt
+5
-2
RecentsHelper.kt
...src/main/kotlin/com/secspace/sms/helpers/RecentsHelper.kt
+3
-2
No files found.
app/src/main/kotlin/com/secspace/sms/activities/MainActivity.kt
View file @
89e27fb3
...
@@ -327,12 +327,13 @@ class MainActivity : SimpleActivity() {
...
@@ -327,12 +327,13 @@ class MainActivity : SimpleActivity() {
}
catch
(
e
:
Exception
)
{
}
catch
(
e
:
Exception
)
{
ArrayList
()
ArrayList
()
}
}
Log
.
d
(
TAG
,
"getCachedConversations: conversations = ${Gson().toJson(conversations)}"
)
val
archived
=
try
{
val
archived
=
try
{
conversationsDB
.
getAllArchived
()
conversationsDB
.
getAllArchived
()
}
catch
(
e
:
Exception
)
{
}
catch
(
e
:
Exception
)
{
listOf
()
listOf
()
}
}
Log
.
d
(
TAG
,
"getCachedConversations: archived = ${Gson().toJson(archived)}"
)
// runOnUiThread {
// runOnUiThread {
// setupConversations(conversations, cached = true)
// setupConversations(conversations, cached = true)
...
...
app/src/main/kotlin/com/secspace/sms/extensions/Context.kt
View file @
89e27fb3
...
@@ -17,6 +17,7 @@ import android.provider.OpenableColumns
...
@@ -17,6 +17,7 @@ import android.provider.OpenableColumns
import
android.provider.Telephony.*
import
android.provider.Telephony.*
import
android.telephony.SubscriptionManager
import
android.telephony.SubscriptionManager
import
android.text.TextUtils
import
android.text.TextUtils
import
android.util.Log
import
com.bumptech.glide.Glide
import
com.bumptech.glide.Glide
import
com.bumptech.glide.load.engine.DiskCacheStrategy
import
com.bumptech.glide.load.engine.DiskCacheStrategy
import
com.bumptech.glide.request.RequestOptions
import
com.bumptech.glide.request.RequestOptions
...
@@ -289,7 +290,7 @@ fun Context.getConversations(threadId: Long? = null, privateContacts: ArrayList<
...
@@ -289,7 +290,7 @@ fun Context.getConversations(threadId: Long? = null, privateContacts: ArrayList<
val
conversations
=
ArrayList
<
Conversation
>()
val
conversations
=
ArrayList
<
Conversation
>()
val
simpleContactHelper
=
SimpleContactsHelper
(
this
)
val
simpleContactHelper
=
SimpleContactsHelper
(
this
)
val
blockedNumbers
=
getBlockedNumbers
()
//
val blockedNumbers = getBlockedNumbers()
try
{
try
{
queryCursorUnsafe
(
uri
,
projection
.
toTypedArray
(),
selection
,
null
,
sortOrder
)
{
cursor
->
queryCursorUnsafe
(
uri
,
projection
.
toTypedArray
(),
selection
,
null
,
sortOrder
)
{
cursor
->
val
id
=
cursor
.
getLongValue
(
Threads
.
_ID
)
val
id
=
cursor
.
getLongValue
(
Threads
.
_ID
)
...
@@ -306,7 +307,7 @@ fun Context.getConversations(threadId: Long? = null, privateContacts: ArrayList<
...
@@ -306,7 +307,7 @@ fun Context.getConversations(threadId: Long? = null, privateContacts: ArrayList<
val
rawIds
=
cursor
.
getStringValue
(
Threads
.
RECIPIENT_IDS
)
val
rawIds
=
cursor
.
getStringValue
(
Threads
.
RECIPIENT_IDS
)
val
recipientIds
=
rawIds
.
split
(
" "
).
filter
{
it
.
areDigitsOnly
()
}.
map
{
it
.
toInt
()
}.
toMutableList
()
val
recipientIds
=
rawIds
.
split
(
" "
).
filter
{
it
.
areDigitsOnly
()
}.
map
{
it
.
toInt
()
}.
toMutableList
()
val
phoneNumbers
=
getThreadPhoneNumbers
(
recipientIds
)
val
phoneNumbers
=
getThreadPhoneNumbers
(
recipientIds
)
if
(
phoneNumbers
.
isEmpty
()
||
phoneNumbers
.
any
{
isNumberBlocked
(
it
,
blockedNumbers
)
}
)
{
if
(
phoneNumbers
.
isEmpty
()
/*|| phoneNumbers.any { isNumberBlocked(it, blockedNumbers) }*/
)
{
return
@queryCursorUnsafe
return
@queryCursorUnsafe
}
}
...
@@ -1111,12 +1112,14 @@ fun Context.clearExpiredScheduledMessages(threadId: Long, messagesToDelete: List
...
@@ -1111,12 +1112,14 @@ fun Context.clearExpiredScheduledMessages(threadId: Long, messagesToDelete: List
try
{
try
{
messages
.
filter
{
it
.
isScheduled
&&
it
.
millis
()
<
now
}.
forEach
{
msg
->
messages
.
filter
{
it
.
isScheduled
&&
it
.
millis
()
<
now
}.
forEach
{
msg
->
messagesDB
.
delete
(
msg
.
id
)
messagesDB
.
delete
(
msg
.
id
)
Log
.
d
(
"TAG"
,
"getCachedConversations: delete"
)
}
}
if
(
messages
.
filterNot
{
it
.
isScheduled
&&
it
.
millis
()
<
now
}.
isEmpty
())
{
if
(
messages
.
filterNot
{
it
.
isScheduled
&&
it
.
millis
()
<
now
}.
isEmpty
())
{
// delete empty temporary thread
// delete empty temporary thread
val
conversation
=
conversationsDB
.
getConversationWithThreadId
(
threadId
)
val
conversation
=
conversationsDB
.
getConversationWithThreadId
(
threadId
)
if
(
conversation
!=
null
&&
conversation
.
isScheduled
)
{
if
(
conversation
!=
null
&&
conversation
.
isScheduled
)
{
conversationsDB
.
deleteThreadId
(
threadId
)
conversationsDB
.
deleteThreadId
(
threadId
)
Log
.
d
(
"TAG"
,
"getCachedConversations: deleteThreadId"
)
}
}
}
}
}
catch
(
e
:
Exception
)
{
}
catch
(
e
:
Exception
)
{
...
...
app/src/main/kotlin/com/secspace/sms/helpers/RecentsHelper.kt
View file @
89e27fb3
...
@@ -224,12 +224,13 @@ class RecentsHelper(private val context: Context) {
...
@@ -224,12 +224,13 @@ class RecentsHelper(private val context: Context) {
}
while
(
cursor
.
moveToNext
()
&&
recentCalls
.
size
<
maxSize
)
}
while
(
cursor
.
moveToNext
()
&&
recentCalls
.
size
<
maxSize
)
}
}
val
blockedNumbers
=
context
.
getBlockedNumbers
()
/*
val blockedNumbers = context.getBlockedNumbers()
val recentResult = recentCalls
val recentResult = recentCalls
.filter { !context.isNumberBlocked(it.phoneNumber, blockedNumbers) }
.filter { !context.isNumberBlocked(it.phoneNumber, blockedNumbers) }
callback
(
recentResult
)
callback(recentResult)*/
callback
(
recentCalls
)
}
}
/***
/***
...
...
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