SamIs there anyone who has done an implementation of Message Styling that would be interested in using a shared set of unit tests to ensure compatibility?
hiranhas left
debaclehas left
Yagizаhas left
Yagizаhas joined
sonnyhas left
sonnyhas joined
marmistrzhas left
etahas left
etahas joined
machas left
marc0shas left
marc0shas joined
antranigvhas joined
marc0shas left
marc0shas joined
marc0shas left
marc0shas joined
sonnyhas left
sonnyhas joined
jubalhhas left
huhnhas left
xeckshas left
marc0shas left
marc0shas joined
antranigvhas left
homebeachhas left
Matrix Traveler (bot)has left
Server Stats Discoverer (traveler bot)has left
Server Stats Discoverer (traveler bot)has joined
Matrix Traveler (bot)has joined
homebeachhas joined
x51has joined
emushas left
antranigvhas joined
antranigvhas left
antranigvhas joined
PapaTutuWawahas left
marc0shas left
pasdesushihas left
Marandahas left
antranigvhas left
xeckshas joined
Marandahas joined
pasdesushihas joined
x51has left
pasdesushihas left
pasdesushihas joined
x51has joined
emushas joined
machas joined
marc0shas joined
marmistrzhas joined
x51has left
alhas joined
x51has joined
malthehas joined
stpeterhas joined
sonnyhas left
lovetoxhas left
sonnyhas joined
sonnyhas left
sonnyhas joined
lovetoxhas joined
malthehas left
marmistrzhas left
x51has left
machas left
machas joined
inkyhas joined
huhnhas joined
malthehas joined
malthehas left
nephelehas joined
antranigvhas joined
alhas left
jubalhhas joined
nepheleSam: What do the unit tests do, check the rendering of items or so?
antranigvhas left
antranigvhas joined
sonnyhas left
sonnyhas joined
sonnyhas left
sonnyhas joined
antranigvhas left
marmistrzhas joined
Apollohas left
inkyhas left
alhas joined
pulkomandyhas joined
qrpnxzhas left
qrpnxzhas joined
x51has joined
antranigvhas joined
qrpnxzhas left
qrpnxzhas joined
debaclehas joined
me9has joined
atomicwatchhas left
machas left
pulkomandyhas left
pulkomandyhas joined
x51has left
Apollohas joined
antranigvhas left
Marandahas left
inkyhas joined
Marandahas joined
Apollohas left
test1has joined
test1has left
antranigvhas joined
Samnephele: yah, they take in a message and spit out what parts of the message should have what styles
nepheleAh, so it's unit tests for the parser part
inkyhas left
sonnyhas left
antranigvhas left
sonnyhas joined
nepheleAre these for https://xmpp.org/extensions/xep-0393.html ?
Samyes
alhas left
nepheleI am reading it, I'm quite lost on what a child block is, is this only in reference to nested quotes?
debaclehas left
nepheleAnyway, I want to implement message formatting for Renga at some point or another, If i can figure out how to include unit tests that could be quite neat to have the same ones
pulkomandyyou can have unit tests in Renga by comparing the text_run_array in a BView with the expected output from the test, I guess? Sounds possible to do at least
antranigvhas joined
marmistrzhas left
nepheleI'm not sure if something like quotes could be represented with a text_run_array
qrpnxzhas left
qrpnxzhas joined
qrpnxzhas left
qrpnxzhas joined
goffihas left
qrpnxzhas left
qrpnxzhas joined
PapaTutuWawahas joined
marmistrzhas joined
alhas joined
Kevhas left
Kevhas joined
qrpnxzhas left
qrpnxzhas joined
x51has joined
qrpnxzhas left
qrpnxzhas joined
Kevhas left
Kevhas joined
Kevhas left
Kevhas joined
Kevhas left
jubalhhas left
sanderhas joined
Kevhas joined
me9has left
me9has joined
Kevhas left
Apollohas joined
Kevhas joined
Kevhas left
Kevhas joined
inkyhas joined
xeckshas left
antranigvhas left
antranigvhas joined
jubalhhas joined
me9has left
antranigvhas left
inkyhas left
alhas left
xeckshas joined
malthehas joined
pulkomandyhas left
pulkomandyhas joined
qrpnxzhas left
qrpnxzhas joined
Kevhas left
x51has left
Yagizаhas left
Kevhas joined
inkyhas joined
qrpnxzhas left
qrpnxzhas joined
qrpnxzhas left
qrpnxzhas joined
marmistrzhas left
Սամուէլhas joined
lovetoxthe more i look into python xml libs the more i believe xmpps decision to not use prefixes is actually the weird thing that nobody does
lovetoxi think one can say there i almost no support in libs for so called "default" namespaces
lovetoxpythons etree.Element, has no way of setting a default namespace, nor parsing it
lovetoxlxml supports them better, but it still fills like something which is a second class citizen
PapaTutuWawahas left
Kevhas left
Kevhas joined
malthehas left
alhas joined
marc0shas left
marc0shas joined
marc0shas left
marc0shas joined
marc0shas left
marc0shas joined
xeckshas left
marc0shas left
marc0shas joined
debaclehas joined
x51has joined
PapaTutuWawahas joined
xeckshas joined
jgarthas joined
Wojtekhas left
MattJlovetox, I've no idea what you mean... an XML library either supports namespaces or it doesn't. XMPP doesn't do anything weird, and there's not really any such thing as a "default namespace" in XML (actually there is, but let's not go there)
nephelehas left
lovetoxi also thought that, but its not the case, or it depends what you mean by supports
antranigvhas joined
lovetoxif you parse that with pythons included xml lib
lovetox'<a xmlns="test" />'
lovetoxyou get an object and if you serialise it back its
lovetox'<ns0:a xmlns:ns0="test" />'
Zashwhy the
Kevhas left
Trblfk would you implement xmpp in python
flowlooks like a valid transformation?
Zashlooks like an excellent way to convince people that xml is scary and to use json instead
floweven though not an optimal one
lovetoxflow how does that help me if xmpp says i should use no prefixes :D
Trblshould or must
Trbli'd just say fuck it if its the first case
flowprobably not much, but then again, I think, at least those kind of prefixes are fine
Kevhas joined
flowa different (and desirable) kind of prefixes are the ones that a declare in <stream/>✎
flowa different (and desirable) kind of prefixes are the ones that a declared in <stream/> ✏
flowthose are probably likely to cause issues with certain impelementations
flowbut not the prefixes that are introduced by the transformation you showed
flowassuming they are only done on a sub <stream/> level
lovetoxso every server will be ok if i send
lovetox<ns0:message xmlns:ns0="jabber:client" />
lovetoxbecause that would be great :D
ZashProsody will be fine.
```
> util.xml.parse[[<ns0:message xmlns:ns0="jabber:client" />]]
<message xmlns='jabber:client'/>
```
malthehas joined
flowlovetox, maybe not every server, but chances are high that the XML parser on the receiving end will handle it just fine
flowbut still, the transformation is not space-efficient, so you may want to avoid it
flowmaybe there is simple switch to change the behavior of serialiser?
Zashspace-efficiency would be to stuff a ton of namespace prefixes on the stream header
Zash`<sm:r/>` etc
flowsure, but let's do baby step and get this fixed first✎
flowsure, but let's do baby steps and get this fixed first ✏
x51has left
flowZash, would prosody support namespace declartions in <stream/>? if so, announce it as stream feature and I'll implement an optimization in Smack for it
Kevhas left
ZashAll that's handled transparently by libexpat, so should work fine
huhnhas left
ZashThe receiving/parsing side at least.
flowZash, then we should consider specifying a stream feature for this. so that clients can safely perform this optimization
flowas I have heard that other servers bail on it
marc0shas left
marc0shas joined
Kevhas joined
ZashSure
x51has joined
malthehas left
MattJBut the stream feature comes after the client already sent the opening stream header...
ZashSave it for the post-sasl stream restart
Zashassuming we still have a stream restart in the future
MattJCarry state between the unauthed and authed streams?!
Zash😱️
ZashMaybe, one day, we should redesign the whole stream startup thing.
flowif it's an non-TLS connection that its fine
flowotherwise you have to announce the feature after TLS
flowbut before auth
flowI think this should be safe?
ZashMake it client-first, where it sends all the extensions it wants, and the server picks the parts it likes
MattJversion='2.0'
ZashSince this is the server telling the client things _after_ it has been authenticated with TLS & certs
Zashno wait
Zashaaaaargh, everything is backwards
Zashor
Zashso confused
ZashServer does advertise things after it has been authenticated. Then the client authenticates. And then it does the thing.
ZashSo, should be fine?
x51has left
marc0shas left
marc0shas joined
flowsimply in the stream features of step 8 in RFC 6120 § 9.1.1
flowthen the client can declare the namespaces in step 13
Kevhas left
flowso besides the <mechanisms/> in <stream:features/> you have a <namespace-prefixes-in-stream/> flag
Zashas a bonus, after the restart, throw in a namespaced attribute on the opening stream header to tell the server it's okay to do the same thing