fix bugs from orm migration

This commit is contained in:
Cadence Ember 2023-09-19 19:10:02 +12:00
parent 1657de4eef
commit b403f35674
2 changed files with 2 additions and 2 deletions

View file

@ -17,7 +17,7 @@ const createRoom = sync.require("../actions/create-room")
async function addReaction(data) { async function addReaction(data) {
const user = data.member?.user const user = data.member?.user
assert.ok(user && user.username) assert.ok(user && user.username)
const parentID = select("event_message", "event_id", "WHERE message = ? AND part = 0").pluck().get(data.message_id) // 0 = primary const parentID = select("event_message", "event_id", "WHERE message_id = ? AND part = 0").pluck().get(data.message_id) // 0 = primary
if (!parentID) return // Nothing can be done if the parent message was never bridged. if (!parentID) return // Nothing can be done if the parent message was never bridged.
assert.equal(typeof parentID, "string") assert.equal(typeof parentID, "string")
const roomID = await createRoom.ensureRoom(data.channel_id) const roomID = await createRoom.ensureRoom(data.channel_id)

View file

@ -181,7 +181,7 @@ module.exports = {
*/ */
async onMessageUpdate(client, data) { async onMessageUpdate(client, data) {
if (data.webhook_id) { if (data.webhook_id) {
const row = select("webhook", "1", "WHERE webhook_id = ?").pluck().get(message.webhook_id) const row = select("webhook", "webhook_id", "WHERE webhook_id = ?").pluck().get(data.webhook_id)
if (row) { if (row) {
// The update was sent by the bridge's own webhook on discord. We don't want to reflect this back, so just drop it. // The update was sent by the bridge's own webhook on discord. We don't want to reflect this back, so just drop it.
return return