Open requested to merge mjk/python-nbxmpp:sla into master
Implements https://xmpp.org/extensions/xep-0478.html, namely:
- Parses and exposes stream limits values via methods of
- Checks elements against the size limit before sending in
Allows applications (the application, heh) to be less conservative in uploaded avatar sizes and... that's it, basically. :D
- Some (preliminary) typing is added and variables renamed here and there, mainly to make the changes more clear but also to document existing behavior.
- An unintended consequence is that
data-sentevent now sends
Node. This change wasn't strictly necessary, but keeping the old way would've required storing stanzas in the queue in both, serialized and node form.
I haven't find any subscribers to this event in nbxmpp or Gajim. Haven't looked at plugins though.Derp, I didn't search for
stanza-sentin Gajim. The type change actually broke XML console, lol. I see it doesn't use the node structure at all, and with a tiny change it works with
bytes... but I think it'd be a code quality improvement if the event argument is made strictly a
Nodein the future, so I guess I'll have to store both forms of data in the queue.
I tested this briefly with an artificial limit of 800 bytes. There only was a traceback from the omemo module trying to publish 10 KB of bundles... which seems not to be a fatal error for omemo.
Factor out the size check
Add the check to WebsocketConnection.send(obsolete)
Revert the change of
data-sentevent argument type
Test avatar publishing
Test with a server that actually advertises the limits!