mirror of
https://gitdab.com/cadence/out-of-your-element.git
synced 2025-09-10 04:12:50 +02:00
Finish moving from SQL to New Funny ORM
This commit is contained in:
parent
4e1e590c3a
commit
79bd0254f0
19 changed files with 87 additions and 87 deletions
|
@ -3,7 +3,7 @@
|
|||
const assert = require("assert").strict
|
||||
|
||||
const passthrough = require("../../passthrough")
|
||||
const { discord, sync, db } = passthrough
|
||||
const {discord, sync, db, select} = passthrough
|
||||
/** @type {import("../../matrix/api")} */
|
||||
const api = sync.require("../../matrix/api")
|
||||
/** @type {import("./register-user")} */
|
||||
|
@ -17,7 +17,7 @@ const createRoom = sync.require("../actions/create-room")
|
|||
async function addReaction(data) {
|
||||
const user = data.member?.user
|
||||
assert.ok(user && user.username)
|
||||
const parentID = db.prepare("SELECT event_id FROM event_message WHERE message_id = ? AND part = 0").pluck().get(data.message_id) // 0 = primary
|
||||
const parentID = select("event_message", "event_id", "WHERE message = ? AND part = 0").pluck().get(data.message_id) // 0 = primary
|
||||
if (!parentID) return // Nothing can be done if the parent message was never bridged.
|
||||
assert.equal(typeof parentID, "string")
|
||||
const roomID = await createRoom.ensureRoom(data.channel_id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue