Finish room diffing and syncing. All tests pass
This commit is contained in:
parent
f09eeccef3
commit
3fbe7eed6e
13 changed files with 658 additions and 529 deletions
|
@ -36,7 +36,7 @@ async function uploadDiscordFileToMxc(path) {
|
|||
const body = res.body
|
||||
|
||||
// Upload to Matrix
|
||||
/** @type {import("../types").R_FileUploaded} */
|
||||
/** @type {import("../types").R.FileUploaded} */
|
||||
const root = await mreq.mreq("POST", "/media/v3/upload", body, {
|
||||
headers: {
|
||||
"Content-Type": res.headers.get("content-type")
|
||||
|
|
|
@ -10,8 +10,9 @@ const reg = sync.require("./read-registration.js")
|
|||
|
||||
const baseUrl = "https://matrix.cadence.moe/_matrix"
|
||||
|
||||
class MatrixServerError {
|
||||
class MatrixServerError extends Error {
|
||||
constructor(data) {
|
||||
super(data.error || data.errcode)
|
||||
this.data = data
|
||||
/** @type {string} */
|
||||
this.errcode = data.errcode
|
||||
|
@ -35,7 +36,7 @@ async function mreq(method, url, body, extra = {}) {
|
|||
}
|
||||
}, extra)
|
||||
|
||||
console.log(baseUrl + url, opts)
|
||||
// console.log(baseUrl + url, opts)
|
||||
const res = await fetch(baseUrl + url, opts)
|
||||
const root = await res.json()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue