Show Admins and Mods in the Joined Room.
Categories
(Chat Core :: Matrix, enhancement)
Tracking
(Not tracked)
People
(Reporter: matrixisreal, Assigned: clokep, Mentored)
References
Details
Attachments
(1 file, 3 obsolete files)
2.39 KB,
patch
|
pmorris
:
review+
|
Details | Diff | Splinter Review |
Reporter | ||
Updated•8 years ago
|
Reporter | ||
Comment 1•8 years ago
|
||
Comment 2•8 years ago
|
||
Reporter | ||
Comment 3•8 years ago
|
||
Assignee | ||
Comment 4•8 years ago
|
||
Assignee | ||
Updated•7 years ago
|
Assignee | ||
Comment 5•6 years ago
|
||
This implements ops/half-ops for Matrix.
I actually wrote this before realizing there was a patch on this bug already, but the implementation pretty much ended up being the same.
This:
- Implements op / half-op / founder using the "power level" concept in Matrix (https://matrix.org/docs/spec/client_server/r0.5.0#m-room-power-levels)
- Listens for the power level change event and refreshes the information, if necessary.
To test this you can connect to Matrix and join "#test:matrix.org".
Assignee | ||
Comment 6•6 years ago
|
||
Oops, eslint for an error I had missed when changing a normal function to an arrow function.
Assignee | ||
Comment 7•6 years ago
|
||
Sorry for the noise. I found a bug on this while working on subsequent patches.
Assignee | ||
Comment 8•6 years ago
|
||
Comment 9•6 years ago
|
||
Assignee | ||
Updated•6 years ago
|
Comment 10•6 years ago
|
||
Pushed by clokep@gmail.com:
https://hg.mozilla.org/comm-central/rev/5f93ed1690ab
Show Admins and Mods in Matrix rooms. r=pmorris
Assignee | ||
Updated•6 years ago
|
Comment 11•6 years ago
|
||
Please note that nothing prevents someone having a powerlevel higher than 100. This is just the default for "founders". Some homeservers might have other values (or you can edit the DB to get a higher PL, but need to do so on every participating server).
So I'd have put return this._roomMember.powerLevelNorm >= 100;
.
But matrix permissions are more complex, so founder == max power level in the room might be even better. Or just "founder" as anyone who has the right to change the permissions in the room (this._roomMember.powerLevelNorm >= m.room.power_levels
, as seen set to 99 in the following example).
That said, the current implementation is fine for 99.5% of the rooms I am in, so feel free to ignore this to concentrate on more important stuff. I could try to submit a PR myself to flex the contribution pipeline.
{
"type": "m.room.power_levels",
"unsigned": {
"replaces_state": "$1576229797338615onFBj:matrix.org",
"prev_sender": "@mod1:mod1.org",
"age": 104,
"prev_content": {
<...>
},
"event_id": "$01001010001FHeaZ:mod2.net",
"origin_server_ts": 1576229992129,
"content": {
"ban": 50,
"invite": 0,
"events": {
"m.room.topic": 50,
"m.room.avatar": 50,
"im.vector.modular.widgets": 50,
"m.room.canonical_alias": 50,
"m.room.power_levels": 99,
"m.room.history_visibility": 100,
"m.room.name": 50,
"m.room.tombstone": 50,
"m.room.encryption": 50
},
"kick": 50,
"events_default": 0,
"users_default": 0,
"state_default": 50,
"redact": 50,
"users": {
"@mod2:mod2.net": 100,
"@mod1:mod1.org": 100
}
},
"state_key": "",
"sender": "@mod2:mod2.net",
"room_id": "!theroomID:matrix.org"
}
Assignee | ||
Comment 12•6 years ago
|
||
Hi Mayeul! Thanks for taking an interest in some of the Matrix work! It is nice to have someone more familiar with the Matrix internals taking a look at it.
My understanding was that "power levels" can go to whatever, but the JavaScript SDK has a concept of "normalized" power levels (see docs: https://matrix-org.github.io/matrix-js-sdk/2.4.1/module-models_room-member.html). Unfortunately the docs don't have much information, so I kind of took a guess that it would be right "most" of the time. Does that make sense?
I think you're probably correct that a founder should be someone who has "all" the powers (can ban, invite, kick, redact, etc.), but I think the way it is shown in Thunderbird isn't specific enough since it just gives a relative power (nothing, silver star, gold star, flag) next to the user's name.
If this doesn't work in specific cases I'd be all for fixing it (and we should probably file a separate bug for that)!
Thanks again for your thoughts. I hope the above makes sense.
Assignee | ||
Updated•5 years ago
|
Description
•