Commit Graph

214 Commits

Author SHA1 Message Date
Florian Schmaus cfccc78ba0 [muc] Rename local variable 'presence' to 'reflectedSelfPresence'
To increase readability, and with that maintainability, we rename
'presence' to 'reflectedSelfPresence' in MultiUserChat.enter(), to
make it clear what kind of presence this variable holds.

Also mark the variable as final.
2020-11-03 22:31:22 +01:00
Florian Schmaus 3f9ca68134 Delete TypedCloneable 2020-06-14 17:38:51 +02:00
damencho 8e337d7810 [muc] Make providesMucService() use the KNOWN_MUC_SERVICES cache
This reduces the number of disco#info queries on MUC join in some
situations.
2020-06-12 15:54:14 +02:00
Florian Schmaus 50cb7735d1 [muc] Add generic callback invoked if a participant is removed
Fixes SMACK-883.
2020-05-13 22:14:43 +02:00
Florian Schmaus ab2d3a2b79 [core] Deprecate AbstractConnectionListener 2020-05-13 22:14:43 +02:00
Florian Schmaus 13abeb9626 [muc] Deprecate DefaultUserStatusListener 2020-05-13 22:01:17 +02:00
Florian Schmaus aacd94c62e [muc] Deprecate DefaultParticipantStatusListener 2020-05-13 22:00:42 +02:00
Florian Schmaus 77e26fc575 Re-work data form API
Apply builder pattern to form fields and replace getVariable() with
getFieldName(). Refer to the field name as "field name" instead of
"variable" everyone, just as XEP-0004 does.

Improve the high-level form API: introduce FilledForm and FillableForm
which perform stronger validation and consistency checks.

Also add FormFieldRegistry to enable processing of 'submit' forms
where the form field types are omitted.

Smack also now does omit the form field type declaration on 'submit'
type forms, as it is allowed by XEP-0004.
2020-05-13 20:14:41 +02:00
Florian Schmaus 8e1003723e Specify correct and full version in @since javadoc tag
The next release of Smack will be 4.4.0.
2020-04-18 19:02:30 +02:00
Florian Schmaus d0347d1e00 muc: add removed() callback to UserStatusListener 2020-04-17 22:26:28 +02:00
adiaholic 22cff274bb Remove unexpected `MucNotJoinedException` from `MultiUserChat.leave()`
Occupant information should be reset after `leavePresence`
and `reflectedLeavePresenceFilter` are built.
2020-04-17 20:10:45 +05:30
Florian Schmaus 0f7b7df1f0 muc: fix roomDestroyed() callback
The previous site where the callback was invoked was only reached if
there was also a user status on the unvailable presence. But those are
not part of unavilable presences upon room destruction.

Fixes SMACK-888.
2020-04-16 21:59:19 +02:00
Florian Schmaus 20aaef2628 muc: remove 'joined' boolean from MultiUserChat, use myRoomJid instead
If myRoomJid is set, we are joined.
2020-04-16 21:44:55 +02:00
Florian Schmaus 26ab832452 muc: only call userHasLeft() at one site
There is no need to duplicate that code. Also ensure that
userHasLeft() is invoked *before* the listeners are invoked, so that
e.g. isJoined() returns false in the listeners.
2020-04-16 21:40:06 +02:00
Florian Schmaus ab2822be3e muc: also set myRoomJid to null if we have left the room 2020-04-16 21:39:52 +02:00
Florian Schmaus c519dd1213 muc: do check for equality twice
We already performed the presence.getFrom().equals(myRoomJID) check
and saved its result. No need to do it again.
2020-04-16 21:38:55 +02:00
Florian Schmaus e2e228fc93 muc: synchronize Stats.create(Integer)
Since this method is used by the MUCUserProvider, it is potentially
invoked concurrently and the access to the statusMap must be
synchronized then.
2020-04-16 21:20:53 +02:00
Florian Schmaus fa643f12d5 muc: add MUC status code 33
SMACK-882
2020-04-16 21:20:35 +02:00
Florian Schmaus 7a57bb7c09 Rename Stanza.getExtension(String, String) to getExtensionElement() 2020-04-12 12:09:04 +02:00
Florian Schmaus 69e9f3c044 Remove deprecated GroupChatInvitation.getFrom() 2020-04-05 22:14:27 +02:00
Florian Schmaus 07da9ffb48 Do not have Stanza.getExtension(String, String) return a generic type
Returning a generic would allow for

