@@ -199,19 +199,17 @@ class RustMatrixRoom(
199199 }
200200 }
201201
202- override suspend fun userDisplayName (userId : UserId ): Result <String ?> =
203- withContext(roomDispatcher) {
204- runCatching {
205- innerRoom.memberDisplayName(userId.value)
206- }
202+ override suspend fun userDisplayName (userId : UserId ): Result <String ?> = withContext(roomDispatcher) {
203+ runCatching {
204+ innerRoom.memberDisplayName(userId.value)
207205 }
206+ }
208207
209- override suspend fun userAvatarUrl (userId : UserId ): Result <String ?> =
210- withContext(roomDispatcher) {
211- runCatching {
212- innerRoom.memberAvatarUrl(userId.value)
213- }
208+ override suspend fun userAvatarUrl (userId : UserId ): Result <String ?> = withContext(roomDispatcher) {
209+ runCatching {
210+ innerRoom.memberAvatarUrl(userId.value)
214211 }
212+ }
215213
216214 override suspend fun sendMessage (message : String ): Result <Unit > = withContext(roomDispatcher) {
217215 val transactionId = genTransactionId()
@@ -324,48 +322,42 @@ class RustMatrixRoom(
324322 }
325323 }
326324
327- override suspend fun retrySendMessage (transactionId : TransactionId ): Result <Unit > =
328- withContext(roomDispatcher) {
329- runCatching {
330- innerRoom.retrySend(transactionId.value)
331- }
325+ override suspend fun retrySendMessage (transactionId : TransactionId ): Result <Unit > = withContext(roomDispatcher) {
326+ runCatching {
327+ innerRoom.retrySend(transactionId.value)
332328 }
329+ }
333330
334- override suspend fun cancelSend (transactionId : TransactionId ): Result <Unit > =
335- withContext(roomDispatcher) {
336- runCatching {
337- innerRoom.cancelSend(transactionId.value)
338- }
331+ override suspend fun cancelSend (transactionId : TransactionId ): Result <Unit > = withContext(roomDispatcher) {
332+ runCatching {
333+ innerRoom.cancelSend(transactionId.value)
339334 }
335+ }
340336
341337 @OptIn(ExperimentalUnsignedTypes ::class )
342- override suspend fun updateAvatar (mimeType : String , data : ByteArray ): Result <Unit > =
343- withContext(roomDispatcher) {
344- runCatching {
345- innerRoom.uploadAvatar(mimeType, data.toUByteArray().toList())
346- }
338+ override suspend fun updateAvatar (mimeType : String , data : ByteArray ): Result <Unit > = withContext(roomDispatcher) {
339+ runCatching {
340+ innerRoom.uploadAvatar(mimeType, data.toUByteArray().toList())
347341 }
342+ }
348343
349- override suspend fun removeAvatar (): Result <Unit > =
350- withContext(roomDispatcher) {
351- runCatching {
352- innerRoom.removeAvatar()
353- }
344+ override suspend fun removeAvatar (): Result <Unit > = withContext(roomDispatcher) {
345+ runCatching {
346+ innerRoom.removeAvatar()
354347 }
348+ }
355349
356- override suspend fun setName (name : String ): Result <Unit > =
357- withContext(roomDispatcher) {
358- runCatching {
359- innerRoom.setName(name)
360- }
350+ override suspend fun setName (name : String ): Result <Unit > = withContext(roomDispatcher) {
351+ runCatching {
352+ innerRoom.setName(name)
361353 }
354+ }
362355
363- override suspend fun setTopic (topic : String ): Result <Unit > =
364- withContext(roomDispatcher) {
365- runCatching {
366- innerRoom.setTopic(topic)
367- }
356+ override suspend fun setTopic (topic : String ): Result <Unit > = withContext(roomDispatcher) {
357+ runCatching {
358+ innerRoom.setTopic(topic)
368359 }
360+ }
369361
370362 private suspend fun fetchMembers () = withContext(roomDispatcher) {
371363 runCatching {
@@ -410,4 +402,3 @@ private suspend fun sendAttachment(handle: () -> SendAttachmentJoinHandle): Resu
410402 }
411403 }
412404}
413-
0 commit comments