parent
9a2ad3928a
commit
8860647477
30 changed files with 203 additions and 736 deletions
|
|
@ -14,22 +14,9 @@ import io.element.android.libraries.matrix.api.core.RoomId
|
|||
import io.element.android.libraries.matrix.api.core.SessionId
|
||||
import kotlinx.parcelize.Parcelize
|
||||
|
||||
sealed interface CallType : NodeInputs, Parcelable {
|
||||
@Parcelize
|
||||
data class ExternalUrl(val url: String) : CallType {
|
||||
override fun toString(): String {
|
||||
return "ExternalUrl"
|
||||
}
|
||||
}
|
||||
|
||||
@Parcelize
|
||||
data class RoomCall(
|
||||
val sessionId: SessionId,
|
||||
val roomId: RoomId,
|
||||
val isAudioCall: Boolean
|
||||
) : CallType {
|
||||
override fun toString(): String {
|
||||
return "RoomCall(sessionId=$sessionId, roomId=$roomId, isAudioCall=$isAudioCall)"
|
||||
}
|
||||
}
|
||||
}
|
||||
@Parcelize
|
||||
data class CallData(
|
||||
val sessionId: SessionId,
|
||||
val roomId: RoomId,
|
||||
val isAudioCall: Boolean
|
||||
) : NodeInputs, Parcelable
|
||||
|
|
@ -17,13 +17,13 @@ import io.element.android.libraries.matrix.api.core.UserId
|
|||
interface ElementCallEntryPoint {
|
||||
/**
|
||||
* Start a call of the given type.
|
||||
* @param callType The type of call to start.
|
||||
* @param callData The data of call to start.
|
||||
*/
|
||||
fun startCall(callType: CallType)
|
||||
fun startCall(callData: CallData)
|
||||
|
||||
/**
|
||||
* Handle an incoming call.
|
||||
* @param callType The type of call.
|
||||
* @param callData The data of call.
|
||||
* @param eventId The event id of the event that started the call.
|
||||
* @param senderId The user id of the sender of the event that started the call.
|
||||
* @param roomName The name of the room the call is in.
|
||||
|
|
@ -35,7 +35,7 @@ interface ElementCallEntryPoint {
|
|||
* @param textContent The text content of the notification. If null the default content from the system will be used.
|
||||
*/
|
||||
suspend fun handleIncomingCall(
|
||||
callType: CallType.RoomCall,
|
||||
callData: CallData,
|
||||
eventId: EventId,
|
||||
senderId: UserId,
|
||||
roomName: String?,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue