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

5106 commits

Author SHA1 Message Date
Florian Schmaus
6918663760 [roster] suppress "roster not loaded while processing presence" if self-presence
Fixes SMACK-941.
2024-04-02 15:11:47 +02:00
Florian Schmaus
435e736995
Merge pull request #576 from Flowdalic/inet-addr-ignore-zone-id
Ignore zone IDs of internet addresses
2024-04-02 15:09:34 +02:00
Florian Schmaus
50a04d8556
Merge pull request #581 from guusdk/sint_custom_debugger
sint: Allow use of custom SmackDebugger
2024-04-02 12:57:43 +00:00
Guus der Kinderen
92c45e0d29 sint: Allow use of custom SmackDebugger
Refactors the Smack Integration Test configuration to allow for a classname for a SmackDebugger(Factory) to be
provided.
2024-03-21 16:32:20 +01:00
Guus der Kinderen
84a55fa57e fix typos in package-info 2024-03-14 16:17:24 +01:00
Guus der Kinderen
806106534d SINT: fix various typos in javadoc and comment 2024-03-14 13:18:52 +01:00
Guus der Kinderen
ec4caf6663 SINT: fix typo in validation of accountTwoPassword argument 2024-03-14 13:15:21 +01:00
Guus der Kinderen
449ea73239 SINT: fix typo in output when using deprecated 'debug' option 2024-03-14 13:14:52 +01:00
Guus der Kinderen
f4110ec388 SINT: fix typo in output for disabled test 2024-03-14 10:56:29 +01:00
Florian Schmaus
a39e5baa74 [socks5] Ignore zone IDs of internet addresses
Fixes SMACK-940.
2024-02-09 14:15:09 +01:00
Florian Schmaus
e504bc23cf [extensions] Improve IAE message thrown by FormFieldRegistry 2024-01-18 17:31:36 +01:00
Florian Schmaus
8133505050 [websocket] Invoke send listeners 2024-01-18 17:31:36 +01:00
Florian Schmaus
8b9a9e0f3e [xdata] Fix NPE in FillableForm
Calling write() in FillableForm's constructor causes a NPE because
write() makes use of requiredFields which has not been set at this
time. Furthermore, write() makes use of missingRequiredFields, which
is also populated in that loop. Therefore, we have to delay the
invocation of write() until requiredFields got set.

Thanks to Dan Caseley for reporting this.

Reported-by: Dan Caseley <dan@caseley.me.uk>
2024-01-11 09:12:14 +01:00
Dan Caseley
b117d8c3d4
Merge pull request #575 from Flowdalic/fix-npe-in-fillableform
[xdata] Fix NPE in FillableForm
2024-01-10 09:55:56 +00:00
Florian Schmaus
643d85c556 [xdata] Fix NPE in FillableForm
Calling write() in FillableForm's constructor causes a NPE because
write() makes use of requiredFields which has not been set at this
time. Furthermore, write() makes use of missingRequiredFields, which
is also populated in that loop. Therefore, we have to delay the
invocation of write() until requiredFields got set.

Thanks to Dan Caseley for reporting this.

