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

5173 commits

Author SHA1 Message Date
Florian Schmaus
348a3ab091
Merge pull request #630 from guusdk/sint_formtest-smack-4.5.0-beta2
[sint] Fix compatibility with Smack 4.5.0-beta2
2024-09-25 10:59:09 +00:00
Florian Schmaus
f59d7f3257
Merge pull request #632 from Flowdalic/smack-gradle-bump
Bump to Gradle 8.10.2, require Java 11
2024-09-25 10:58:39 +00:00
Florian Schmaus
1e5d34eacf Bump to Gradle 8.10.2, require Java 11
Bump Gradle from 6.8.3 to 8.10.2 and increase the minimum required
Java version from 8 to 11 (SMACK-953).

The switch from Java 8 to 11 caused some Bytecode portability issues
regarding NIO Buffers. Java changed with version 9 the return type of
some subclasses of Buffer to return the specific Buffer type instead
of the Buffer superclass [JDK-4774077]. For example, ByteBuffer.filp()
previously returned Buffer, while it does return ByteBuffer now.

This sensible change was not reflected by the Android API [1], which
means that AnimalSniffer rightfully started to complain that there is
no method "ByteBuffer ByteBuffer.flip()" in Android, there is only
"Buffer ByteBuffer.flip()", and those are incompatible methods on
Java's Bytecode layer.

As workaround, this changes

    return charBuffer.flip().toString();

to

    ((java.nio.Buffer) charBuffer).flip();
    return charBuffer.toString();

to restore the Bytecode portability between Android and Java.

Errorprone also got new checks, of which JavaUtilDate and JdkObsolete
are wroth mentioning.

JavaUtilData basically strongly recommends to use Java's newer time
API over java.util.Date. But since Smack was Java 8 until now,
j.u.Date is widely used.

Similar JdkObsolete mentions obsolete JDK APIs, like data structures
like Vector and Stack. But mostly LinkedList, which should usually be
replaced by ArrayList. And this is what this commit largely does.

JDK-4774077: https://bugs.openjdk.org/browse/JDK-4774077
1: https://issuetracker.google.com/issues/369219141
2024-09-25 12:08:50 +02:00
Guus der Kinderen
e4fcdb6879 [sint] Fix compatibility with Smack 4.5.0-beta2
Due to a change in Smack 4.5.0-beta2, test execution of (all) SINT tests is aborted when `FormTest` is executed.

It appears that Smack now has more strict argument validation when setting thread IDs on message stanzas. This validation should not fail for the tests that are shipped with Smack.

This is the stack trace when executing the failing test (which no longer occurs after the change in this commit is applied):

