-
Notifications
You must be signed in to change notification settings - Fork 855
Room v12 support #9065
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Room v12 support #9065
Conversation
…so fix permalinks)
|
jmartinesp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change modifies the v3 and v4 regexes so they admit new characters, but I guess we're ok with this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, used same as EX
| private val roomGetter: RoomGetter, | ||
| @UserId private val userId: String | ||
| @UserId private val userId: String, | ||
| private val stateEventDataSource: StateEventDataSource, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this used anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I've changed it
| val User = Value(0) | ||
| val Moderator = Value(50) | ||
| val Admin = Value(100) | ||
| val SuperAdmin = Value(150) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why SuperAdmin and not Owner?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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