1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-14 00:02:05 +01:00
Commit graph

4620 commits

Author SHA1 Message Date
Florian Schmaus
d1273532ce [muc] Correctly processes self-presences
The change in 52a49769f9 ("[muc] Check for self-presence first in
presence listener") caused all self-presences (MUC user status 110) to
be ignored in the further processing chain eventually invoking
checkRoleModifications() and checkAffiliationModifications(). However,
some servers (e.g., ejabberd) include 110 not only in the initial
presence but in all following, and we ant to process these.

Fixes SMACK-918

Fixes: 52a49769f9
2021-12-13 21:15:30 +01:00
Florian Schmaus
8736e3e434 [core] Remove erroneous "assert !connected" in connect()
Connections like XMPPTCPConnection may still reported connected, if
they are, for example disconnected but resumable. This is already
accounted for in throwAlreadyConnectedExceptionIfAppropriate(), hence
the assert is unnecessary and leads to false negatives for
XMPPTCPConnection.

For the sake of completeness, the right condition, assuming
XMPPTCPConnection is used, for the assert would be:

	assert !connected || disconnectedButResumable;
2021-11-05 10:19:26 +01:00
Florian Schmaus
403890d988 Smack 4.4.5-SNAPSHOT 2021-11-01 18:10:35 +01:00
Florian Schmaus
5731e61782 Smack 4.4.4 2021-11-01 17:54:01 +01:00
Florian Schmaus
22cf7bace8 [resources] Rename get-contributors.sh to generate-notice-file 2021-11-01 17:53:01 +01:00
Florian Schmaus
22b2efc6a6 Update NOTICE file 2021-10-25 17:00:14 +02:00
Florian Schmaus
7fd300888e
Merge pull request #504 from JonathanLennox/StanzaBuilder-remove-extension
Add removeExtension methods to StanzaBuilder.
2021-10-25 16:58:49 +02:00
Jonathan Lennox
4ae3fbb073 Add removeExtension methods to StanzaBuilder. 2021-10-25 14:50:45 +00:00
Florian Schmaus
447c1304cf
Merge pull request #503 from jitsi/bugfix/4.4/bosh-connection2
Add missing stream namespace to xml declaration
2021-10-21 13:35:09 +02:00
Ingo Bauersachs
d8ce2d335b Add missing stream namespace to xml declaration
Fixes 7199003f98
2021-10-21 09:14:52 +02:00
Florian Schmaus
d0be6a6216 [build] Remove OSS Sonatype Snapshot repository
Having the OSS Sonatype Snapshot repository searched causes build
failures if there snapshot dependencies are resolved due the javadoc
linking:

javadoc: error - Error fetching URL: https://jxmpp.org/releases/1.0.3-SNAPSHOT/javadoc/
> Task :javadocAll
javadoc: error - Error fetching URL: https://minidns.org/releases/1.0.2-SNAPSHOT/javadoc/
2 errors
2021-10-20 19:02:19 +02:00
Florian Schmaus
f03f2c75f8
Merge pull request #502 from abyss638/accept_empty_form_label_backport_from_master
Accept empty string as form field label value (backport to 4.4)
2021-10-20 16:29:14 +02:00
Simon Abykov
19270a2eca Accept an empty string as the label value 2021-10-20 10:12:29 +01:00
Florian Schmaus
ab92bc4b40
Merge pull request #501 from Flowdalic/fix-redundant-namespaces
Fix redundant namespaces
2021-10-19 14:29:18 +02:00
Florian Schmaus
0fa6d88575
Merge pull request #500 from jitsi/bugfix/4.4/error-stanzagetter
Add getter for the stanza associated with the exception
2021-10-19 14:29:11 +02:00
Florian Schmaus
a0f97707d8
Merge pull request #499 from jitsi/feature/4.4/osgi
Make Smack jars OSGi bundles
2021-10-19 14:28:59 +02:00
Florian Schmaus
7199003f98
Merge pull request #498 from jitsi/bugfix/4.4/bosh-connection
Fix BOSH connection establishment
2021-10-19 14:10:44 +02:00
Florian Schmaus
9fb7d6d97c
Merge pull request #497 from jitsi/bugfix/4.4/sasl-anonymous
Prevent password enforcement for SASL anonymous
2021-10-19 14:09:39 +02:00
Florian Schmaus
ad6e285346
Merge pull request #496 from damencho/fix-destroy-4.4
fix: Fixes processing destroy unavailable presence.
2021-10-19 14:09:27 +02:00
Florian Schmaus
dac8b728b4
Merge pull request #492 from Flowdalic/start-local-socks5-proxy
Start local SOCKS5 proxy
2021-10-19 14:08:57 +02:00
Florian Schmaus
2ff53abef3
Merge pull request #494 from Flowdalic/mux-race-condition
[muc] Check for self-presence first
2021-10-19 14:08:32 +02:00
Florian Schmaus
d25bd811dc
Merge pull request #491 from Flowdalic/assert-not-end-document
[core] Assert that 'event' is not END_DOCUMENT in forwardToEndTagOfDepth()
2021-10-19 14:08:16 +02:00
Florian Schmaus
6f67553fcf [jingle] Add unit test to check that there are no redundant namespaces
Related to SMACK-917.
2021-10-19 11:34:07 +02:00
Florian Schmaus
453ca6aeb0 [jingle] Make Jingle.Builder extend IqBuilder
This makes Jingle.Builder to follow the new IqBuilder pattern,
allowing to construct Jingle IQs with a given stanza ID (mostly
useful for unit tests).
2021-10-19 11:32:51 +02:00
Florian Schmaus
a3840659aa [jingle] Mimic Manager.connection() in JingleTransportManager
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.
2021-10-19 11:31:08 +02:00
Florian Schmaus
b243a40e26 [core] Pass down the XML environment in IQChildElementXmlStringBuilder
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
2021-10-19 11:29:23 +02:00
Florian Schmaus
585bcb4dc8 [jingle] Add empty element optimization for <content/> 2021-10-19 11:16:35 +02:00
Ingo Bauersachs
27ff37fa98 Add getter for the stanza associated with the exception
Fixes SMACK-916
2021-10-17 16:06:41 +02:00
Ingo Bauersachs
b675aac81b Make Smack jars OSGi bundles
Fixes SMACK-343 by using bnd instead of the deprecated Gradle
plugin that was previously used and removed in commit
d06f533bb9.
2021-10-17 15:57:48 +02:00
Ingo Bauersachs
8074ddd60a Fix BOSH connection establishment
AbstractXMPPConnection waits for the flag lastFeaturesReceived since
57961a8cc1, but it is never set from
BOSH connections. Use parseFeaturesAndNotify instead of
parseFeatures to set the signal.

Similarly the XmlEnvironment is not set from bosh, but required in
ParserUtils.getXmlLang.
2021-10-17 15:00:04 +02:00
Ingo Bauersachs
9b339efbc1 Prevent password enforcement for SASL anonymous
requirePassword from 92f4aadfdc
already excludes SASL external, but missed SASL anonymous.
2021-10-16 21:09:01 +02:00
Дамян Минков
820adf8865 [muc] Also process destory message if it contains <status/>
Fixes SMACK-915
2021-10-13 07:04:32 -07:00
Florian Schmaus
105c74b22b [muc] Call userHasLeft() *after* the leave presence was sent
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.
2021-10-11 09:09:20 +02:00
Florian Schmaus
52a49769f9 [muc] Check for self-presence first in presence listener
Fixes SMACK-914
2021-10-11 09:08:44 +02:00
Florian Schmaus
ec456399b5 [carbons] Remove erroneous assert statement in connectionClosed()
The assert statement in CarbonManager's connectionClosed() connection
listener callback was erroneous. A connection may be connected, but
never was authenticated. If now the connection is closed, then
carbonsListener was never setup (via the authenticated() callback),
causing the assert to throw an exception.
2021-09-27 14:14:01 +02:00
Florian Schmaus
ae4ff244a3 [muc] Check mucServicedDiscoInfo for null in serviceSupportsStableIds()
Fixes SMACK-913.
2021-09-27 13:56:15 +02:00
Florian Schmaus
49ad8c0954 [disco] Add DisocverInfo.nullSafeContainsFuture(DiscoverInfo, CharSequence) 2021-09-27 13:55:52 +02:00
Florian Schmaus
b57cf8375f [socks5] Remove stale null check
The method getLocalStreamHost() does no longer return 'null', hence
the null check is unnecessary.
2021-09-13 18:25:44 +02:00
Florian Schmaus
09710b3203 [socks5] Fix javadoc of getLocalStreamHost()
The method does no longer return null.

Reported-by: Simon Abykov <simon.abykov@gmail.com>
2021-09-13 18:24:54 +02:00
Florian Schmaus
55299fb7e7 [core] Assert that 'event' is not END_DOCUMENT in forwardToEndTagOfDepth() 2021-09-13 10:10:55 +02:00
Florian Schmaus
8ae5ef1f51 [socks5] Ensure that the local SOCKS5 proxy is running (if enabled)
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.
2021-09-13 09:58:15 +02:00
Florian Schmaus
1564b98d60
Merge pull request #490 from JonathanLennox/update-securitymode-docs
Update documentation of default SecurityMode.
2021-09-10 09:04:52 +02:00
Jonathan Lennox
f0a0796d33 Update documentation of default SecurityMode. 2021-09-09 17:28:25 +00:00
Florian Schmaus
0d73c21945 [pubsub] FormNode(Provider) should not fail if there is no DataForm
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
2021-08-23 17:39:59 +02:00
Florian Schmaus
f39e433121
Merge pull request #484 from guusdk/SMACK-908_debugger-tabs_4.4-branch
SMACK-908: Don't use components to count tabs in Debugger
2021-08-03 21:31:38 +02:00
Florian Schmaus
d7c708b167
Merge pull request #486 from Flowdalic/4.4-form-fields-raw
Provide and use the raw values of form fields
2021-08-03 21:29:03 +02:00
Florian Schmaus
8f760eaeb3 [caps] Use the raw character data of form fields when caclulating the hash
Fixes SMACK-909.
2021-07-19 15:38:42 +02:00
Florian Schmaus
e626580f68 [xdata] Safe the raw character data of form field values
Related to SMACK-909.
2021-07-19 15:38:42 +02:00
Florian Schmaus
4643d07ef4 [xdata] Add missing ensureAtMostSingleValue() to parseBooleanFormField 2021-07-18 17:20:50 +02:00
Guus der Kinderen
58774ad05b SMACK-908: Don't use components to count tabs in Debugger
Although the amount of components in a JTabbedPane apparently is often equal to the amount of tabs in it, that need not be the case.
2021-07-08 15:34:16 +02:00