List<ExtensionElement> list = stanza.getExtension("foo", "bar");

to compile (Note the we are calling getExtension(), not
getExtension*s*()).

Users are encouraged to use the type safe getExtension(Class<? extends
ExtensionElement) variant instead.

Fixes SMACK-825.
2020-04-05 22:10:05 +02:00
Florian Schmaus a7a298c5d8 Use standard stanza listeners in MultiUserChat
Those, relatively new, listeners guarantee that the individual
listeners are not invoked in concurrently while preserving the
order. Exactly what MultiUserChat previously did with AsyncButOrdered,
which is now no longer needed and hence can be removed.
2019-11-07 14:36:50 +01:00
Florian Schmaus eb4c2c5572 s/occured/occurred/ 2019-10-30 12:02:36 +01:00
Florian Schmaus e2d206e741 Introduce XMPPConnection.add(Message|Presence)Interceptor
add deprecate addStanzaInterceptor().
2019-10-25 21:41:55 +02:00
Florian Schmaus 5db6191110 Introduce StanzaBuilder
As first step to immutable Stanza types.
2019-10-25 21:41:55 +02:00
Florian Schmaus 65576cf3c2 Rework XML Element hierarchy and XmlStringBuilder
- Reduce the amount of types that are subtypes of NamedElement. See
javadoc of NamedElement for rationale.
- Work more with XmlEnvironment in XmlStringBuilder.
- Some minor changes to XmlStringBuilder API.
2019-09-07 18:17:08 +02:00
Florian Schmaus 1a3067c89b Enable werror for javadoc and fix javadoc issues 2019-08-30 12:08:30 +02:00
Florian Schmaus f863bd222c Merge branch '4.3' 2019-08-22 11:52:41 +02:00
Florian Schmaus 4ca2c7cc69 Enable MissingJavadocPackage and UnnecessaryParentheses checkstyle checks 2019-07-24 09:18:39 +02:00
Florian Schmaus 91ec6cc955 Javadoc changes for Java 11 compatibility 2019-07-19 23:05:46 +02:00
Paul Schaub 0ad1a0bd4c
Add note about BookmarkManager to MUCManager 2019-07-03 23:37:51 +02:00
Florian Schmaus 4d36e3b521 Introduce FormFieldChildElement and make FormField immutable 2019-06-11 12:47:39 +02:00
Florian Schmaus f7762c5db7 Add "whitespace after comma" checkstyle rule 2019-05-17 21:56:46 +02:00
Florian Schmaus 60db42e2f4
Merge pull request #299 from magnetsystems/autojoin-callback-on-reconnect
Autojoin callback on reconnect
2019-05-08 13:43:46 +02:00
Florian Schmaus 4133eb175c Replace XPP3 by XmlPullParser interface wrapping StAX and XPP3
Introducing Smack's own XmlPullParser interface which tries to stay as
compatible as possible to XPP3. The interface is used to either wrap
StAX's XMLStreamReader if Smack is used on Java SE, and XPP3's
XmlPullParser if Smack is used on on Android.

Fixes SMACK-591.

Also introduce JUnit 5 and non-strict javadoc projects.
2019-05-06 22:10:50 +02:00
V Lau f1fb03d08c Add a success callback for auto-join on reconnect.
When auto-join on reconnection is success, invoke a callback.