```
Exception in thread "main" java.lang.IllegalArgumentException: thread must not be null nor empty
	at org.jivesoftware.smack.util.StringUtils.requireNotNullNorEmpty(StringUtils.java:533)
	at org.jivesoftware.smack.packet.Message$Thread.<init>(Message.java:326)
	at org.jivesoftware.smack.packet.MessageBuilder.setThread(MessageBuilder.java:70)
	at org.jivesoftware.smack.packet.MessageBuilder.setThread(MessageBuilder.java:66)
	at org.jivesoftware.smackx.xdata.FormTest.testFilloutForm(FormTest.java:133)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.igniterealtime.smack.inttest.SmackIntegrationTestFramework.lambda$runTests$0(SmackIntegrationTestFramework.java:476)
	at org.igniterealtime.smack.inttest.SmackIntegrationTestFramework.runConcreteTest(SmackIntegrationTestFramework.java:556)
	at org.igniterealtime.smack.inttest.SmackIntegrationTestFramework$PreparedTest.run(SmackIntegrationTestFramework.java:764)
	at org.igniterealtime.smack.inttest.SmackIntegrationTestFramework.runTests(SmackIntegrationTestFramework.java:544)
	at org.igniterealtime.smack.inttest.SmackIntegrationTestFramework.run(SmackIntegrationTestFramework.java:277)
	at org.igniterealtime.smack.inttest.SmackIntegrationTestFramework.main(SmackIntegrationTestFramework.java:115)
```
2024-09-19 10:51:10 +02:00
Florian Schmaus
d8d066b831 [github ci] Install Android SDK 21 2024-09-16 08:59:04 +02:00
Florian Schmaus
5a822a6631 Smack 4.5.0-beta3-SNAPSHOT 2024-09-15 20:00:57 +02:00
Florian Schmaus
fd1f692031 Smack 4.5.0-beta2 2024-09-15 19:50:40 +02:00
Florian Schmaus
ab16e1a32c Bump jxmpp version to 1.1.0-beta1 2024-09-15 19:45:15 +02:00
Florian Schmaus
8d7952cec3 Bump MiniDNS version to 1.1.0-alpha3 2024-09-15 19:44:46 +02:00
Florian Schmaus
1c1f57d9ff [core] Refine javadoc for ConnectionConfiguration.getLanguage() 2024-09-15 19:10:14 +02:00
Florian Schmaus
49379afd3f [core] Correctly handle BCP 42 language tag creation from Locale for xml:lang
Fixes SMACK-952
2024-09-15 19:09:45 +02:00
Florian Schmaus
94375e3208 Bump minimum Android SDK version to 21
Fixes SMACK-951
2024-09-15 19:09:19 +02:00
Florian Schmaus
b1071412e2 Smack 4.5.0-beta2-SNAPSHOT 2024-09-14 21:46:55 +02:00
Florian Schmaus
822115e9f6 Smack 4.5.0-beta1 2024-09-14 21:35:33 +02:00
Florian Schmaus
4a101e2c99 Delete APIs scheduled for removal with Smack 4.5 2024-09-14 21:34:47 +02:00
Florian Schmaus
af77e561c5
Merge pull request #618 from stokito/account_registration
[core] Make AccountManager.getRegistrationInfo() public
2024-09-14 10:10:57 +00:00
Florian Schmaus
300106edb5
Merge pull request #627 from Flowdalic/muc-bare-jid
[muc] Use BareJid for affiliation changes
2024-09-14 10:07:04 +00:00
Florian Schmaus
6f0499b7f7 [muc] Use BareJid for affiliation changes
As per XEP-0045 § 5.2 "Affiliations are granted, revoked, and
maintained based on the user's bare JID, not the nick as with roles."

Fixes SMACK-948
2024-09-12 14:38:23 +02:00
Florian Schmaus
63e25bc8cd
Merge pull request #624 from guusdk/SMACK-949_MUC-join-state-after-destroy
[muc] State of MUC should reflect room destruction
2024-09-12 11:41:59 +00:00
Florian Schmaus
5633d0e6c2
Merge pull request #623 from hamed-sb/master
[core] fix toXml for UnparsedIQ
2024-09-12 11:32:28 +00:00
Florian Schmaus
3dfd90dc34
Merge pull request #622 from guusdk/sint-rosterutil-errormessage
[sinttest] Add error message to subscribe request failure
2024-09-12 11:31:07 +00:00
Florian Schmaus
7024151f5d
Merge pull request #612 from stokito/fix_gradle_plugins
Fix gradle plugins
2024-09-12 11:24:32 +00:00
Florian Schmaus
fc2f258310
Merge pull request #625 from guusdk/typo-2
Fixes spelling (includes one API change)
2024-09-12 11:02:45 +00:00
Florian Schmaus
b44ade562a Merge branch '4.4' 2024-09-12 13:02:16 +02:00
Florian Schmaus
3bb07521bb
Merge pull request #626 from Flowdalic/github-ci-upload-artifacts-v4
[github ci] Bump upload-artifact to v4
2024-09-12 13:01:55 +02:00
Florian Schmaus
b034e614d4 [github ci] Bump upload-artifact to v4 2024-09-12 11:53:56 +02:00
Guus der Kinderen
c85bcadd81 Fixes spelling (includes one API change)
Mostly benign changes. Added one new method to replace a method with a spelling mistake in its name. Kept the old method, marked as 'deprecated'.
2024-09-11 20:03:43 +02:00
Guus der Kinderen
93efdf3eda [muc] State of MUC should reflect room destruction
After a room is destroyed, the MultiUserChat-stored representation of the 'join' state of any occupant should be updated to reflect that the user is no longer in the room.

This fixes a problem where an occupant (that not itself triggered the destruction) appears to continue be part of a room after its destruction.

Additional integration test assertions are added to check for the invalid state fixed by this commit.

