Create chat invite
This commit is contained in:
1 parent
534f28986d
commit
add6c7fd31
1 file changed
+19
-6
+19
-6
@@ -113,12 +113,25 @@ class ChatRoomDetailViewModel(
|
|||||||
if (keyPackageEvent == null) {
|
if (keyPackageEvent == null) {
|
||||||
chatRoomDetailUIState = ChatRoomDetailUIState.Error("Missing Key Package") // TODO: Introduce missing key package UI State...
|
chatRoomDetailUIState = ChatRoomDetailUIState.Error("Missing Key Package") // TODO: Introduce missing key package UI State...
|
||||||
} else {
|
} else {
|
||||||
// TODO: Create new chat and invite local
|
// Create new chat and invite local
|
||||||
chatRepository.createMlsDirectMessage(
|
try {
|
||||||
userPublicKey = activeUserPublicKey,
|
val chatRoomId = chatRepository.createMlsDirectMessage(
|
||||||
peerPublicKey = chatRoomId,
|
userPublicKey = activeUserPublicKey,
|
||||||
peerKeyPackage = keyPackageEvent
|
peerPublicKey = chatRoomId,
|
||||||
)
|
peerKeyPackage = keyPackageEvent,
|
||||||
|
)
|
||||||
|
|
||||||
|
onNavigateToChat.invoke(
|
||||||
|
ChatRoomDetailRoute(
|
||||||
|
activeUserPublicKey = activeUserPublicKey,
|
||||||
|
chatRoomId = chatRoomId,
|
||||||
|
relayHint = relayHint
|
||||||
|
)
|
||||||
|
)
|
||||||
|
} catch (e: Throwable) {
|
||||||
|
chatRoomDetailUIState = ChatRoomDetailUIState.Error("Failed to create chat")
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in new issue
Block a user