feat: fix potential null groupName and implement pocGid fallback callbacks
This commit is contained in:
parent
e807974315
commit
f41557db0e
|
|
@ -101,10 +101,15 @@ class TempCallActivity : AppCompatActivity() {
|
||||||
instance = this
|
instance = this
|
||||||
isMinimized = false
|
isMinimized = false
|
||||||
|
|
||||||
val groupName = intent.getStringExtra("group_name") ?: "临时会话"
|
val rawGroupName = intent.getStringExtra("group_name")
|
||||||
|
val groupName = if (rawGroupName.isNullOrEmpty() || rawGroupName == "null") "临时会话" else rawGroupName
|
||||||
val gid = intent.getStringExtra("gid") ?: ""
|
val gid = intent.getStringExtra("gid") ?: ""
|
||||||
currentGroupName = groupName
|
currentGroupName = groupName
|
||||||
currentTempGroupId = com.example.kingway.ptt.SendAtUtil.str2HexStr(gid)
|
currentTempGroupId = if (gid.isNotEmpty()) {
|
||||||
|
com.example.kingway.ptt.SendAtUtil.str2HexStr(gid)
|
||||||
|
} else {
|
||||||
|
com.example.kingway.ptt.SendAtUtil.str2HexStr(groupName)
|
||||||
|
}
|
||||||
MainActivity.executeJs("if(window.startPullGroupLock){ window.startPullGroupLock('$currentTempGroupId'); }")
|
MainActivity.executeJs("if(window.startPullGroupLock){ window.startPullGroupLock('$currentTempGroupId'); }")
|
||||||
findViewById<TextView>(R.id.tv_group_name).text = groupName
|
findViewById<TextView>(R.id.tv_group_name).text = groupName
|
||||||
|
|
||||||
|
|
@ -376,6 +381,11 @@ class TempCallActivity : AppCompatActivity() {
|
||||||
val pullTitle = record.optString("pullTitle", "")
|
val pullTitle = record.optString("pullTitle", "")
|
||||||
val pullTime = record.optString("pullTime", "")
|
val pullTime = record.optString("pullTime", "")
|
||||||
val sourceUnitName = record.optString("sourceUnitName", "")
|
val sourceUnitName = record.optString("sourceUnitName", "")
|
||||||
|
val pocGid = record.optString("pocGid", "")
|
||||||
|
if (pocGid.isNotEmpty()) {
|
||||||
|
currentTempGroupId = pocGid
|
||||||
|
MainActivity.executeJs("if(window.startPullGroupLock){ window.startPullGroupLock('$currentTempGroupId'); }")
|
||||||
|
}
|
||||||
|
|
||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
findViewById<View>(R.id.ll_pull_info)?.visibility = View.VISIBLE
|
findViewById<View>(R.id.ll_pull_info)?.visibility = View.VISIBLE
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue