i dont even know what this PR is supposed to be about anymore, everyone lost the plot somewhere in the middle of act 2 #74
2 changed files with 5 additions and 2 deletions
fell asleep
commit
9cbeef9efb
|
|
@ -211,7 +211,10 @@ as.router.get("/guild", defineEventHandler(async event => {
|
||||||
|
|
||||||
as.router.get("/explain", defineEventHandler(async event => {
|
as.router.get("/explain", defineEventHandler(async event => {
|
||||||
const {type} = await getValidatedQuery(event, schema.explain.parse)
|
const {type} = await getValidatedQuery(event, schema.explain.parse)
|
||||||
const msg = type+" is unsupported" //TODO: actually explain (I'm sure I messed something up anyway, I'll leave it for now)
|
const rule = linkRules.get(Number.parseInt(type))
|
||||||
|
if (!rule) return pugSync.render(event, "explain.pug", {msg: "You cannot bridge type-" + type + " channels because: " + (rule ? rule.unsupported : "OOYE doesn't even know what they are yet.")})
|
||||||
|
else if (rule.unsupported) throw createError({status:400, message: "Bad Request", data: "You cannot bridge " + (rule ? (rule.humanName+"(type-" + channel.type+" channels)") : ("unknown-type ("+channel.type+") channels")) + " because: " + (rule ? rule.unsupported : "OOYE doesn't even know what they are yet.")})
|
||||||
|
else throw createError({status:400, message: "Bad Request", data: "You cannot bridge " + (rule ? (rule.humanName+"(type-" + channel.type+" channels)") : ("unknown-type ("+channel.type+") channels")) + " because: " + (rule ? rule.unsupported : "OOYE doesn't even know what they are yet.")})
|
||||||
return pugSync.render(event, "explain.pug", {msg})
|
return pugSync.render(event, "explain.pug", {msg})
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -201,7 +201,7 @@ as.router.post("/api/link", defineEventHandler(async event => {
|
||||||
|
|
||||||
//Ensure link rules are upheld
|
//Ensure link rules are upheld
|
||||||
const rule = guildRoute.linkRules.get(channel.type)
|
const rule = guildRoute.linkRules.get(channel.type)
|
||||||
if (!rule || rule.unsupported) throw createError({status:400, message: "Bad Request", data: "You cannot bridge " + (rule ? (rule.humanName+"(type-" + channel.type+" channels)") : ("unknown-type ("+channel.type+") channels")) + " because: " + (rule ? rule.unsupported : "OOYE doesn't even know what they are yet.")})
|
if (!rule || rule.unsupported) throw createError({status:400, message: "Bad Request", data: "You cannot bridge " + (rule ? (rule.humanName+"(type-"+channel.type+" channels)") : ("unknown-type ("+channel.type+") channels")) + " because: " + (rule ? rule.unsupported : "OOYE doesn't even know what they are yet.")})
|
||||||
else if (foundSpace && rule.type === "TYPING") throw createError({status: 400, message: "Bad Request", data: "Matrix room cannot be of type m.space when bridging to "+rule.humanName})
|
else if (foundSpace && rule.type === "TYPING") throw createError({status: 400, message: "Bad Request", data: "Matrix room cannot be of type m.space when bridging to "+rule.humanName})
|
||||||
else if (!foundSpace && rule.type === "SPACE") throw createError({status: 400, message: "Bad Request", data: "Matrix room must be of type m.space when bridging to "+rule.humanName})
|
else if (!foundSpace && rule.type === "SPACE") throw createError({status: 400, message: "Bad Request", data: "Matrix room must be of type m.space when bridging to "+rule.humanName})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue