Rendering typing notification #2242
This commit is contained in:
parent
d5c123622b
commit
5d6716da67
16 changed files with 532 additions and 1 deletions
|
|
@ -73,6 +73,7 @@ import org.matrix.rustcomponents.sdk.RoomInfoListener
|
|||
import org.matrix.rustcomponents.sdk.RoomListItem
|
||||
import org.matrix.rustcomponents.sdk.RoomMessageEventContentWithoutRelation
|
||||
import org.matrix.rustcomponents.sdk.SendAttachmentJoinHandle
|
||||
import org.matrix.rustcomponents.sdk.TypingNotificationsListener
|
||||
import org.matrix.rustcomponents.sdk.WidgetCapabilities
|
||||
import org.matrix.rustcomponents.sdk.WidgetCapabilitiesProvider
|
||||
import org.matrix.rustcomponents.sdk.messageEventContentFromHtml
|
||||
|
|
@ -113,6 +114,21 @@ class RustMatrixRoom(
|
|||
})
|
||||
}
|
||||
|
||||
override val roomTypingMembersFlow: Flow<List<UserId>> = mxCallbackFlow {
|
||||
launch {
|
||||
val initial = emptyList<UserId>()
|
||||
channel.trySend(initial)
|
||||
}
|
||||
innerRoom.subscribeToTypingNotifications(object : TypingNotificationsListener {
|
||||
override fun call(typingUsers: List<String>) {
|
||||
channel.trySend(
|
||||
typingUsers
|
||||
.filter { it != sessionData.userId }
|
||||
.map(::UserId))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// Create a dispatcher for all room methods...
|
||||
private val roomDispatcher = coroutineDispatchers.io.limitedParallelism(32)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue