Rename JoinedToAnotherRoom to JoinRoomCommandSucces.

This commit is contained in:
onurays 2020-03-13 18:41:04 +03:00
parent 85a987ca8d
commit e3246a1f2c
3 changed files with 10 additions and 10 deletions

View File

@ -292,18 +292,18 @@ class RoomDetailFragment @Inject constructor(
is RoomDetailViewEvents.Failure -> showErrorInSnackbar(it.throwable)
is RoomDetailViewEvents.OnNewTimelineEvents -> scrollOnNewMessageCallback.addNewTimelineEventIds(it.eventIds)
is RoomDetailViewEvents.ActionSuccess -> displayRoomDetailActionSuccess(it)
is RoomDetailViewEvents.ActionFailure -> displayRoomDetailActionFailure(it)
is RoomDetailViewEvents.ShowMessage -> showSnackWithMessage(it.message, Snackbar.LENGTH_LONG)
is RoomDetailViewEvents.NavigateToEvent -> navigateToEvent(it)
is RoomDetailViewEvents.FileTooBigError -> displayFileTooBigError(it)
is RoomDetailViewEvents.DownloadFileState -> handleDownloadFileState(it)
is RoomDetailViewEvents.JoinedToAnotherRoom -> handleJoinedToAnotherRoom(it)
is RoomDetailViewEvents.SendMessageResult -> renderSendMessageResult(it)
is RoomDetailViewEvents.ActionFailure -> displayRoomDetailActionFailure(it)
is RoomDetailViewEvents.ShowMessage -> showSnackWithMessage(it.message, Snackbar.LENGTH_LONG)
is RoomDetailViewEvents.NavigateToEvent -> navigateToEvent(it)
is RoomDetailViewEvents.FileTooBigError -> displayFileTooBigError(it)
is RoomDetailViewEvents.DownloadFileState -> handleDownloadFileState(it)
is RoomDetailViewEvents.JoinRoomCommandSucces -> handleJoinedToAnotherRoom(it)
is RoomDetailViewEvents.SendMessageResult -> renderSendMessageResult(it)
}.exhaustive
}
}
private fun handleJoinedToAnotherRoom(action: RoomDetailViewEvents.JoinedToAnotherRoom) {
private fun handleJoinedToAnotherRoom(action: RoomDetailViewEvents.JoinRoomCommandSucces) {
updateComposerText("")
lockSendButton = false
navigator.openRoom(vectorBaseActivity, action.roomId)

View File

@ -50,7 +50,7 @@ sealed class RoomDetailViewEvents : VectorViewEvents {
abstract class SendMessageResult : RoomDetailViewEvents()
object MessageSent : SendMessageResult()
data class JoinedToAnotherRoom(val roomId: String) : SendMessageResult()
data class JoinRoomCommandSucces(val roomId: String) : SendMessageResult()
class SlashCommandError(val command: Command) : SendMessageResult()
class SlashCommandUnknown(val command: String) : SendMessageResult()
data class SlashCommandHandled(@StringRes val messageRes: Int? = null) : SendMessageResult()

View File

@ -518,7 +518,7 @@ class RoomDetailViewModel @AssistedInject constructor(
session.getRoomSummary(command.roomAlias)
?.roomId
?.let {
_viewEvents.post(RoomDetailViewEvents.JoinedToAnotherRoom(it))
_viewEvents.post(RoomDetailViewEvents.JoinRoomCommandSucces(it))
}
}