mirror of
https://github.com/element-hq/element-android
synced 2024-11-28 05:31:21 +03:00
DialPad: clean code
This commit is contained in:
parent
a95eed7163
commit
d520dfe108
5 changed files with 2 additions and 9 deletions
|
@ -29,7 +29,7 @@ class DialPadLookup @Inject constructor(
|
|||
private val webRtcCallManager: WebRtcCallManager,
|
||||
private val directRoomHelper: DirectRoomHelper
|
||||
) {
|
||||
sealed class Failure : Throwable(){
|
||||
sealed class Failure : Throwable() {
|
||||
object NoResult: Failure()
|
||||
object NumberIsYours: Failure()
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ class DialPadLookup @Inject constructor(
|
|||
} else {
|
||||
thirdPartyUser.userId
|
||||
}
|
||||
if(nativeUserId == session.myUserId) throw Failure.NumberIsYours
|
||||
if (nativeUserId == session.myUserId) throw Failure.NumberIsYours
|
||||
val roomId = directRoomHelper.ensureDMExists(nativeUserId)
|
||||
return Result(userId = nativeUserId, roomId = roomId)
|
||||
}
|
||||
|
|
|
@ -26,13 +26,11 @@ import dagger.assisted.AssistedInject
|
|||
import im.vector.app.AppStateHandler
|
||||
import im.vector.app.RoomGroupingMethod
|
||||
import im.vector.app.core.di.HasScreenInjector
|
||||
import im.vector.app.core.platform.EmptyViewEvents
|
||||
import im.vector.app.core.platform.VectorViewModel
|
||||
import im.vector.app.features.call.dialpad.DialPadLookup
|
||||
import im.vector.app.features.call.lookup.CallProtocolsChecker
|
||||
import im.vector.app.features.call.webrtc.WebRtcCallManager
|
||||
import im.vector.app.features.createdirect.DirectRoomHelper
|
||||
import im.vector.app.features.home.room.detail.RoomDetailViewEvents
|
||||
import im.vector.app.features.ui.UiStateRepository
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
|
|
|
@ -46,4 +46,3 @@ sealed class HomeTab(@StringRes val titleRes: Int) {
|
|||
data class RoomList(val displayMode: RoomListDisplayMode) : HomeTab(displayMode.titleRes)
|
||||
object DialPad : HomeTab(R.string.call_dial_pad_title)
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,6 @@ import im.vector.app.core.mvrx.runCatchingToAsync
|
|||
import im.vector.app.core.platform.VectorViewModel
|
||||
import im.vector.app.core.resources.StringProvider
|
||||
import im.vector.app.features.call.conference.JitsiService
|
||||
import im.vector.app.features.call.dialpad.DialPadLookup
|
||||
import im.vector.app.features.call.lookup.CallProtocolsChecker
|
||||
import im.vector.app.features.call.webrtc.WebRtcCallManager
|
||||
import im.vector.app.features.command.CommandParser
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
|
||||
package im.vector.app.features.home.room.detail
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.activity.result.ActivityResultLauncher
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.fragment.app.Fragment
|
||||
|
@ -29,7 +28,6 @@ import im.vector.app.features.call.webrtc.WebRtcCallManager
|
|||
import im.vector.app.features.settings.VectorPreferences
|
||||
import org.matrix.android.sdk.api.session.widgets.model.WidgetType
|
||||
|
||||
|
||||
class StartCallActionsHandler(
|
||||
private val roomId: String,
|
||||
private val fragment: Fragment,
|
||||
|
@ -152,5 +150,4 @@ class StartCallActionsHandler(
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue