fix(dm): USER_CREATOR DM push 라우팅을 보정한다
This commit is contained in:
@@ -17,6 +17,7 @@ import kr.co.vividnext.sodalive.mypage.can.payment.CanPaymentActivity
|
||||
import kr.co.vividnext.sodalive.splash.SplashActivity
|
||||
import kr.co.vividnext.sodalive.v2.creator.channel.CreatorChannelActivity
|
||||
import kr.co.vividnext.sodalive.v2.main.MainV2Activity
|
||||
import kr.co.vividnext.sodalive.v2.main.chat.dm.DmChatRoomActivity
|
||||
import java.util.Locale
|
||||
|
||||
class DeepLinkActivity : AppCompatActivity() {
|
||||
@@ -43,6 +44,13 @@ class DeepLinkActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
if (SodaLiveApp.isAppInForeground && deepLinkExtras != null && isUserCreatorChat(deepLinkExtras)) {
|
||||
if (routeForegroundDeepLink(deepLinkExtras)) {
|
||||
finish()
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if (SodaLiveApp.isAppInForeground && LiveRoomActivity.isForeground && deepLinkExtras != null) {
|
||||
LocalBroadcastManager.getInstance(applicationContext).sendBroadcast(
|
||||
Intent(Constants.ACTION_LIVE_ROOM_DEEPLINK_CONFIRM).apply {
|
||||
@@ -106,6 +114,7 @@ class DeepLinkActivity : AppCompatActivity() {
|
||||
}
|
||||
|
||||
putQuery("room_id")
|
||||
putQuery("chat_type")
|
||||
putQuery("channel_id")
|
||||
putQuery("message_id")
|
||||
putQuery("audition_id")
|
||||
@@ -131,6 +140,7 @@ class DeepLinkActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
copyString("chat_type")
|
||||
copyString("room_id")
|
||||
copyString("channel_id")
|
||||
copyString("message_id")
|
||||
@@ -267,6 +277,11 @@ class DeepLinkActivity : AppCompatActivity() {
|
||||
val communityPostId = bundle.getString(Constants.EXTRA_COMMUNITY_POST_ID)?.toLongOrNull()
|
||||
?: bundle.getLong(Constants.EXTRA_COMMUNITY_POST_ID).takeIf { it > 0 }
|
||||
|
||||
if (isUserCreatorChat(bundle) && roomId != null && roomId > 0) {
|
||||
startActivity(DmChatRoomActivity.newIntentByRoomId(applicationContext, roomId))
|
||||
return true
|
||||
}
|
||||
|
||||
when {
|
||||
roomId != null && roomId > 0 -> {
|
||||
routeLiveInMain(roomId)
|
||||
@@ -317,6 +332,10 @@ class DeepLinkActivity : AppCompatActivity() {
|
||||
return routeByDeepLinkValue(deepLinkValue = deepLinkValue, deepLinkValueId = deepLinkValueId)
|
||||
}
|
||||
|
||||
private fun isUserCreatorChat(bundle: Bundle): Boolean {
|
||||
return bundle.getString("chat_type") == "USER_CREATOR"
|
||||
}
|
||||
|
||||
private fun routeByDeepLinkValue(deepLinkValue: String?, deepLinkValueId: Long?): Boolean {
|
||||
if (deepLinkValue.isNullOrBlank()) {
|
||||
return false
|
||||
|
||||
@@ -49,6 +49,7 @@ import kr.co.vividnext.sodalive.settings.notification.NotificationSettingsDialog
|
||||
import kr.co.vividnext.sodalive.user.login.LoginActivity
|
||||
import kr.co.vividnext.sodalive.v2.creator.channel.CreatorChannelActivity
|
||||
import kr.co.vividnext.sodalive.v2.main.chat.ChatMainFragment
|
||||
import kr.co.vividnext.sodalive.v2.main.chat.dm.DmChatRoomActivity
|
||||
import kr.co.vividnext.sodalive.v2.main.chat.model.ChatRoomFilter
|
||||
import kr.co.vividnext.sodalive.v2.main.home.HomeMainFragment
|
||||
import kotlinx.coroutines.Job
|
||||
@@ -549,6 +550,8 @@ class MainV2Activity : BaseActivity<ActivityMainV2Binding>(ActivityMainV2Binding
|
||||
}
|
||||
|
||||
private fun executeBundleRoute(bundle: Bundle): Boolean {
|
||||
val roomId = bundle.getString("room_id")?.toLongOrNull()
|
||||
?: bundle.getLong(Constants.EXTRA_ROOM_ID).takeIf { it > 0 }
|
||||
val channelId = bundle.getString("channel_id")?.toLongOrNull()
|
||||
?: bundle.getLong(Constants.EXTRA_USER_ID).takeIf { it > 0 }
|
||||
val messageId = bundle.getString("message_id")?.toLongOrNull()
|
||||
@@ -562,6 +565,11 @@ class MainV2Activity : BaseActivity<ActivityMainV2Binding>(ActivityMainV2Binding
|
||||
val communityPostId = bundle.getString(Constants.EXTRA_COMMUNITY_POST_ID)?.toLongOrNull()
|
||||
?: bundle.getLong(Constants.EXTRA_COMMUNITY_POST_ID).takeIf { it > 0 }
|
||||
|
||||
if (isUserCreatorChat(bundle) && roomId != null && roomId > 0) {
|
||||
startActivity(DmChatRoomActivity.newIntentByRoomId(applicationContext, roomId))
|
||||
return true
|
||||
}
|
||||
|
||||
when {
|
||||
channelId != null && channelId > 0 -> {
|
||||
startActivity(
|
||||
@@ -607,6 +615,10 @@ class MainV2Activity : BaseActivity<ActivityMainV2Binding>(ActivityMainV2Binding
|
||||
return !deepLinkValue.isNullOrBlank() && routeByDeepLinkValue(deepLinkValue, deepLinkValueId)
|
||||
}
|
||||
|
||||
private fun isUserCreatorChat(bundle: Bundle): Boolean {
|
||||
return bundle.getString("chat_type") == "USER_CREATOR"
|
||||
}
|
||||
|
||||
private fun routeByDeepLinkValue(deepLinkValue: String, deepLinkValueId: Long?): Boolean {
|
||||
return when (deepLinkValue.lowercase(Locale.ROOT)) {
|
||||
"series" -> {
|
||||
|
||||
Reference in New Issue
Block a user