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

5203 commits

Author SHA1 Message Date
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
Guus der Kinderen
426a5efb1d [sinttest] Cleanup of test fixtures
Additional cleanup of test fixtures:
- various tests that change roster/subscription get a roster-reset
- one test that registers a listener now deregisters that listener
2024-07-02 10:50:42 +02:00
Florian Schmaus
d27fef0bae [sinttest] Do not leak stanza listener in MultiUserChatOccupantIntegrationTest 2024-06-27 21:32:13 +02:00
Florian Schmaus
c322ce8046
Merge pull request #601 from guusdk/sint_muc-guarantee-order
[sint] Refactor test to ensure stanza order
2024-06-27 19:21:37 +00:00
Guus der Kinderen
0c9d521084 [sint] Refactor test to ensure stanza order
The test that's modified in this commit asserts that upon MUC join, stanzas are received in a particular order.

The previous implementation depended on several event listeners (one for presence, one for messages) that did not always fire in the same order in which the corresponding stanzas arrived. This made the approach unsuitable to reliably test the order in which stanzas arrive.

This commit stops using Smack's MUC API when trying to collect the order in which stanzas arrive. Instead, it joins a chatroom and listens for its stanzas using basic stanza handling. As this uses exactly one stanza listener, that's guaranteed to be invoked in order of stanza arrival, any synchronicity issue in the previous implementation no longer applies.
2024-06-27 20:30:37 +02:00
Florian Schmaus
47d4cbe094 Merge branch '4.4' 2024-06-27 17:10:29 +02:00
Florian Schmaus
ba02a868f6 [caps] Use DataForm.getFormType() when sorting 2024-06-27 17:09:40 +02:00
Guus der Kinderen
a1e85d644f [caps] Additional test that asserts CAPS dataform ordering
XEP-0115 defines that any dataforms in the disco#info stanza is
ordered prior to the computation of the verification string. This
commit adds a test that verifies that this is done by Smack.

See SMACK-944.
2024-06-27 17:09:40 +02:00
Guus der Kinderen
95adfb3cdf [caps] Ensure dataforms are ordered prior to ver calculation
Fixes SMACK-944.
2024-06-27 17:09:36 +02:00
Florian Schmaus
9254f735c7 [sinttest] Refactor MultiResulitSyncPoint TimeoutException message construction for readability 2024-06-27 16:49:23 +02:00
Florian Schmaus
68fa90435e
Merge pull request #599 from guusdk/sint_assertresult-multisync
[sinttest] Improving assertions for MultiResultSyncPoint
2024-06-27 14:42:22 +00:00
Florian Schmaus
98ff4d8a65
Merge pull request #598 from guusdk/sint_muc-occupant-race
[sinttest] Fix race condition in MUC test
2024-06-27 14:40:23 +00:00
Florian Schmaus
cf8a8466e4 Merge remote-tracking branch 'origin/master' 2024-06-23 09:24:14 +02:00
Guus der Kinderen
98dbc0ee2e [muc] Prevent duplicate processing of mediated invitations
MUC mediated invitations usually have the form

<message
    from='coven@chat.shakespeare.lit'
    id='nzd143v8'
    to='hecate@shakespeare.lit'>
  <x xmlns='http://jabber.org/protocol/muc#user'>
    <invite from='crone1@shakespeare.lit/desktop'>
      <reason>
        Hey Hecate, this is the place for all good witches!
      </reason>
    </invite>
    <password>cauldronburn</password>
  </x>
</message>
(source: XEP-0045 Example 57.)

However, previous versions of XEP-0045 specified an additional <x
xmlns='jabberconference'> element to be included (see
implementation note in XEP-0045). Therefore, a legacy implementation
may emit a mediated invitations in the form of

<message
    from="smack-inttest-mediated-invite-from-8ta77-hw9igz@conference.example.org"
	to="smack-inttest-two-8ta77@example.org">
  <x xmlns="http://jabber.org/protocol/muc#user">
    <invite from="smack-inttest-one-8ta77@example.org"/>
  </x>
  <x xmlns="jabberconference" jid="smack-inttest-mediated-invite-from-8ta77-hw9igz@conference.example.org"/>
</message>

Unfortunately, this matches
MultiUserChatManager.DIRECT_INVITATION_FILTER because
GroupChatInvitation matches <x xmlns="jabberconference"/>. However
the message is not a direct invitation but a mediated one. Besides
this invoking the wrong listeners (direct vs. medidated) the value for
'inviter' that's used to invoke that listener will be false.

To fix this, extend DIRECT_INVITATION_FILTER with
NotFilter.of(MUCUser.class) to avoid matching those legacy mediated
invitations.

Fixes SMACK-943

Co-authored-by: Florian Schmaus <flo@geekplace.eu>
2024-06-23 09:07:51 +02:00
Florian Schmaus
0bb3bf292c [core] Add NotFilter.of(Class<E extends ExtensionElement>) 2024-06-22 20:01:35 +02:00
Florian Schmaus
095ba0a3ee
Merge pull request #603 from guusdk/smackx_package-info-copypaste-bugs
[docs] fix URL for XEP-0372
2024-06-20 07:49:29 +00:00
Florian Schmaus
a4eb5a7b01
Merge pull request #592 from guusdk/sint-versions-for-tests
[sinttest] Add versions for tests
2024-06-20 07:47:17 +00:00
Guus der Kinderen
95c39d2a44 [docs] fix URL for XEP-0372 2024-06-18 16:29:57 +02:00
Guus der Kinderen
7e9a5713e9 [sinttest] Improve test assertion message
Making use of the new assertion handling for MultiResultSyncPoint, the integration test that uses that implementation can now get improved assertion messages. This will allow users to more quickly determine why a test is failing.
2024-06-13 16:01:30 +02:00
Guus der Kinderen
440b497638 [sinttest] Add AssertResult for MultiResultSyncPoint
This adds an AssertResult implementation for MultiResultSyncPoint that mimics the equivalent for ResultSyncPoint.
2024-06-13 16:01:30 +02:00
Guus der Kinderen
adafcdb6d1 [sinttest] Fix race condition in MUC test
When occupant One waits for occupant Two to join the room, One should register the corresponding listener _before_ Two joins.

Without this, a race conditions occurs, where Two could have joined the room before One registered the listener, thus missing the event.
2024-06-13 15:26:42 +02:00