-
pulkomandy
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?
-
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
-
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)
-
Maranda
pulkomandy: last I checked biboumi did appear to strip all XHTML-IM from reflected messages
-
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?
-
Link Mauve
Not sure.
-
Link Mauve
IRC also doesn’t have this concept.
- Maranda is 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 ✏
- Maranda probably 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...?
- Maranda thinks not.
-
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).
-
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.
-
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
-
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?
-
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."
-
nephele
spec: https://ircv3.net/specs/extensions/message-tags
-
nephele
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.
-
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 :)
-
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…
- Zash wishes for the SVG approach to styles
-
Zash
I.e. attributes like `color="blue"` instead of `style="color:blue"`
-
nephele
I should learn how xml works, and see if i can make my formatted messages work with xml instead of json
-
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)
-
Maranda
Gloox 😰
-
pulkomandy
it was working reasonably well until now
-
pulkomandy
do I have to rewrite my whole client yet again using something else?
-
Maranda
No, but I think just the mention spawns at least some decade old painful memories 😅
-
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?)
-
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.
-
pulkomandy
yes, I can do that, I guess. So are there any recommendations for an XML parser easy to use from C++ for this?
-
Link Mauve
Most likely gloox already uses one, so you may want to reuse the same.
-
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
-
Link Mauve
So maybe it does do its own thing.
-
Link Mauve
Riht.✎ -
Link Mauve
Right. ✏
-
pulkomandy
so I don't get anything lower level than the Tag class from that
-
Link Mauve
Wut, why does gloox handle XML comments?
-
Link Mauve
Lines 308-322.
-
Link Mauve
pulkomandy, Tag::addCData seems to add it to both the m_cdata and the m_nodes members, you want to iterate on the latter.
-
Link Mauve
Nodes in XML are either element nodes or text nodes.
-
pulkomandy
but m_nodes is private and has no getter or iterator in Tag
-
Link Mauve
Seems to be the issue you want to fix then.
-
pulkomandy
yes, seems reasonable to add a way to access this if it's already there
-
pulkomandy
ok, that worked :). Now let's add the css parser
-
moparisthebest
Sam, re: host-meta tests, minimal nginx.conf's required: https://github.com/moparisthebest/xmpp-proxy/blob/master/integration/23-s2s-websocket-host-meta/nginx1.conf & https://github.com/moparisthebest/xmpp-proxy/blob/master/integration/24-s2s-websocket-host-meta-json/nginx1.conf pretty simple I think