Commit Graph

226 Commits

Author SHA1 Message Date
Florian Schmaus 5493a22e44 Merge branch '4.4' 2021-04-18 17:25:14 +02:00
Florian Schmaus 961882ff7f Add more QNAME fields to extension element classes 2021-04-18 17:23:34 +02:00
Dan Caseley b7709f583d Make muc.join() mirror muc.leave() and return the self-presence 2021-04-07 10:33:38 +01:00
Florian Schmaus 61713c500c Smack 4.4.2
-----BEGIN PGP SIGNATURE-----
 
 iQGTBAABCgB9FiEEl3UFnzoh3OFr5PuuIjmn6PWFIFIFAmBcSRtfFIAAAAAALgAo
 aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDk3
 NzUwNTlGM0EyMURDRTE2QkU0RkJBRTIyMzlBN0U4RjU4NTIwNTIACgkQIjmn6PWF
 IFJs0wf/TYm4e4LlBiekmar8YnfaAObT9loDiqMJjO5s4g+trYx2U3gCKkRvKI0P
 U/jzqoJohcPY+5s/fkGKaBWjzFD5WucHyvNaP01D4EWSvHXpCMElbSxY1Uz3X4k1
 t0pmdb27DoHhtdqMfw1Cg7Nba4M+ZzdrEIkDRgCNA8H0mJoKpnsDAg8Y6kEUnvt6
 WQxmIZ49ZT9UOQnVbsXUk4t5DZDz1GdQggrDS5Sh+rZaRFy1KyDgLC+X4NQO99RV
 v3Tf4VRIy+6Nen7L/av3qwSBRqpvc1TEJauNwOnYvyuDwpwjE0tEfRuFZ8wjtkAz
 CKF+LLor+WA5Y2GCXEegLJxVd9Je6Q==
 =hZJ2
 -----END PGP SIGNATURE-----

Merge tag '4.4.2'

Smack 4.4.2
2021-03-25 11:45:03 +01:00
Florian Schmaus eb31479913 [muc] Make sendMessage() return a MessageView of the sent message 2021-03-25 08:19:53 +01:00
Florian Schmaus ed807d5954 Merge branch '4.4' 2021-03-23 21:41:25 +01:00
Florian Schmaus 4381d04831 [muc] Introduce MucMessageInterceptor 2021-03-23 21:27:10 +01:00
Florian Schmaus 4fefa92e40 Merge branch '4.4' 2021-03-19 09:47:07 +01:00
Florian Schmaus 9d1b88a877 [muc] Do not filter for presence ID if #stable_id is not announced
On leave(), do not filter for presence ID if the MUC service does not
announce #stable_id.
2021-03-14 12:48:01 +01:00
Florian Schmaus a7b3303f3e Bump ErrorProne to 2.5.1 and refactor Providers a bit
This also resulted in a refactoring of the Providers and parsing
Exceptions. NumberFormatException and ParseException can now be thrown
directly, the wrapping in a SmackParsingException is down at a higher
layer, i.e. in AbstractProvider.
2021-01-29 09:26:15 +01:00
Florian Schmaus 7e311ab9df [muc] Prevent race condition on enter() by waiting
This prevents a race condition of enter() with the presence listern by
waiting until all presences have been processed.

Reported-by: Guus der Kinderen <guus@goodbytes.nl>
2020-11-09 08:46:56 +01:00
Florian Schmaus f12fe2264a [muc] Only retrieve MUCUser once in Presence listener 2020-11-08 19:37:41 +01:00
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