Split part and reaction_part

Now, reactions should always end up on the bottom of a message group,
instead of sometimes being in the middle.
This commit is contained in:
Cadence Ember 2023-10-14 22:08:10 +13:00
parent b7f90db20a
commit c24752625d
13 changed files with 121 additions and 71 deletions

View file

@ -16,7 +16,7 @@ const emoji = sync.require("../converters/emoji")
async function addReaction(event) {
const channelID = select("channel_room", "channel_id", {room_id: event.room_id}).pluck().get()
if (!channelID) return // We just assume the bridge has already been created
const messageID = select("event_message", "message_id", {event_id: event.content["m.relates_to"].event_id, part: 0}).pluck().get() // 0 = primary
const messageID = select("event_message", "message_id", {event_id: event.content["m.relates_to"].event_id}, "ORDER BY reaction_part").pluck().get()
if (!messageID) return // Nothing can be done if the parent message was never bridged.
const key = event.content["m.relates_to"].key