Commit 9465b23a by zhangchengbo

fix:添加通讯录创建会话[黑名单]检测

parent b25c542a
......@@ -16,7 +16,6 @@ import com.secspace.sms.extensions.getSuggestedContacts
import com.secspace.sms.extensions.getThreadId
import com.secspace.sms.helpers.*
import com.secspace.sms.messaging.isShortCodeWithLetters
import com.secspace.sms.util.AES
import com.simplemobiletools.commons.dialogs.RadioGroupDialog
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.*
......@@ -268,6 +267,16 @@ class NewConversationActivity : SimpleActivity() {
// val nameResult: NamePhoto = getNameAndPhotoFromPhoneNumber(phoneNumber)
// Log.d(TAG, "NewConversationActivity--phoneNumber:$phoneNumber threadId:${getThreadId(numbers)} numbers:${numbers} text:$text name = $name ")
//获取黑名单列表
val blockListNumber = getBlockedNumbers().map { it.number }
if(blockListNumber.isNotEmpty()){
Log.d(TAG, "launchThreadActivity: blockPhoneNumber = $number")
if(blockListNumber.contains(number)){
Log.d(TAG, "launchThreadActivity: 该号码已被加入黑名单! ")
toast(msg = "该号码已被加入黑名单!", length = Toast.LENGTH_LONG)
return
}
}
Intent(this, ThreadActivity::class.java).apply {
putExtra(THREAD_ID, getThreadId(numbers))
......@@ -275,7 +284,7 @@ class NewConversationActivity : SimpleActivity() {
putExtra(THREAD_TITLE, name)
} else {
val threadTitle = intent.getStringExtra(THREAD_TITLE)
// android.util.Log.d(TAG, "NewConversationActivity threadTitle = $threadTitle ")
// Log.d(TAG, "NewConversationActivity threadTitle = $threadTitle ")
if(!threadTitle.isNullOrEmpty()){
putExtra(THREAD_TITLE, threadTitle)
}
......
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