mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-15 01:35:07 +08:00
Merge branch 'develop' into feature/bma/widget_url_robustness
This commit is contained in:
commit
d903dfb40b
@ -9,6 +9,8 @@ Improvements 🙌:
|
||||
|
||||
Bugfix 🐛:
|
||||
- Bug in WidgetContent.computeURL() (#2767)
|
||||
- Duplicate thumbs | Mobile reactions for 👍 and 👎 are not the same as web (#2776)
|
||||
- Join room by alias other federation error (#2778)
|
||||
|
||||
Translations 🗣:
|
||||
-
|
||||
|
@ -17,6 +17,7 @@
|
||||
package org.matrix.android.sdk.internal.session.room.peeking
|
||||
|
||||
import org.matrix.android.sdk.api.MatrixPatterns
|
||||
import org.matrix.android.sdk.api.extensions.tryOrNull
|
||||
import org.matrix.android.sdk.api.session.events.model.EventType
|
||||
import org.matrix.android.sdk.api.session.events.model.toModel
|
||||
import org.matrix.android.sdk.api.session.room.model.RoomAvatarContent
|
||||
@ -65,23 +66,29 @@ internal class DefaultPeekRoomTask @Inject constructor(
|
||||
}
|
||||
|
||||
// Is it a public room?
|
||||
val publicRepoResult = when (getRoomDirectoryVisibilityTask.execute(GetRoomDirectoryVisibilityTask.Params(roomId))) {
|
||||
RoomDirectoryVisibility.PRIVATE -> {
|
||||
// We cannot resolve this room :/
|
||||
null
|
||||
}
|
||||
RoomDirectoryVisibility.PUBLIC -> {
|
||||
val visibilityRes = tryOrNull("## PEEK: failed to get visibility") {
|
||||
getRoomDirectoryVisibilityTask.execute(GetRoomDirectoryVisibilityTask.Params(roomId))
|
||||
}
|
||||
val publicRepoResult = when (visibilityRes) {
|
||||
RoomDirectoryVisibility.PUBLIC -> {
|
||||
// Try to find it in directory
|
||||
val filter = if (isAlias) PublicRoomsFilter(searchTerm = params.roomIdOrAlias.substring(1))
|
||||
else null
|
||||
|
||||
getPublicRoomTask.execute(GetPublicRoomTask.Params(
|
||||
server = serverList.firstOrNull(),
|
||||
publicRoomsParams = PublicRoomsParams(
|
||||
filter = filter,
|
||||
limit = 20.takeIf { filter != null } ?: 100
|
||||
)
|
||||
)).chunk?.firstOrNull { it.roomId == roomId }
|
||||
tryOrNull("## PEEK: failed to GetPublicRoomTask") {
|
||||
getPublicRoomTask.execute(GetPublicRoomTask.Params(
|
||||
server = serverList.firstOrNull(),
|
||||
publicRoomsParams = PublicRoomsParams(
|
||||
filter = filter,
|
||||
limit = 20.takeIf { filter != null } ?: 100
|
||||
)
|
||||
))
|
||||
}?.chunk?.firstOrNull { it.roomId == roomId }
|
||||
}
|
||||
else -> {
|
||||
// RoomDirectoryVisibility.PRIVATE or null
|
||||
// We cannot resolve this room :/
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -95,6 +95,6 @@ class EmojiDataSource @Inject constructor(
|
||||
}
|
||||
|
||||
companion object {
|
||||
val quickEmojis = listOf("👍", "👎", "😄", "🎉", "😕", "❤️", "🚀", "👀")
|
||||
val quickEmojis = listOf("\uD83D\uDC4D️", "\uD83D\uDC4E️", "😄", "🎉", "😕", "❤️", "🚀", "👀")
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user