Conversation
…so fix permalinks)
|
jmartinesp
left a comment
There was a problem hiding this comment.
I ran a quick few tests and it seems to work fine, thanks! I added a few comments, feel free to ignore them if they don't seem important enough.
| private const val MATRIX_EVENT_IDENTIFIER_V3_REGEX = "\\$$BASE_64_ALPHABET" | ||
| private val PATTERN_CONTAIN_MATRIX_EVENT_IDENTIFIER_V3 = MATRIX_EVENT_IDENTIFIER_V3_REGEX.toRegex(RegexOption.IGNORE_CASE) | ||
|
|
||
| // Ref: https://matrix.org/docs/spec/rooms/v4#event-ids | ||
| private const val MATRIX_EVENT_IDENTIFIER_V4_REGEX = "\\$[A-Z0-9\\-_]+" | ||
| private const val MATRIX_EVENT_IDENTIFIER_V4_REGEX = "\\$$BASE_64_URL_SAFE_ALPHABET" |
There was a problem hiding this comment.
This change modifies the v3 and v4 regexes so they admit new characters, but I guess we're ok with this.
| private val roomGetter: RoomGetter, | ||
| @UserId private val userId: String | ||
| @UserId private val userId: String, | ||
| private val stateEventDataSource: StateEventDataSource, |
| internal fun StateEventDataSource.getRoomPowerLevels(roomId: String): RoomPowerLevels { | ||
| val powerLevelsContent = getStateEvent(roomId, EventType.STATE_ROOM_POWER_LEVELS, QueryStringValue.IsEmpty) | ||
| ?.content?.toModel<PowerLevelsContent>() | ||
| val roomCreateContent = getStateEvent(roomId, EventType.STATE_ROOM_CREATE, QueryStringValue.IsEmpty)?.getRoomCreateContentWithSender() | ||
| return RoomPowerLevels(powerLevelsContent, roomCreateContent) | ||
| } |
There was a problem hiding this comment.
It's a bit weird to have this code duplicate in Room too. Is there any way to reuse one implementation for the other method?
| val User = Value(0) | ||
| val Moderator = Value(50) | ||
| val Admin = Value(100) | ||
| val SuperAdmin = Value(150) |
There was a problem hiding this comment.
Owner is an Element thing, not a matrix one
|
This has caused my client to show e.g. |
Type of change
Content
Sorry for the big PR !
This should close all the issues related to new room version, including :
Also, the custom values for power levels have been removed.
Motivation and context
Close #9063
Close #9064
Close #9062
Close #9061
Screenshots / GIFs
Tests
Tested devices
Checklist