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

825 commits

Author SHA1 Message Date
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
Guus der Kinderen
55d7b9d4eb Fix pubsub options rendering
The exiting code generates an unintentional nested 'options' child element:

```
<iq to='pubsub.example.org' id='FQTHU-126' type='get'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <options node='sinttest-multisubscribe-nodename-13pnc'>
      <options jid='smack-inttest-two-13pnc@example.org'
               node='sinttest-multisubscribe-nodename-13pnc'/>
    </options>
  </pubsub>
</iq>
```

This commit removes the undesired nesting, resulting in:

```
<iq to='pubsub.example.org' id='FQTHU-126' type='get'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <options jid='smack-inttest-two-13pnc@example.org'
             node='sinttest-multisubscribe-nodename-13pnc'/>
  </pubsub>
</iq>
```
2020-10-27 10:23:17 +01:00
Florian Schmaus
6d39a4e3ac [bob] Add BoBDataExtension, remove BoBExtension
BoBExtension extending XHTMLExtension was poorly designed and only
worked for a single paragraphy.

Fixes SMACK-770.
2020-09-23 19:57:13 +02:00
Florian Schmaus
fe7d3bec30 Make Forwarded a generic type
Fixes SMACK-821.
2020-09-23 17:48:04 +02:00
Florian Schmaus
3003094130
Merge pull request #412 from Flowdalic/data-form-type-annotations
[xdata] Parse forms of any kind without field type annotations
2020-07-23 17:24:48 +02:00
Florian Schmaus
1bd097ed9b
Merge pull request #411 from Flowdalic/sasl
SASL / getFeature()
2020-07-23 16:09:57 +02:00
Florian Schmaus
103ffabc08 [xdata] Parse forms of any kind without field type annotations
We previously only looked in the registry for 'submit' type forms. But
also 'result' type forms may be send without field type
annotations. Same is true, but less likely, for 'form' type forms.
2020-07-23 15:47:17 +02:00
Florian Schmaus
329948b442 Add XMPP.(get|has)Feature(Class|QName) and deprecate (String, String) 2020-07-23 14:32:14 +02:00
Florian Schmaus
b7fe56fb9b [xdata] Add message to IllegalArgumentException 2020-07-06 11:51:12 +02:00
Florian Schmaus
3e8666cd91 [xdata] Fix case in FillableForm 2020-07-06 11:51:12 +02:00
Florian Schmaus
ed02bcf0d4 [ibb] Ensure InBandBytestreamManager is a singleton
InBandBytestreamManager followed an unusual pattern: Within the
connectionTermianted() callback, it would remove itself from the
'managers' map. This allowed for multiple instances of an
InBandBytestreamManager to exist for the same connection, causing all
kinds of issues.

This fixes the issue by changing InBandBytestreamManager to use the
Smack-idiomatic pattern used by managers.

We also do no longer reset the listeners if the connection is
termianted, as listeners (and handlers) typically persist until they
are explicitly removed by the user.

As positive side-effect, the number of indeterministic unit-tests,
caused by using Thread.sleep(), is reduced. The executor service in
InitiationListener was also removed, because the IQ handler is already
called asynchronously to the connections main loop.

Thanks to Anno van Vliet for reporting this.
2020-07-03 22:01:15 +02:00
99cb60dac7
Add missing rightangle bracket to FormNode addXml() 2020-06-15 16:15:27 +02:00
Florian Schmaus
3f9ca68134 Delete TypedCloneable 2020-06-14 17:38:51 +02:00
Florian Schmaus
18c2c37ad0 Rename XmlUnitUtils to XmlAssertUtil 2020-06-14 16:53:21 +02:00
Florian Schmaus
9d6665735f [pubsub] Rework NodeExtension.toXML() 2020-06-14 16:52:13 +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
ccc785062e [extensions] Deprecate old-style PepManager PEP listeners 2020-05-25 20:32:47 +02:00
Florian Schmaus
d65f2c932e Bump Error Prone version to 2.3.4 and fix new bug patterns 2020-05-24 21:10:01 +02:00
Florian Schmaus
9a8ee3c8e3 [core] Improve NumberUtil's exception message and fix javadoc 2020-05-24 13:08:03 +02:00
Florian Schmaus
ebe5c49e92 [checkstyle] Tighten JavadocMethod checkstyle rule 2020-05-23 22:43:29 +02:00
Florian Schmaus
a137944e50 [disco/caps] Fix DiscoverInfo.asBuilder()
The method would not copy the extensions elements, which would lead to
a false calculation of the caps hash by EntityCapsManager.
2020-05-22 15:38:16 +02:00
Florian Schmaus
0db6406262 [softwareinfo] Separate static and non-static fields by empty line 2020-05-22 15:36:39 +02:00
Florian Schmaus
54d6bc8658 [softwareinfo] Remove SoftwareInfoManager.isSupported(Jid)
SoftwareInfoManager.fromJid(Jid) will return 'null' if the jid in
question does not announce or support this.
2020-05-22 15:35:56 +02:00
Florian Schmaus
027358fc63 [softwareinfo] Remove unnecessary throws declarations 2020-05-22 15:34:27 +02:00
Florian Schmaus
b3c57ef918 [xhtmlim] Use stanza builder API, deprecate old 2020-05-21 22:45:28 +02:00
Florian Schmaus
2679c72f0f [disco] Move logic that was previously in EntityCapsManager in SDM 2020-05-18 09:15:15 +02:00
Florian Schmaus
46ba273689 [disco] Delay the entity caps renewal
This avoids the calculation of the caps hash while the managers become
registered with the connection and add their features.
2020-05-18 09:15:14 +02:00
Florian Schmaus
f00acbff89
Merge pull request #340 from adiaholic/XEP-0232
Add support for XEP-0232 : Software Information
2020-05-16 12:08:35 +02:00
Aditya Borikar
17ca4c541b Add support for XEP-0232: Software Information
By making use of an extended data format, service discovery responses
can be used to constitute software information.
Solves SMACK-853.
2020-05-16 14:02:25 +05:30
Florian Schmaus
9fd5bc7873 [pubsub] Make Fillable(Configure|Subscribe)Form constructors package-private
Those are not meant to be used directly.
2020-05-15 11:54:49 +02:00
Florian Schmaus
fec928ffe7 [pubsub] Add missing "FillableSubscribeForm SubscribeForm.getFillableForm()" 2020-05-15 11:54:49 +02:00
Florian Schmaus
565397f632 [pubsub] Make FillableSubscribeForm implement SubscribeFormReader 2020-05-15 11:54:49 +02:00
Florian Schmaus
c5212c20b6 [xdata] Rename FormReader.read(String) to getField(String)
Now that FormWriter, with its write() method, is gone, there is no
reason the FormReader method should still be named read(). Renaming to
getField() as this is what DataForm also uses.
2020-05-14 17:13:01 +02:00
Florian Schmaus
d6c1018b47 [xdata] Remove FormWriter
The FormWriter interface was a left over from the initial design of
the reworked API, but is no longer required.
2020-05-14 17:13:01 +02:00
adiaholic
afa42a8b41 Remove TODO:method should not throw any exception but currently does
`mgr.getNode(...)` method is not supposed to throw any type
of exception. It threw two kinds of exceptions: `NotConnectedException`
and `SmackException`.
By using `ThreadedDummyConnection.newInstance()` method,
`NotConnectedException` can be removed. And `SmackException`
can be removed by correctly building the DiscoverInfo packet.
2020-05-13 22:25:22 +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
498dde2d86 Merge branch 'master' of github.com:igniterealtime/Smack 2020-05-13 20:20:01 +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
Guus der Kinderen
577c59484b pep: notification type can be normal or headline 2020-05-12 19:57:56 +02:00
Florian Schmaus
3270c113c5 [filetransfer] Remove FaultTolerantNegotiator
The FaultTolerantNegotiator is the reason why Smack replies in a
non-standard way to file transfer requests: Smack puts two values in
the stream-method field, while the field is a list-single field,
i.e. a field which only allows one value.

Even if what Smack does is probably better, as it allows for a
fallback in case the bytestream transport fails, it is not standard
compliant. And, Jingle provide a proper fallback specification for
file transfers.

Fixes SMACK-561.
2020-05-11 22:12:22 +02:00
Florian Schmaus
2c39dff653 pubsub: remove 'replyto' and 'replyroom' configure settings
Those configurations where removed with version 1.13 (2010-07-12) of
XEP-0060.

This change is part of the effort to upgrade Smack's PubSub
implementation (SMACK-364).
2020-05-04 10:55:36 +02:00
Florian Schmaus
e79710840b caps: handle multiple data forms of extened service discovery information 2020-04-18 22:56:24 +02:00
Florian Schmaus
dc443bccd4 disco: allow multiple data forms for extended discovery information
Previously Smack only supported a single data form as extended
discovery information.
2020-04-18 19:04:21 +02:00
Florian Schmaus
e58e6fa75d xdata: add more helper methods to DataForm 2020-04-18 19:02:45 +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