mirror of
https://gitdab.com/cadence/out-of-your-element.git
synced 2025-09-10 04:12:50 +02:00
Sync new power system to newly created rooms
This commit is contained in:
parent
df1296e579
commit
b8793dae0f
4 changed files with 11 additions and 4 deletions
|
@ -142,6 +142,8 @@ async function channelToKState(channel, guild) {
|
|||
const everyonePermissions = utils.getPermissions([], guild.roles, undefined, channel.permission_overwrites)
|
||||
const everyoneCanMentionEveryone = utils.hasAllPermissions(everyonePermissions, ["MentionEveryone"])
|
||||
|
||||
const globalAdmins = select("member_power", ["mxid", "power_level"], {room_id: "*"}).all()
|
||||
|
||||
const channelKState = {
|
||||
"m.room.name/": {name: convertedName},
|
||||
"m.room.topic/": {topic: convertedTopic},
|
||||
|
@ -161,7 +163,7 @@ async function channelToKState(channel, guild) {
|
|||
notifications: {
|
||||
room: everyoneCanMentionEveryone ? 0 : 20
|
||||
},
|
||||
users: reg.ooye.invite.reduce((a, c) => (a[c] = 100, a), {})
|
||||
users: globalAdmins.reduce((a, c) => (a[c.mxid] = c.power_level, a), {})
|
||||
},
|
||||
"chat.schildi.hide_ui/read_receipts": {
|
||||
hidden: true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue