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

5094 commits

Author SHA1 Message Date
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
bc281d84a7
Merge pull request #487 from fenuz/feature/multiversion_mam_support
Add support for multiple versions of MAM
2021-08-26 17:15:38 +02:00
Frank Matheron
5b857a1b82 [mam] Support multiple versions of MAM
Support multiple version of MAM and do discovery of the version of MAM supported by
the archive. Currently supported MAM versions are v1 and v2.

Fixes SMACK-911

See https://discourse.igniterealtime.org/t/mam-support-of-multiple-mam-versions/90136
2021-08-26 16:49:06 +02:00
Florian Schmaus
3f2418dec7 [core] Fix spelling errors in code comment within PacketParserUtils 2021-08-25 22:54:23 +02:00
Florian Schmaus
c13f4ccac3 [mam] Fix MamPrfsIQProviderTest
Parsers handed over to IQ providers should be positioned at the IQ
child element when being invoked. Therefore we remove the wrapping
<iq> in some test XML.

Also make checkMamPrefsIQProvider() a paramterized test.
2021-08-25 22:52:26 +02:00
Florian Schmaus
613f1afcab [mam] Delete unused local variable 'iqType' in MamPrefsIQProvider 2021-08-25 22:48:31 +02:00
Florian Schmaus
001985647a Merge branch '4.4'
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
2021-08-23 18:02:00 +02: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
32a38c4e77 [core] Check if the successor vertex exists in StateDescriptorGraph
If the successor's module is disabled then the vertex may be null. In
this case, we can simple continue with the next successor in the list.

Previously, due to d33a5a23c3 ("[core] Introduce
Builder.failOnUnknownStates() and unit tests") this would trigger an
assert in addOutgoingEdge().

Fixes: d33a5a23c3 ("[core] Introduce Builder.failOnUnknownStates() and unit tests")
2021-08-22 16:30:30 +02:00
Florian Schmaus
a0b9279441 [sinttest] Add "compatibility mode" setting 2021-08-22 16:16:03 +02:00
Dan Caseley
48c057ab10 [sinttest] Additional tests for s5 of XEP-0045
Modified-by: Florian Schmaus <flo@geekplace.eu>
2021-08-22 15:29:07 +02:00
Florian Schmaus
98d530819f
Merge pull request #488 from vanitasvitae/bumpPgpainless
OpenPGP: Bump PGPainless to 0.2.8
2021-08-10 16:49:46 +02:00
9e33fc56e1
Bump PGPainless to 0.2.8 2021-08-10 15:23:49 +02:00
9c5b0a2a16
Bump Bouncycastle to 1.69 2021-08-10 14:51:52 +02:00
Florian Schmaus
b9be45ae2c [xdata] Fix ProtectedMembersInFinalClass Error Prone warning 2021-08-03 22:07:04 +02:00
Florian Schmaus
59d3d75a71 Merge branch '4.4' 2021-08-03 21:54:50 +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
b47225c2c1 [caps] Use the raw character data of form fields when caclulating the hash 2021-07-18 17:22:06 +02:00
Florian Schmaus
097d245358 [xdata] Safe the raw character data of form field values 2021-07-18 17:21:50 +02:00
Florian Schmaus
4643d07ef4 [xdata] Add missing ensureAtMostSingleValue() to parseBooleanFormField 2021-07-18 17:20:50 +02:00
Florian Schmaus
a057db107e [ox-im] Annotate sporadically failing assertTrue() 2021-07-16 08:56:48 +02:00
Florian Schmaus
f64288ba6d [sinttest] Treat NPE as test failure not as abort condition 2021-07-16 08:56:48 +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
Florian Schmaus
c9af25c674
Merge pull request #483 from guusdk/SMACK-908_debugger-tabs
SMACK-908: Don't use components to count tabs in Debugger
2021-07-08 12:03:31 +02:00
Guus der Kinderen
0a8da1a07f 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 10:32:19 +02:00
Florian Schmaus
56507a761f Smack 4.4.3
-----BEGIN PGP SIGNATURE-----
 
 iQGTBAABCgB9FiEEl3UFnzoh3OFr5PuuIjmn6PWFIFIFAmDkTYtfFIAAAAAALgAo
 aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDk3
 NzUwNTlGM0EyMURDRTE2QkU0RkJBRTIyMzlBN0U4RjU4NTIwNTIACgkQIjmn6PWF
 IFJ5lwf/eOMA+WdaddTsn/uQj0dq7Qhtt89Zj02bW1zIF6isYs8boGGtOqaQkcqa
 Cc1hLXVg725f8UU6wTy+5MRTUG/vj8/SH/1zbrgI1oizOv0Ug+ipBy5wzM1i5Om7
 1PVpy2yH9UHVXljt9ejUo+WcC/UQSy2REQ4gzm+aTox74lW/rC99NAFa98vr7uHf
 YZAmEp/vAfI0mRymrYxgir/M0aeCY20Dlo2xvUZbugq7Nm6tIHbELm8g6M52XYkw
 7T6VB5W/2p+IZH4itgtfuiQk4jTgkn9T6oVAZzw3kufv0DCuNN9dMtIIfJwXwOv9
 jgv76LBZPzL18lhBDfxyyG0ws97O+A==
 =EZ8x
 -----END PGP SIGNATURE-----

Merge tag '4.4.3'

Smack 4.4.3
2021-07-06 14:51:29 +02:00
Florian Schmaus
00249f3a67 Smack 4.4.4-SNAPSHOT 2021-07-06 14:51:00 +02:00
Florian Schmaus
524e4b1d9b Smack 4.4.3 2021-07-06 14:33:15 +02:00
Florian Schmaus
d33a5a23c3 [core] Introduce Builder.failOnUnknownStates() and unit tests
The previous approach of emitting a severe log message when a
state (descriptor) was unknown was misleading. There are valid cases
where some states are not known, if, for example, a module was
explicitly disabled.

Using Builder.failOnUnknownStates() in unit tests is far cleaner, as
the existence of unknown states is tested in a controlled environment:
one where are states are supposed to be known.
2021-07-06 14:06:39 +02:00
Florian Schmaus
b6c8754012 Merge branch '4.4' 2021-07-06 13:38:56 +02:00
Florian Schmaus
31e4e1faf2 Do not call XmlPullParser.getName() when the event is unknown
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).
2021-07-06 13:37:57 +02:00
Florian Schmaus
5eef31e49c Do not call XmlPullParser.getName() when the event is unknown
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).
2021-07-06 12:33:11 +02:00
Florian Schmaus
4120b42761 [omemo] Add OmemoManager.purgeEveryting()
This is basically the already existing method from
OmemoManagerSetupHelper.cleanUpPubSub() moved over into OmemoManager
as purgeEverything().
2021-07-06 12:31:47 +02:00
Guus der Kinderen
5e203086b3 [sint] increase stability
Some roster-based tests depend on there not being any prior subscription state beteween entities. The utility method that
tries to guarantee that, acts on the state of the roster that's cached in memory, but acts on the one that's stored on the
server. This occasionally causes issues, as both representations might be different.

Stability is added in this commit by:
- refreshing the roster from the server prior to evaluating it
- ignoring an 'item-not-found' as returned by the server, when the code tries to remove that item.
2021-06-25 16:08:31 +02:00
Florian Schmaus
3fde4830e4 Merge branch '4.4' 2021-06-25 15:08:36 +02:00
Florian Schmaus
2762325639 [repl] Bump Scala to 2.13.6 and Ammonite to 2.4.0 2021-06-21 15:04:26 +02:00
Florian Schmaus
6434e77336 [sinttest] Use correct camel case in method name: s/MUC/muc/
See also https://google.github.io/styleguide/javaguide.html#s5.3-camel-case
2021-06-21 14:52:18 +02:00