Add some tests (mainly imported from EA). Also change type from String to SessionId, RoomId, etc.
This commit is contained in:
parent
6b3aef23fa
commit
1faedca69d
54 changed files with 1569 additions and 151 deletions
|
|
@ -20,3 +20,5 @@ import java.io.Serializable
|
|||
|
||||
@JvmInline
|
||||
value class EventId(val value: String) : Serializable
|
||||
|
||||
fun String.asEventId() = EventId(this)
|
||||
|
|
|
|||
|
|
@ -20,3 +20,5 @@ import java.io.Serializable
|
|||
|
||||
@JvmInline
|
||||
value class RoomId(val value: String) : Serializable
|
||||
|
||||
fun String.asRoomId() = RoomId(this)
|
||||
|
|
|
|||
|
|
@ -17,3 +17,5 @@
|
|||
package io.element.android.libraries.matrix.api.core
|
||||
|
||||
typealias SessionId = UserId
|
||||
|
||||
fun String.asSessionId() = SessionId(this)
|
||||
|
|
|
|||
|
|
@ -25,3 +25,5 @@ value class SpaceId(val value: String) : Serializable
|
|||
* Value to use when no space is selected by the user.
|
||||
*/
|
||||
val MAIN_SPACE = SpaceId("!mainSpace")
|
||||
|
||||
fun String.asSpaceId() = SpaceId(this)
|
||||
|
|
|
|||
|
|
@ -20,3 +20,5 @@ import java.io.Serializable
|
|||
|
||||
@JvmInline
|
||||
value class ThreadId(val value: String) : Serializable
|
||||
|
||||
fun String.asThreadId() = ThreadId(this)
|
||||
|
|
|
|||
|
|
@ -20,3 +20,5 @@ import java.io.Serializable
|
|||
|
||||
@JvmInline
|
||||
value class UserId(val value: String) : Serializable
|
||||
|
||||
fun String.asUserId() = UserId(this)
|
||||
|
|
|
|||
|
|
@ -16,6 +16,10 @@
|
|||
|
||||
package io.element.android.libraries.matrix.api.notification
|
||||
|
||||
import io.element.android.libraries.matrix.api.core.EventId
|
||||
import io.element.android.libraries.matrix.api.core.RoomId
|
||||
import io.element.android.libraries.matrix.api.core.SessionId
|
||||
|
||||
interface NotificationService {
|
||||
suspend fun getNotification(userId: String, roomId: String, eventId: String): Result<NotificationData?>
|
||||
suspend fun getNotification(userId: SessionId, roomId: RoomId, eventId: EventId): Result<NotificationData?>
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue