Room version 12 and room upgrades

This commit is contained in:
Cadence Ember
2026-01-07 02:43:20 +13:00
parent 092a4cf7b0
commit 55e0e5dfa1
27 changed files with 666 additions and 483 deletions
+42 -7
View File
@@ -4985,7 +4985,7 @@ test("event2message: @room converts to @everyone and is allowed when the room do
event_id: "$SiXetU9h9Dg-M9Frcw_C6ahnoXZ3QPZe3MVJR5tcB9A"
}, data.guild.general, {
api: {
getStateEvent(roomID, type, key) {
async getStateEvent(roomID, type, key) {
called++
t.equal(roomID, "!kLRqKKUQXcibIMtOpl:cadence.moe")
t.equal(type, "m.room.power_levels")
@@ -4996,6 +4996,19 @@ test("event2message: @room converts to @everyone and is allowed when the room do
room: 0
}
}
},
async getStateEventOuter(roomID, type, key) {
t.equal(roomID, "!kLRqKKUQXcibIMtOpl:cadence.moe")
t.equal(type, "m.room.create")
t.equal(key, "")
return {
type: "m.room.create",
state_key: "",
sender: "@_ooye_bot:cadence.moe",
content: {
room_version: "11"
}
}
}
}
}),
@@ -5016,7 +5029,6 @@ test("event2message: @room converts to @everyone and is allowed when the room do
})
test("event2message: @room converts to @everyone but is not allowed when the room restricts who can use it", async t => {
let called = 0
t.deepEqual(
await eventToMessage({
type: "m.room.message",
@@ -5031,8 +5043,7 @@ test("event2message: @room converts to @everyone but is not allowed when the roo
event_id: "$SiXetU9h9Dg-M9Frcw_C6ahnoXZ3QPZe3MVJR5tcB9A"
}, data.guild.general, {
api: {
getStateEvent(roomID, type, key) {
called++
async getStateEvent(roomID, type, key) {
t.equal(roomID, "!kLRqKKUQXcibIMtOpl:cadence.moe")
t.equal(type, "m.room.power_levels")
t.equal(key, "")
@@ -5042,6 +5053,19 @@ test("event2message: @room converts to @everyone but is not allowed when the roo
room: 20
}
}
},
async getStateEventOuter(roomID, type, key) {
t.equal(roomID, "!kLRqKKUQXcibIMtOpl:cadence.moe")
t.equal(type, "m.room.create")
t.equal(key, "")
return {
type: "m.room.create",
state_key: "",
sender: "@_ooye_bot:cadence.moe",
content: {
room_version: "11"
}
}
}
}
}),
@@ -5062,7 +5086,6 @@ test("event2message: @room converts to @everyone but is not allowed when the roo
})
test("event2message: @room converts to @everyone and is allowed if the user has sufficient power to use it", async t => {
let called = 0
t.deepEqual(
await eventToMessage({
type: "m.room.message",
@@ -5077,8 +5100,7 @@ test("event2message: @room converts to @everyone and is allowed if the user has
event_id: "$SiXetU9h9Dg-M9Frcw_C6ahnoXZ3QPZe3MVJR5tcB9A"
}, data.guild.general, {
api: {
getStateEvent(roomID, type, key) {
called++
async getStateEvent(roomID, type, key) {
t.equal(roomID, "!kLRqKKUQXcibIMtOpl:cadence.moe")
t.equal(type, "m.room.power_levels")
t.equal(key, "")
@@ -5090,6 +5112,19 @@ test("event2message: @room converts to @everyone and is allowed if the user has
room: 20
}
}
},
async getStateEventOuter(roomID, type, key) {
t.equal(roomID, "!kLRqKKUQXcibIMtOpl:cadence.moe")
t.equal(type, "m.room.create")
t.equal(key, "")
return {
type: "m.room.create",
state_key: "",
sender: "@_ooye_bot:cadence.moe",
content: {
room_version: "11"
}
}
}
}
}),