Eventually JingleTransportManager should be a subclass of Manager (or
be replaced by Manager), as JingleTransportManager holds a strong
reference to the XMPPConnection. This could cause memory leaks. But
for now, we mimic the Manager API in JingleTransportManger to make a
future transition to Manager easier.
This allows to avoid redundant XML namespaces within IQs, like for
example here:
<iq xmlns='jabber:client' id='EKP8I-1' type='set'>
<jingle xmlns='urn:xmpp:jingle:1' action='content-accept' sid='MySession'>
<content xmlns='urn:xmpp:jingle:1' creator='initiator' name='Hello world'>
</content>
</jingle>
</iq>
Fixes SMACK-917
Reported-by: Jonathan Lennox
Calling userHasLeft before sending the leave presence may result in
invalid state as the MUC presence lister may modify the MUCs local
state, e.g., occupantsMap, conurrently with the leave operation.
If we reset it after the leave presence was send and acknowledged,
then this can not happen as the server will not longer send any MUC
related presences to us.
Also fixes SMACK-914. In theory 52a49769f9 ("[muc] Check for
self-presence first in presence listener") alone would fix SMACK-914,
but this also fixes it indepentendly of 52a49769f9. Both commits are
sensible, so both are applied.
In 9352225f44 ("Rework SOCKS5 unit tests so that they can be run in
parallel") the call to getSocks5Proxy() in
Socks5BytestreamManager.getLocalStreamHost() was removed. Since
getSocks5Proxy() does also start the local proxy, if it is not already
running, this caused Smack to no longer automatically start the local
proxy.
This commit re-adds the call to getSocks5Proxy() and fixes SMACK-912.
This also fixes a errornous merge where the same branch with different
commit was merged into master and 4.4
The conflicting commits are
4.4:
8f760eaeb3 getRawValueCharSequences
e626580f68
master:
b47225c2c1 getRawValues
097d245358
Error IQ respones may not contain a data form, e.g.
<iq type="error" id="6LXNC-48" from="pubsub.openfire.xmpp.test" to="anno@openfire.xmpp.test/5dsi4g084a">
<pubsub xmlns="http://jabber.org/protocol/pubsub#owner">
<configure node="fdp/submitted/spot_report"/>
</pubsub>
<error code="403" type="auth">
<forbidden xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
</error>
</iq>
Also FormNode's toXML() already handled the case where submitForm was
'null'. Only the constructor threw a IAE if submitForm was 'null'.
Fixes SMACK-910.
Closes: https://github.com/igniterealtime/Smack/pull/471
XmlPullParser.getName() only returns a result if the current parser
event is START_ELEMENT or END_ELEMENT. If this is not the case, then
the method may throw (if StAX is used).
XmlPullParser.getName() only returns a result if the current parser
event is START_ELEMENT or END_ELEMENT. If this is not the case, then
the method may throw (if StAX is used).
The arguments 'to', 'cc, and 'bcc' may be null, hence ensure that they
are non-null when calling e.g. size() on them.
Fixes SMACK-907
Fixes: df96c57093 ("[address] Get rid of PacketCopy workaround")
Refactored using
find . -type f -name "*.java" |\
xargs sed -i -E |\
's/\.createStanzaCollectorAndSend\((\w+)\)\.nextResultOrThrow\(\);/.sendIqRequestAndWaitForResponse(\1);/'
and some manual refactoring.
ExtensionElement is now a marker interface that requires all
implementation non-abstract classes to carry a static final QNAME
field (of type QName). This is verified by a new unit test.
Also FullyQualifiedElement is renamed to simply XmlElement. XmlElement
is used over ExtensionElement when implementing classes do not
statically know the qualified name of the XML elements they
represent. In general, XmlElement should be used sparingly, and every
XML element should be modeled by its own Java class (implementing
ExtensionElement).