libQuotient icon indicating copy to clipboard operation
libQuotient copied to clipboard

Message editing support (send)

Open KitsuneRal opened this issue 5 years ago • 0 comments

Currently the library doesn't make it easy: one has to fall back on Room::sendEvent() and TextContent, only to find soon enough that both body and formatted_body have to be prepared in diverging ways due to mx-reply/reply fallbacks snafu in the spec. In the best case, the developers find a way to create an RoomMessageEvent with TextContent that has a RelatesTo component (not too hard but needs diving into RoomMessageEvent code to find out); in the worst case they end up [falling back over to Room::sendJson()](https://invent.kde.org/network/neochat /-/blob/1.2/src/neochatroom.cpp#L571).

The smallest that can probably be done is to add an Omittable<RelatesTo> parameter to Room::postHtmlMessage() in a way similar to how TextContent works. At best some help in constructing the bodies (plain and formatted) should be provided; but that effectively requires "stringification" of events to finally take its place in the library.

KitsuneRal avatar Jul 25 '19 06:07 KitsuneRal