minor refactoring

to be discussed: does it make sense to show a dialog instead? At least when it's created via 1:1 conversation

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2025-03-27 15:33:58 +01:00
parent e7ab3aab0d
commit c2ad89f7fb
No known key found for this signature in database
GPG Key ID: C793F8B59F43CE7B

View File

@ -1598,21 +1598,17 @@ class ChatActivity :
private fun switchToRoom(token: String, startCallAfterRoomSwitch: Boolean, isVoiceOnlyCall: Boolean) {
if (conversationUser != null) {
runOnUiThread {
if (currentConversation?.objectType == ConversationEnums.ObjectType.ROOM) {
// do not replace with snackbar, as it would disappear with the activity switch
Toast.makeText(
context,
context.resources.getString(R.string.switch_to_main_room),
Toast.LENGTH_LONG
).show()
val toastInfo = if (currentConversation?.objectType == ConversationEnums.ObjectType.ROOM) {
context.resources.getString(R.string.switch_to_main_room)
} else {
// do not replace with snackbar, as it would disappear with the activity switch
Toast.makeText(
context,
context.resources.getString(R.string.switch_to_breakout_room),
Toast.LENGTH_LONG
).show()
context.resources.getString(R.string.switch_to_breakout_room)
}
// do not replace with snackbar, as it would disappear with the activity switch
Toast.makeText(
context,
toastInfo,
Toast.LENGTH_LONG
).show()
}
val bundle = Bundle()