Reported-by: Dan Caseley <dan@caseley.me.uk>
2024-01-10 10:43:00 +01:00
Florian Schmaus
282d63da36 [sinttest] Minor fixes in AdHocCommandIntegrationTest 2024-01-10 10:18:10 +01:00
Florian Schmaus
b5180f819f Follow-up commit after merging support for XEP-0446: File Metadata Element
This is a follow-up commit after 441d677644 ("Initial support for
XEP-0446: File Metadata Element"). It includes the following changes

1. Use idiomatic provider design for FileMetadataElementProvider
2. Add XEP-0264 and XEP-0446 to the list of supported XEPs (both where
   added with441d6776447f)
2023-12-16 16:53:34 +01:00
Florian Schmaus
3d6fa5dbae Merge commit '441d6776447f17140b6499362be7e3e6b1f0397d' 2023-12-16 13:57:01 +01:00
Florian Schmaus
1ad394f256 [urldata] Follow-up on initial merge of XEP-0103/0104 support
This is a follow-up on 198c51356d ("Add initial support for XEP-0103
and XEP-0104: URL Address Information"), which
1. adds the entries to the support XEPs table
2. registers the provider
3. renames the package from url_address_information to urldata (aka.
   the shortname of XEP-0130).
2023-12-16 13:50:30 +01:00
Florian Schmaus
8425671b31 Merge commit '198c51356dd81a1521bba46d2d30e505d47062d1' 2023-12-16 13:25:41 +01:00
Florian Schmaus
f6de30c218 Merge branch '4.4' 2023-12-11 11:18:03 +01:00
cmeng-git
bd70d6abc5 [bosh] Fix BOSH debug send message not shown
Following logcat are captured with various PR fixes implemented:

// ===== Without any of the PR fixes ===== //
All the sent stanza are missing; fixed by
```
// Fix all BOSH sent debug messages not shown
  writer.flush();
```
```
2023-12-11 12:25:33.548 5470-5636/org.atalk.android D/SMACK: RECV (0):
    <body xmpp:version='1.0' authid='4867162268865181478' xmlns='http://jabber.org/protocol/httpbind' sid='53e66759d21e128cc1cba8d00aacb7421f1ea960' wait='60' ver='1.11' polling='2' inactivity='30' hold='1' xmpp:restartlogic='true' requests='2' secure='true' maxpause='120' xmlns:xmpp='urn:xmpp:xbosh' xmlns:stream='http://etherx.jabber.org/streams' from='atalk.sytes.net'>
      <stream:features>
        <mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
          <mechanism>
            PLAIN
          </mechanism>
          <mechanism>
            SCRAM-SHA-1
          </mechanism>
          <mechanism>
            X-OAUTH2
          </mechanism>
        </mechanisms>
        <register xmlns='http://jabber.org/features/iq-register'/>
      </stream:features>
    </body>
2023-12-11 12:25:33.748 5470-5636/org.atalk.android D/SMACK: RECV (0):
    <body xmlns='http://jabber.org/protocol/httpbind'/>
2023-12-11 12:25:33.925 5470-5636/org.atalk.android D/SMACK: RECV (0):
    <body xmlns='http://jabber.org/protocol/httpbind'>
      <challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
        cj1DI2QjJHE7JVs6LzElInQnPDhaK3JLMTUzPCtPVicvXmNuV204ei9kV1UzT1lsdCtzRW1ZTkE9PSxzPTdjNktCSnNaTHdTYjNZSytqdVRXb2c9PSxpPTQwOTY=
      </challenge>
    </body>
2023-12-11 12:25:33.939 5470-5636/org.atalk.android D/SMACK: RECV (0):
    <body xmlns='http://jabber.org/protocol/httpbind'>
      <success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
        dj1saEFrUzVKMFRBMEJVbTg1djd5dE4xTUpZaE09
      </success>
    </body>
```

// ===== With only PR fixes: writer.flush(); readerConsumer = null; but withoug the following fixes ===== //
// Initialize the debugger before addBOSHClientResponseListener(new BOSHPacketReader());
// BOSHPacketReader may hold and send response prior to display of the request i.e. \<response/> before \<challenge/>

```
2023-12-11 12:33:54.915 6162-6310/org.atalk.android D/SMACK: SENT (0):
    <body ver='1.8' wait='60' xmpp:version='1.0' rid='6195788493952909' xmlns:xmpp='urn:xmpp:xbosh' hold='1' xml:lang='en' ack='1' to='atalk.sytes.net' xmlns='http://jabber.org/protocol/httpbind'>
    </body>
2023-12-11 12:33:55.198 6162-6314/org.atalk.android D/SMACK: RECV (0):
    <body xmpp:version='1.0' authid='1477509259581416251' xmlns='http://jabber.org/protocol/httpbind' sid='796ae552c9fea53ff10a1979429396d19745d430' wait='60' ver='1.11' polling='2' inactivity='30' hold='1' xmpp:restartlogic='true' requests='2' secure='true' maxpause='120' xmlns:xmpp='urn:xmpp:xbosh' xmlns:stream='http://etherx.jabber.org/streams' from='atalk.sytes.net'>
      <stream:features>
        <mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
          <mechanism>
            PLAIN
          </mechanism>
          <mechanism>
            SCRAM-SHA-1
          </mechanism>
          <mechanism>
            X-OAUTH2
          </mechanism>
        </mechanisms>
        <register xmlns='http://jabber.org/features/iq-register'/>
      </stream:features>
    </body>
2023-12-11 12:33:55.301 6162-6310/org.atalk.android D/SMACK: SENT (0):
    <body rid='6195788493952910' sid='796ae552c9fea53ff10a1979429396d19745d430' xmlns='http://jabber.org/protocol/httpbind'>
      <auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='SCRAM-SHA-1'>
        bixhPXN3YW5AYXRhbGsuc3l0ZXMubmV0LG49c3dhbixyPUJwMTZzKG9dd0xmb1lnN0haRkAjKko7PiReIXhbKiou
      </auth>
    </body>
2023-12-11 12:33:55.534 6162-6313/org.atalk.android D/SMACK: SENT (0):
    <body rid='6195788493952911' ack='6195788493952909' sid='796ae552c9fea53ff10a1979429396d19745d430' xmlns='http://jabber.org/protocol/httpbind'>
      <response xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
        Yz1iaXhoUFhOM1lXNUFZWFJoYkdzdWMzbDBaWE11Ym1WMExBPT0scj1CcDE2cyhvXXdMZm9ZZzdIWkZAIypKOz4kXiF4WyoqLlV4eTcvUVBCQUNKbjg1TWdRZHhjQnc9PSxwPVZlT3pkVzExN0tMc3k4THZpQWJZWDlpcW84az0=
      </response>
    </body>
2023-12-11 12:33:55.538 6162-6314/org.atalk.android D/SMACK: RECV (0):
    <body xmlns='http://jabber.org/protocol/httpbind'>
      <challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
        cj1CcDE2cyhvXXdMZm9ZZzdIWkZAIypKOz4kXiF4WyoqLlV4eTcvUVBCQUNKbjg1TWdRZHhjQnc9PSxzPTdjNktCSnNaTHdTYjNZSytqdVRXb2c9PSxpPTQwOTY=
      </challenge>
    </body>
2023-12-11 12:33:55.558 6162-6310/org.atalk.android D/SMACK: SENT (0):
    <body xmpp:restart='true' rid='6195788493952912' xmlns:xmpp='urn:xmpp:xbosh' sid='796ae552c9fea53ff10a1979429396d19745d430' to='atalk.sytes.net' xmlns='http://jabber.org/protocol/httpbind'>
    </body>
2023-12-11 12:33:55.560 6162-6314/org.atalk.android D/SMACK: RECV (0):
    <body xmlns='http://jabber.org/protocol/httpbind'>
      <success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
        dj1mcFdSekE1SXltdTBrNys4K1hML3JncTVEd2s9
      </success>
    </body>
```

// ===== With the full PR fixes ===== //
```
2023-12-11 12:21:16.435 4703-5344/org.atalk.android D/SMACK: SENT (4):
    <body ver='1.8' wait='60' xmpp:version='1.0' rid='949729322134413' xmlns:xmpp='urn:xmpp:xbosh' hold='1' xml:lang='en' ack='1' to='atalk.sytes.net' xmlns='http://jabber.org/protocol/httpbind'>
    </body>
2023-12-11 12:21:16.637 4703-5348/org.atalk.android D/SMACK: RECV (4):
    <body xmpp:version='1.0' authid='1761920914298566866' xmlns='http://jabber.org/protocol/httpbind' sid='25ba67c4b943796418a2b7c064085327ab9c35ac' wait='60' ver='1.11' polling='2' inactivity='30' hold='1' xmpp:restartlogic='true' requests='2' secure='true' maxpause='120' xmlns:xmpp='urn:xmpp:xbosh' xmlns:stream='http://etherx.jabber.org/streams' from='atalk.sytes.net'>
      <stream:features>
        <mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
          <mechanism>
            PLAIN
          </mechanism>
          <mechanism>
            SCRAM-SHA-1
          </mechanism>
          <mechanism>
            X-OAUTH2
          </mechanism>
        </mechanisms>
        <register xmlns='http://jabber.org/features/iq-register'/>
      </stream:features>
    </body>
2023-12-11 12:21:16.667 4703-5344/org.atalk.android D/SMACK: SENT (4):
    <body rid='949729322134414' sid='25ba67c4b943796418a2b7c064085327ab9c35ac' xmlns='http://jabber.org/protocol/httpbind'>
      <auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='SCRAM-SHA-1'>
        bixhPXN3YW5AYXRhbGsuc3l0ZXMubmV0LG49c3dhbixyPTdiSVxeVnVMU0ZoWT8zVVlSa2psdkVMeks/e3BaQUwp
      </auth>
    </body>
2023-12-11 12:21:16.683 4703-5348/org.atalk.android D/SMACK: RECV (4):
    <body xmlns='http://jabber.org/protocol/httpbind'>
      <challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
        cj03YklcXlZ1TFNGaFk/M1VZUmtqbHZFTHpLP3twWkFMKUhqVjVlVFUvdzJFaW9yQjlGdHh3T3c9PSxzPTdjNktCSnNaTHdTYjNZSytqdVRXb2c9PSxpPTQwOTY=
      </challenge>
    </body>
2023-12-11 12:21:16.689 4703-5347/org.atalk.android D/SMACK: SENT (4):
    <body rid='949729322134415' ack='949729322134413' sid='25ba67c4b943796418a2b7c064085327ab9c35ac' xmlns='http://jabber.org/protocol/httpbind'>
      <response xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
        Yz1iaXhoUFhOM1lXNUFZWFJoYkdzdWMzbDBaWE11Ym1WMExBPT0scj03YklcXlZ1TFNGaFk/M1VZUmtqbHZFTHpLP3twWkFMKUhqVjVlVFUvdzJFaW9yQjlGdHh3T3c9PSxwPXdNb2c5N3UzQktON1FHaFVQRzQ3MHVjZXdldz0=
      </response>
    </body>
2023-12-11 12:21:16.702 4703-5348/org.atalk.android D/SMACK: RECV (4):
    <body xmlns='http://jabber.org/protocol/httpbind'>
      <success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
        dj0yTzRqVzJXWHdEUDdvNjdJSkdNU3Rmc0NMTkk9
      </success>
    </body>
2023-12-11 12:21:16.704 4703-5344/org.atalk.android D/SMACK: SENT (4):
    <body xmpp:restart='true' rid='949729322134416' xmlns:xmpp='urn:xmpp:xbosh' sid='25ba67c4b943796418a2b7c064085327ab9c35ac' to='atalk.sytes.net' xmlns='http://jabber.org/protocol/httpbind'>
    </body>
```

Link: https://github.com/igniterealtime/Smack/pull/554
2023-12-11 11:16:45 +01:00
441d677644
Initial support for XEP-0446: File Metadata Element
Also adds initial support for XEP-0264: Jingle Content Thumbnails

Solves SMACK-894
2023-12-08 14:46:51 +01:00
Florian Schmaus
90b8eee0d1 [extensions] Drop newlines in test string within GroupChatInvitationElementTest 2023-12-07 15:18:04 +01:00
664a141190 [extensions] Improved Support for Direct MUC Invitations (XEP-0249)
[flow: rebase of paul's initial submission which required adjustments]

Co-authored-by: Florian Schmaus <flo@geekplace.eu>
2023-12-07 15:01:44 +01:00
Florian Schmaus
726dbc0d27 [core] Add XmlStringBuilder.jidAttribute(Jid) and optJidAttribute(Jid) 2023-12-07 15:01:43 +01:00
Florian Schmaus
b7218e3a72 Smack 4.5.0-alpha3-SNAPSHOT 2023-12-07 11:57:43 +01:00
Florian Schmaus
39fe3fc5bb Smack 4.5.0-alpha2 2023-12-07 11:42:18 +01:00
Florian Schmaus
610e5dd803 [omemo-signal-integration-test] Add Bouncy Castle as security provider 2023-12-07 11:40:20 +01:00
Florian Schmaus
9e5564a597 [omemo] Do not swallow the exception in OmemoAesCipher 2023-12-07 11:38:25 +01:00
Florian Schmaus
7135977cb7 [sinttest] Make AbstractMultiUserChatIntegrationTest abstract 2023-12-07 11:26:18 +01:00
Florian Schmaus
f74f47f6d4 Merge branch '4.4' 2023-12-07 11:22:43 +01:00
Florian Schmaus
390f6f0fa7 [core] Fix busy-loop in SmackReactor
Fixes SMACK-938.
2023-12-07 11:22:38 +01:00
Florian Schmaus
1e666197a3 [sinttest] Display Java version on startup 2023-12-07 11:20:37 +01:00
Florian Schmaus
9acee05e5e [core] Improve how the selected keys are copied in SmackReactor 2023-12-07 11:20:37 +01:00
Florian Schmaus
844ebbf4c5 [core] Add milliseconds to ConsoleDebugger's timestamp 2023-12-06 20:55:37 +01:00
Florian Schmaus
688c06020b [sinttest] Improve message ouf XmppConnectionStressTest 2023-12-06 20:55:02 +01:00
Florian Schmaus
7fcc8a9bd3 [sinttest] Set default timeout to 47 seconds
Using 60 seconds makes it sometimes easy to miss that the some action
was 1 minute after the timeout, because only a single digit in the
timestamp changes. Using a prime number as timeout makes this more
obvious.
2023-12-06 20:53:23 +01:00
Florian Schmaus
2337a446a5 Re-work ad-hoc command (XEP-0050) implementation
Fixes SMACK-933.
2023-12-06 12:40:53 +01:00
Florian Schmaus
dac06b04c3 [core] Add XmlStringBuilder.setAppendApproach() 2023-11-28 11:04:24 +01:00
Florian Schmaus
04dc212db8 Add smack-examples 2023-11-28 10:46:16 +01:00
Florian Schmaus
5a78534443 [core] Mark LazyStringBuilder's String cache as transient 2023-11-26 21:35:19 +01:00
Florian Schmaus
b35b67c360 [repl] Bump Scala to 2.13.12, Ammonite to 2.5.11, and Scalastyle plugin to 2.1.0 2023-11-26 21:34:14 +01:00
Florian Schmaus
6322f4f826 [core] Add global option to flatten when appending in XmlStringBuilder
For certain use cases, this provides a performance improvement,
probably due better cache locality. However, it comes with the cost of
additional memory consumption.

This was initially suggested by Boris Grozev, who also reported a
significant performance problem of
XmlStringBuilder/LazyStringBuilder. However, the main cause of the
performance probelm was the missing caching of LazyStringBuilder. The
length of the lazy string is now cached by LazyStringBuidler since
70e48300a6 ("[core] Cache length in LazyStringBuilder"), which
accounts for large performance improvement. A significantly smaller
improvement is achieved by this commit and setting
XmlStringBuilder.FLAT_APPEND to 'true'.

Suggested-by: Boris Grozev <boris@jitsi.org>
2023-11-26 21:34:13 +01:00
Florian Schmaus
70e48300a6 [core] Cache length in LazyStringBuilder 2023-11-26 21:24:17 +01:00
Florian Schmaus
9203907e66
Merge pull request #567 from guusdk/sint_trim-config
[sinttest] Trim externally-provided configuration
2023-11-26 17:12:39 +00:00
Florian Schmaus
38dd64835f Merge branch '4.4' 2023-11-26 17:53:07 +01:00
Florian Schmaus
0fb8bfdf6c [CHANGELOG] fix markdown listing 2023-11-26 17:52:32 +01:00
Florian Schmaus
472bee8497 [sinttest] drop empty line 2023-11-26 13:58:09 +01:00
Florian Schmaus
535ecd67ee
Merge pull request #573 from Flowdalic/sinttest-ibr
[sinttest] Fix IBR-based account registration
2023-11-26 12:56:13 +00:00