mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Merge pull request #6865 from bxdxnn/feat/myroomnick
Add `/myroomnick` slash command to change your display name in the current room
This commit is contained in:
+7
@@ -212,4 +212,11 @@ interface JoinedRoom : BaseRoom {
|
||||
* @return Result indicating success or failure.
|
||||
*/
|
||||
suspend fun sendLiveLocation(geoUri: String): Result<Unit>
|
||||
|
||||
/**
|
||||
* Sets the display name of the current user within this room.
|
||||
* This is different from the global setDisplayName which updates
|
||||
* the user's display name across all of their rooms.
|
||||
*/
|
||||
suspend fun setOwnMemberDisplayName(displayName: String): Result<Unit>
|
||||
}
|
||||
|
||||
+6
@@ -548,6 +548,12 @@ class JoinedRustRoom(
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun setOwnMemberDisplayName(displayName: String): Result<Unit> = withContext(roomDispatcher) {
|
||||
runCatchingExceptions {
|
||||
innerRoom.setOwnMemberDisplayName(displayName)
|
||||
}
|
||||
}
|
||||
|
||||
override fun close() = destroy()
|
||||
|
||||
override fun destroy() {
|
||||
|
||||
+5
@@ -92,6 +92,7 @@ class FakeJoinedRoom(
|
||||
private val startLiveLocationShareResult: (Long) -> Result<EventId> = { lambdaError() },
|
||||
private val stopLiveLocationShareResult: () -> Result<Unit> = { lambdaError() },
|
||||
private val sendLiveLocationResult: (String) -> Result<Unit> = { lambdaError() },
|
||||
private val setOwnMemberDisplayNameResult: (String) -> Result<Unit> = { lambdaError() },
|
||||
) : JoinedRoom, BaseRoom by baseRoom {
|
||||
private val sendQueueUpdates = MutableSharedFlow<SendQueueUpdate>(extraBufferCapacity = 10)
|
||||
|
||||
@@ -255,6 +256,10 @@ class FakeJoinedRoom(
|
||||
sendLiveLocationResult(geoUri)
|
||||
}
|
||||
|
||||
override suspend fun setOwnMemberDisplayName(displayName: String): Result<Unit> = simulateLongTask {
|
||||
setOwnMemberDisplayNameResult(displayName)
|
||||
}
|
||||
|
||||
private suspend fun simulateSendMediaProgress(progressCallback: ProgressCallback?) {
|
||||
progressCallbackValues.forEach { (current, total) ->
|
||||
progressCallback?.onProgress(current, total)
|
||||
|
||||
Reference in New Issue
Block a user