[WIP] threads. #74

Draft
Guzio wants to merge 147 commits from Guzio/out-of-your-element:mergable-fr-fr into main
Showing only changes of commit 17cc56299d - Show all commits

Nevermind, Commet is *just broken* when it comes to threads.

It refuses to render the 1st message of a thread, whether it's an emote, or anything else. COMMET, *WHY?*

Anyway, I don't think it makes sense to add extra accommodation to what's clearly a client-level bug. So emotes are back, yay!
Guzio 2026-10-13 23:29:54 +02:00

View file

@ -31,9 +31,8 @@ async function threadToAnnouncement(parentRoomID, threadRoomID, creatorMxid, thr
context["m.relates_to"] = {"m.in_reply_to": {event_id: event.event_id}, is_falling_back:false, event_id: event.event_id, rel_type: "m.thread"}
}
//TODO: Wait until certain clients (*cough* Commet *cough*) figure out how to render an m.emote in a thread, and then simplify this to creatorMxid ? "m.emote" : "m.text" and creatorMxid ? "started a thread called" : "New thread started:"
const msgtype = creatorMxid && !branchedFromEventID ? "m.emote" : "m.text"
const template = creatorMxid ? `${branchedFromEventID ? `${creatorMxid} ` : ""}started a thread called` : "New thread started:"
const msgtype = creatorMxid ? "m.emote" : "m.text"
const template = creatorMxid ? "started a thread called" : "New thread started:"
const via = await mxUtils.getViaServersQuery(threadRoomID, di.api)
let body = `${template} \"${thread.name}\" in room: https://matrix.to/#/${threadRoomID}?${via.toString()}${suffix}`