Hello, I'm trying to implement some xhtml-im in Renga so I can get irc colors and styling from Biboumi. But I don't see the xhtml in the messages I receive. I am testing with messages stored in the backlog of a muc (no mam implementation yet in renga), could that be a problem? What else should I check?
thomaslewishas left
machas left
xnamedhas left
marmistrzhas left
pulkomandy
I have added the namespace to my disco info (I think), and it doesn't seem to help
moparisthebest
I didn't know biboumi did xhtml-im
nephelehas left
pulkomandy
https://github.com/louiz/biboumi/blob/master/src/bridge/colors.cpp
A very small subset of it, to render some of IRC formatting (foreground and colors, bold, italics, underline)
nephelehas joined
nephelehas left
nephelehas joined
goffihas joined
larmahas left
machas joined
nephelehas left
homebeachhas left
Matrix Traveler (bot)has left
Matrix Traveler (bot)has joined
homebeachhas joined
jgarthas left
nephelehas joined
nephelehas left
nephelehas joined
nephelehas left
rafasaurushas left
J Marinarohas left
rafasaurushas joined
nephelehas joined
nephelehas left
nephelehas joined
nephelehas left
nephelehas joined
nephelehas left
Millesimushas joined
Yagizаhas left
Millesimushas left
SouLhas left
TheCoffeMakerhas left
nephelehas joined
SouLhas joined
nephelehas left
nephelehas joined
Millesimushas joined
nephelehas left
TheCoffeMakerhas joined
nephelehas joined
nephelehas left
nephelehas joined
nephelehas left
nephelehas joined
nephelehas left
nephelehas joined
nephelehas left
nephelehas joined
nephelehas left
nephelehas joined
nephelehas left
J Marinarohas joined
nephelehas joined
nephelehas left
goffihas left
Maranda
pulkomandy: last I checked biboumi did appear to strip all XHTML-IM from reflected messages
machas left
dezanthas left
nephelehas joined
larmahas joined
nephelehas left
me9has joined
me9has left
marc0shas left
marc0shas joined
Link Mauve
Maranda, it doesn’t parse XHTML-IM from XMPP clients, but it does convert IRC formatting to XHTML-IM.
Link Mauve
pulkomandy, I have never tested it from the MAM history, but looking at the sqlite schema it doesn’t seem to store it.
Maranda
Link Mauve: well but if a xmpp client sends a message containing XHTML-IM is it supposed to reflect it back mangling the stanza and stripping the XHTML-IM content?
Link Mauve
Maranda, yes, since it couldn’t parse the XHTML-IM it just reflects the body.
Link Mauve
So that you don’t think it worked and have the same view as other IRC users.
Maranda
Does it preserve the id at least?
jubalhhas left
qwestionhas left
Link Mauve
Not sure.
Link Mauve
IRC also doesn’t have this concept.
Marandais trying to figure a bug with bifrost
Maranda
Which is not exactly a bug... But biboumi not preserving id on reflection and mangling the stanza completely confused deduplication indeedly✎
Maranda
Which is not exactly a bug... But biboumi not preserving id on reflection and mangling the stanza completely confuses deduplication indeedly ✏
Marandaprobably should also keep a hash of the message body
Link Mauve
Maranda, an issue with that is how to handle split messages?
Link Mauve
Say you sent a message over two lines, and got a reflection of the first line in one message, and the second line in another message.
Link Mauve
What should you do? What should biboumi do?
Maranda
Huhu but is there actually a need to split out reflected messages on the XMPP Horizon...?
Marandathinks not.
machas joined
Link Mauve
Well, this is about IRC, not XMPP.
Link Mauve
IRC doesn’t support messages longer than 512 bytes (including your recipient name, some command, and the phase of the moon).
jubalhhas joined
pulkomandy
> pulkomandy, I have never tested it from the MAM history, but looking at the sqlite schema it doesn’t seem to store it.
That's a bit unexpected, so MAM loses all formatting and possibly anything in a message that it doesn't support? Not really what I expect from an archive?
Link Mauve
Actually if the IRC colors are stored in the body in the table it might, but I have no easy way to test MAM here, especially not with formatting, since I have no other IRC client than biboumi.
Maranda
Link Mauve: well if I send a message longer than 512 bytes it's fine if it gets split on IRC, less so if the reflected message by biboumi MUC interface gives me back 2 messages instead of one, not that it's forbidden or anything by the spec that I can recall.. but for sure that may confuse some clients.
Link Mauve
Maranda, you’d be confused as well if you got kicked for having flooded a room, and not understand why because to you it was a single message.
jgarthas joined
Maranda
Well if biboumi does mangle the stanza, doesn't preserve the id, may not preserve the message body contents and even split out reflections, I got nothing to match on 😆
Maranda
Oookay
nephelehas joined
xnamedhas joined
nephelehas left
nephelehas joined
nephele
ircv3 has message ids link mauve
Link Mauve
Might be useful, could you mention that on the biboumi bug tracker?
Link Mauve
Do IRC servers use this extension?
nephelehas left
nephelehas joined
nephele
I don't know, i have not investigated it much
nephele
https://ircv3.net/specs/extensions/message-ids
nephele
Where is the bugtracker?
Link Mauve
At https://lab.louiz.org/louiz/biboumi/-/issues
nephele
You need message tags enabled to use that spec anyhow, you could also use message tags to store xmpp specific data potentially
Link Mauve
How does that work?
Link Mauve
Is it a container for arbitrary payloads?
nephele
kinda, yeah
nephele
"Message tags are a mechanism for adding additional metadata on a per-message basis. This is achieved via an extension to the protocol message format, enabled via capability negotiation."
link mauve: any specific ticket? or just put the link somewhere?
Link Mauve
I’m not sure, and I’m going to take a nap, yesterday has been tiring.
Link Mauve
Sorry, if you haven’t found anything I’ll look for one in about one hour or so.
nephelehas left
nephelehas joined
nephele
okay, I didn't know where you wanted that info, I'd have to dig out my gitlan credentials... so if you want to add it that is cool too :)
nephelehas left
nephelehas joined
jubalhhas left
nephelehas left
nephelehas joined
marc0shas joined
nephelehas left
nephelehas joined
debaclehas joined
pulkomandy
I confirm that I get xhtml-im for new irc messages but not from muc backlog. That makes my testing a bit more difficult, being able to re-check the same message would be nice
pulkomandy
Now let's write a css parser…
Millesimushas left
Zashwishes for the SVG approach to styles
jubalhhas joined
Zash
I.e. attributes like `color="blue"` instead of `style="color:blue"`
nephelehas left
pasdesushihas left
nephelehas joined
nephele
I should learn how xml works, and see if i can make my formatted messages work with xml instead of json
nephelehas left
nephelehas joined
nephelehas left
jubalhhas left
me9has joined
me9has left
nephelehas joined
nephelehas left
nephelehas joined
nephelehas left
nephelehas joined
nephelehas left
nephelehas joined
nephelehas left
rafasaurushas left
nephelehas joined
nephelehas left
rafasaurushas joined
Alexhas left
Alexhas joined
dezanthas joined
Alexhas left
Alexhas joined
machas left
machas joined
goffihas joined
nephelehas joined
dezanthas left
dezanthas joined
nephelehas left
pulkomandy
so... the xhtml-im content is <html xmlns='http://jabber.org/protocol/xhtml-im'><body xmlns='http://www.w3.org/1999/xhtml'>[<span style='color:blue;'>HaikuArchives/Renga</span>] <span style='color:brown;'>pulkomandy</span> pushed <span style='color:green;'>1</span> commit to <span style='color:green;'>master</span> [+0/-0/±1] <span style='color:lightmagenta;'>https://github.com/HaikuArchives/Renga/compare/8d709ab45869...98879d2afdec</span></body></html>
pulkomandy
trying to iterate over this with gloox I get one cdata string "[] pushed commit to [+0/-0/±1]" and 5 spans
pulkomandy
not sure I can reconstruct the correct message from that :/
pulkomandy
(that's one single cdata lumping together whatever is outside the spans)
jubalhhas joined
Maranda
Gloox 😰
pulkomandy
it was working reasonably well until now
pulkomandy
do I have to rewrite my whole client yet again using something else?
Dele Olajidehas joined
Dele Olajidehas left
Maranda
No, but I think just the mention spawns at least some decade old painful memories 😅
thomaslewishas joined
Dele Olajidehas joined
Dele Olajidehas left
Dele Olajidehas joined
thomaslewishas left
thomaslewishas joined
Dele Olajidehas left
nephelehas joined
nephelehas left
nephelehas joined
Millesimushas joined
thomaslewishas left
marc0shas left
marc0shas joined
pulkomandy
well I opened a bug on gloox bugtracker about it as I don't see a way I can reconstruct the message correctly from their API. And I'd rather not add another XML parser to my client (getting one to work right is enough of a problem, I think?)
Dele Olajidehas joined
dezanthas left
Link Mauve
In poezio, I chose to serialise the XHTML-IM body to string, and re-parse it with a SAX parser, which gives events in-order based on the position in the stream.
Link Mauve
Very convenient for appending characters to a buffer as we go.
nephelehas left
Dele Olajidehas left
Dele Olajidehas joined
pulkomandy
yes, I can do that, I guess. So are there any recommendations for an XML parser easy to use from C++ for this?
jubalhhas left
Dele Olajidehas left
Link Mauve
Most likely gloox already uses one, so you may want to reuse the same.
thomaslewishas joined
goffihas left
thomaslewishas left
pulkomandy
I think gloox does its own parsing, see Tag::parse in https://camaya.net/api/gloox-trunk/tag_8cpp_source.html
pulkomandy
or is that parsing xpath quesries?
Link Mauve
Looks like XPath indeed.
Link Mauve
ldd doesn’t list any known SAX library though.
pulkomandy
yes, xml parser is here: https://camaya.net/api/gloox-trunk/parser_8cpp_source.html