fixes SMACK-949
2024-09-05 15:12:28 +02:00
hamed-sb
609781b5ad [core] fix toXml for UnparsedIQ 2024-09-05 12:50:57 +03:30
Guus der Kinderen
4f840d1066 [sinttest] Add error message to subscribe request failure
Have a descriptive error message when a subscription request times out.
2024-09-05 10:59:23 +02:00
Florian Schmaus
38c6dd21b4
Merge pull request #621 from Flowdalic/fillable-forms-only-require-list-fields-to-have-value-set
[xdata] Only require list-multi and list-single fields to have a value
2024-09-02 18:56:02 +00:00
Florian Schmaus
4d790aa7db [xdata] Only require list-multi and list-single fields to have a value
Only list-multi and list-single fields require at least one value when
submitting a form. In other cases, for example XEP-0045's
muc#roomconfig_roomadmins, which is of type jid-multi, is used without
any values to reset the room's admins list.

Fixes SMACK-946.
2024-09-01 21:56:24 +02:00
Florian Schmaus
6c7e88f3a0
Merge pull request #616 from guusdk/SMACK-950_MUC-destroy-password
[muc] Add support for 'password' in room destroy
2024-08-27 09:52:04 +00:00
Florian Schmaus
9c4fcc0931
Merge pull request #614 from guusdk/SMACK-947_MucConfigFormManager-admin-support
Add support for room admin config to MucConfigFormManager
2024-08-27 09:50:24 +00:00
Sergey Ponomarev
c99318783e [core] Make AccountManager.getRegistrationInfo() public
The getRegistrationInfo() returns a registration form that may also contain a CAPTCHA.
We need to get the full Registration object to get the fields.
Also it should be possible to call it multiple times to update the form.

Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
2024-08-25 09:35:50 +02:00
Guus der Kinderen
82385ab4d0 [muc] Add support for 'password' in room destroy
XEP-0045 specifies that an optional alternate venue password value can be provided in a room destruction request and broadcast.

fixes SMACK-950
2024-08-15 14:55:54 +02:00
Guus der Kinderen
3534569a8d Add support for room admin config to MucConfigFormManager
fixes SMACK-947
2024-08-13 15:48:02 +02:00
Sergey Ponomarev
c74ebca955 build.gradle: migrate from jcenter to gradlePluginPortal and upgrade biz.aQute.bnd.builder 2024-08-12 08:47:03 +03:00
Sergey Ponomarev
b85be6572c build.gradle: remove clirr plugin
The clirr plugin is disabled and not used
2024-08-12 08:45:54 +03:00
Florian Schmaus
854f847db3
Merge pull request #610 from guusdk/sint-abstract-muc-contract-change
[sint] Correct for recent API change
2024-07-16 06:29:03 +00:00
Guus der Kinderen
7f3bc3d500 [sint] Correct for recent API change
The commit that introduced these tests was merged at the same time with an API change.
2024-07-15 12:46:16 +02:00
Florian Schmaus
2019e0d943
Merge pull request #609 from guusdk/MUC_revoke-membership-in-membersonly-room
[muc] Invoke ParticipantStatusListener after revokation of membership
2024-07-14 10:47:42 +00:00
Florian Schmaus
17d9b742fc [sinttest] Try to find MUC service where MUC creation is possible 2024-07-14 12:11:22 +02:00
Florian Schmaus
050acc4c53 [sinttest] Add TestNotPossibleException(String, Throwable) constructor 2024-07-14 12:11:21 +02:00
Guus der Kinderen
f0b9955311 [muc] Invoke ParticipantStatusListener after revokation of membership
When an occupant gets its membership revoked in an members-only room, the appropriate method of registered ParticipantStatusListeners should be invoked.
2024-07-14 10:19:05 +02:00
Florian Schmaus
b3ef3c3477
Merge pull request #606 from guusdk/sint_ox-cleanup
[sinttest] XEP-0373 Integration Tests should clean-up
2024-07-09 06:20:25 +00:00
Florian Schmaus
9a87643429
Merge pull request #607 from guusdk/SMACK-945_Actor-nick-in-XML
SMACK-945: MUC Item actor's nick to XML
2024-07-09 06:19:55 +00:00
Guus der Kinderen
7c27a707c8 [muc] MUC Item actor's nick to XML
If an actor's nick is set in `MUCItem` this value should be added to the XMPP representation of the instance.

Fixes SMACK-945
2024-07-08 11:15:38 +02:00
Guus der Kinderen
59706d0294 [sinttest] XEP-0373 Integration Tests should clean-up
After test execution, the OpenPGP for XMPP integration tests should clean up the data published via PEP. This prevents these tests from interfering with other tests.
2024-07-03 16:47:42 +02:00
Florian Schmaus
8fcfe2cc33
Merge pull request #605 from guusdk/sint_roster-cleanup
[sinttest] Cleanup of test fixtures
2024-07-02 12:34:53 +00:00