Compare commits

..

No commits in common. "7712bc34a6081a62cd06e2b046f3ba8869c44aa7" and "97ab77a0608adfa0e4b3f490b11c7717273873f9" have entirely different histories.

3 changed files with 4 additions and 35 deletions

View file

@ -63,8 +63,9 @@ async function channelToKState(channel, guild) {
assert.ok(typeof spaceID === "string")
const row = db.prepare("SELECT nick, custom_avatar FROM channel_room WHERE channel_id = ?").get(channel.id)
const customName = row?.nick
const customAvatar = row?.custom_avatar
assert(row)
const customName = row.nick
const customAvatar = row.custom_avatar
const [convertedName, convertedTopic] = convertNameAndTopic(channel, guild, customName)
const avatarEventContent = {}

View file

@ -27,31 +27,3 @@ test("event2message: janky test", t => {
}]
)
})
test("event2message: long messages are split", t => {
t.deepEqual(
eventToMessage({
content: {
body: ("a".repeat(130) + " ").repeat(19),
msgtype: "m.text"
},
event_id: "$g07oYSZFWBkxohNEfywldwgcWj1hbhDzQ1sBAKvqOOU",
origin_server_ts: 1688301929913,
room_id: "!kLRqKKUQXcibIMtOpl:cadence.moe",
sender: "@cadence:cadence.moe",
type: "m.room.message",
unsigned: {
age: 405299
}
}),
[{
username: "cadence",
content: (("a".repeat(130) + " ").repeat(15)).slice(0, -1),
avatar_url: undefined
}, {
username: "cadence",
content: (("a".repeat(130) + " ").repeat(4)).slice(0, -1),
avatar_url: undefined
}]
)
})

View file

@ -1,12 +1,8 @@
// @ts-check
const fs = require("fs")
const assert = require("assert").strict
const yaml = require("js-yaml")
/** @ts-ignore @type {import("../types").AppServiceRegistrationConfig} */
const reg = yaml.load(fs.readFileSync("registration.yaml", "utf8"))
assert(reg.ooye.max_file_size)
assert(reg.ooye.namespace_prefix)
assert(reg.ooye.server_name)
module.exports = reg