Conform to the proper copyright format.
2019-04-09 14:21:11 -07:00
Florian Schmaus 0d17f195b0 Use EntityFullJid as JID type in MultiUserChat.getJoinedRooms()
Got a user who put in a EntityBareJid and wondered why the returned
list was empty.
2019-04-07 22:13:38 +02:00
Florian Schmaus 0cd3318b12
Merge pull request #301 from adiaholic/JIRA836
Saving an instance of ServiceDiscoveryManager in MultiUserChatManager.
2019-03-24 11:39:20 +01:00
adiaholic d6e25730d0 Saving an instance of ServiceDiscoveryManager in MultiUserChatManager.
Previously, the costly method 'ServiceDiscoveryManager.getInstance()'
was called at multiple instances inside MultiUserChatManager.
In this commit I wish to replace this call by saving a private final
instance of 'ServiceDiscoveryManager' which will is an attempt at
solving SMACK-836.
2019-03-18 13:10:20 +05:30
Florian Schmaus daab6039a1 Smack 4.3.3
-----BEGIN PGP SIGNATURE-----
 
 iQGTBAABCgB9FiEEl3UFnzoh3OFr5PuuIjmn6PWFIFIFAlyKV9tfFIAAAAAALgAo
 aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDk3
 NzUwNTlGM0EyMURDRTE2QkU0RkJBRTIyMzlBN0U4RjU4NTIwNTIACgkQIjmn6PWF
 IFL4vQf/Qfg3VzNEnmk0+KjOtuvfAbhMfzE92gfo15vE0PPEIe9VA0Pzkvqhva4k
 Efw7BhD2zx8hWvo0d5FfkdII89hSYnOCiSmhiX1Ln9q/gUqFW0TDAKpsMfAl7jAK
 Fap8M7uUStP9T6fF/gq01djYCYoWA/4v1lGKv4J4b9gWCqzGIF2sK0M7of7VERnr
 pEXJSUM228rk6EYjVmX/9Ujo1Y+xaNMFFZZSbKYrirAqjP540v0OPBCRQyB8qFaI
 NTcNJ+qESe6Q80mw5V+y/kD6kX0LERSDB+pigzOOOlmfMtD1uADR84tAynuTKNAU
 7/5K/YSQxceRY6RTgD17Al5lHIH5nw==
 =ToR+
 -----END PGP SIGNATURE-----

Merge tag '4.3.3'

Smack 4.3.3
2019-03-14 18:23:33 +01:00
Florian Schmaus 7f0932a481 Reset the MUC self-presence collector on presence stanzas on join
To prevent timeouts when joining very large MUCs we now reset the
self-presence collector's timeout for every other (occupant) presence
we receive.

Fixes SMACK-859.
2019-03-04 23:01:52 +01:00
Florian Schmaus 85f7e1d39c Remove deprecated methods scheduled for removal in Smack 4.4 2019-02-16 17:17:25 +01:00
Florian Schmaus 8df69bd3ce Use XmlEnvironment in parsing/provider subsystem 2019-02-15 23:21:30 +01:00
Florian Schmaus 7dee3b88a2 Introduce SmackParsingException 2019-02-10 19:01:47 +01:00
Florian Schmaus 083dac8b83 Rework exceptions in the parsing / provider subsystem 2019-02-05 13:18:03 +01:00
Florian Schmaus fee3ed81ca Introduce XmlEnvironment 2019-02-05 13:18:03 +01:00
Florian Schmaus e4c31541e0 Make MultiUserChat.leave() behave as leaveSync()
and mark leaveSync() as deprecated.

Fixes SMACK-848.
2018-12-26 21:50:36 +01:00
Florian Schmaus a9de8e2f76 Merge branch '4.3' 2018-12-26 21:40:10 +01:00
Florian Schmaus 4b21f003af Add MultiUserChat.leaveSync()
Fixes SMACK-848.
2018-12-26 21:39:25 +01:00
Florian Schmaus 62a0c6f26e Merge branch '4.3' 2018-11-29 22:39:55 +01:00