For some applications that have strict requirements on blocking calls,
it might be beneficial to create the SSLContext in advance and
provide it to the client/componentxmpp instance that will be going
through kwargs until XMLStream.
The context will be reconfigured later on based on user parameters, but
it is highly recommended to set it up in a secure way.
having a hardcoded default ID in make_iq is a bad idea, particularly
since it will overwrite the (good) id produced byt Iq() when a stream is
available.
This is arguably a breaking change, but I certainly hope it is not
breaking anything in the real world.
According to XEP-0004:
- if there is no "type" attribute on a <field />, we should assume it is
"text-single";
- "text-single" MUST NOT contain morethan one <value />.
Before this patch, not specifying a field type and passing a multi-line
string would result in an illegal stanza.
While it would be cleaner to log a warning or even raise an exception if
set_value() is called with an incompatible type, this breaks a lot of
tests and backward-compatibility, so we introduce some heuristic in
FormField.set_value() to infer the field type based on the provided
value instead.
I also changed FormField.get_value() so that it returns a list by
default for 'text-multi' fields. This is a breaking change, but I have
not found the justification for the previous behaviour.
If an error happened while parsing a stanza, it would bring the whole
program down and disconnect instead of logging an error. And the DEBUG
log happened afterwards (so, never).
Although it is not documented whether the get_bob API
call can return None, the default implementation can,
which raises a TypeError when the requested BoB is not
available. This commit prevents such TypeError by
raising a XMPPError instead.
References: https://todo.sr.ht/~nicoco/slidcord/23
aiodns is broken on the default windows event loop and the workaround
has significant downsides. This has downsides too as it prevents
resolution of SRV records by default.