Commit f91f1fa8 by zhangchengbo

fix:解决当通话记录与短信列表都无该手机号记录(新短信),记录该手机号,跳转详情时title展示

parent 064b8d3b
......@@ -399,7 +399,7 @@ class MainActivity : SimpleActivity() {
}
val allConversations = conversationsDB.getNonArchived() as ArrayList<Conversation>
// Log.d(TAG, "getNewConversations allConversations = ${GsonUtil.parseListToJson(allConversations)} ")
Log.d(TAG, "getNewConversations allConversations = ${GsonUtil.parseListToJson(allConversations)} ")
setupConversations(allConversations)
//未读消息 桌面Icon提示
......@@ -583,13 +583,18 @@ class MainActivity : SimpleActivity() {
private fun handleConversationClick(any: Any) {
Intent(this, ThreadActivity::class.java).apply {
val conversation = any as Conversation
if (conversation.snippet.contains("\u200B") || conversation.isSFNumber) {
val phoneNumber = conversation.title
if (phoneNumber.contains("+86")) {
phoneNumber.replace("+86", "")
}
PhoneUtils.phoneNumberFormat(phoneNumber) { itNumber ->
putExtra(THREAD_TITLE, itNumber)
// android.util.Log.d(TAG, "handleConversationClick: snippet = ${conversation.snippet}")
val listMessageData = getMessages(conversation.threadId, false)
if (listMessageData.isNotEmpty()) {
val listContains: List<Message> = listMessageData.filter { msg -> msg.body.contains("\u200B") }
if (listContains.isNotEmpty() || conversation.isSFNumber) {
val phoneNumber = conversation.title
if (phoneNumber.contains("+86")) {
phoneNumber.replace("+86", "")
}
PhoneUtils.phoneNumberFormat(phoneNumber) { itNumber ->
putExtra(THREAD_TITLE, itNumber)
}
}
} else {
putExtra(THREAD_TITLE, conversation.title)
......
......@@ -8,7 +8,6 @@ import android.database.Cursor
import android.os.Handler
import android.os.Looper
import android.provider.Telephony
//import com.android.sfsylibrary.CallHistoryManager
import com.secspace.log.Log
import com.secspace.sms.extensions.*
import com.secspace.sms.helpers.Config
......@@ -125,7 +124,11 @@ class SmsReceiver : BroadcastReceiver() {
}
}
}
confirmCallBack.invoke(lastNumber)
if (lastNumber == "") {
confirmCallBack.invoke(phoneNumber)
} else {
confirmCallBack.invoke(lastNumber)
}
}
......@@ -245,7 +248,7 @@ class SmsReceiver : BroadcastReceiver() {
val tipPopup = MyPushWindow(context, itNumber, body)
tipPopup.show()
}
}else{
} else {
val tipPopup = MyPushWindow(context, address, body)
tipPopup.show()
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment