Commit Graph

29 Commits

Author SHA1 Message Date
Florian Schmaus a848437284 Make digest() in EntityCapsManager synchronized
Fixes SMACK-617
2014-11-14 21:02:18 +01:00
Florian Schmaus 039fac7ab7 Fix PingManager.ping(String,long)
ignoring timeout. SMACK-609
2014-09-29 13:52:13 +02:00
Florian Schmaus b5b134f569 Process all XML namespaces in PubSub ItemProvider
Fixes SMACK-601
2014-08-29 14:59:54 +02:00
Florian Schmaus 450015bf40 Make Bookmarks.toXML() return valid XML again
Fixes SMACK-594
2014-08-14 22:25:52 +02:00
Florian Schmaus 0d890623c7 Make getMultipleRecipientServiceAddress more robust
to avoid

feature-not-implemented
	at org.jivesoftware.smack.PacketCollector.nextResultOrThrow(PacketCollector.java:182)
	at org.jivesoftware.smack.PacketCollector.nextResultOrThrow(PacketCollector.java:161)
	at org.jivesoftware.smackx.disco.ServiceDiscoveryManager.discoverItems(ServiceDiscoveryManager.java:573)
	at org.jivesoftware.smackx.address.MultipleRecipientManager.getMultipleRecipienServiceAddress(MultipleRecipientManager.java:310)
 	at org.jivesoftware.smackx.address.MultipleRecipientManager.send$7a184d34(MultipleRecipientManager.java:82)

for e.g. Google Apps XMPP services.

This is not to be merged in master/4.1 branch as it already contains a
similar fix.
2014-08-10 17:22:00 +02:00
Florian Schmaus 4e588f7908 Throw IAE if invalid port number is given for Socks5Proxy 2014-08-05 09:33:20 +02:00
Florian Schmaus 5c2f051c1c Make Socks5Proxy try other ports if 7777 is already in use
by setting the default value to '-7777' (negative values mean that the
next port number will be tried if the current one is in use).
2014-08-05 09:32:13 +02:00
Florian Schmaus d65d239550 Make getMessages() set up collector *before* sending the request
Similar flaw was also fixed in 2c7f1efe80.

Also ensure that OfflineMessagesManager doesn't leak collector by using
a try/finally block.

Fixes SMACK-592
2014-08-04 12:21:37 +02:00
Florian Schmaus 66da4dfa91 Fix Typo: s/isSubscibe/isSubscribe/ in ConfigureForm
Fixes SMACK-588
2014-08-01 23:15:46 +02:00
Florian Schmaus 0b6069d75f Fix FormField.Option.toXML() to use correct element
Fixes SMACK-589
2014-07-30 21:58:10 +02:00
Florian Schmaus bd0ada480b Improve DeliveryReceipt code, add javadoc
Also make Packet.getExtension() use Generics
2014-07-13 11:39:01 +02:00
Florian Schmaus c063fb1376 Reply correct error code on XEP-65 Stream rejection
this was previously erroneously changed with
197548b548 from 'forbidden' to
'not-acceptable'. We now change it back to 'forbidden'.

Also delete FileTransferNegotiator.rejectStream(StreamInitation) because
it is dead code and add some comments and javadoc.
2014-07-12 13:52:54 +02:00
Florian Schmaus cde6dd65b3 Fix typo: s/no_acceptable/not_acceptable
in XMPPError.Condition
2014-07-12 12:39:04 +02:00
Florian Schmaus fc39ac88bd Add support for retrieving PubSub Node affiliations
This also marks the starting point for extending the PubSub API to allow
additional packet extensions to be added to the request. This is for
example useful if one wants to limit the result with "Result Set
Management (XEP-59)".

Fixes SMACK-580.
2014-07-09 13:28:16 +02:00
Florian Schmaus 56222d6ee2 Improve parseContent() and parseContentDepth()
The idea is that xml-roundtrip should *never* be expected from a
XmlPullParser. So what we need is a method that parses the content of an
element without relying on getText() returning text if on START_TAG or
END_TAG. This is already done by PubSubs ItemProvider.

Also add PacketParserUtils.parseElement() which will return the current
element as String and use this method in PubSub's ItemProvider.
2014-06-20 12:07:25 +02:00
Florian Schmaus 26b5bc0212 Properly escape Bookmarks and FormField XML
by using XmlStringBuilder. Fixes SMACK-577

Also extend LazyStringBuilder with a cache. And extend XmlStringBuilder
with some more convenience methods.

Move the ELEMENT and NAMESPACE definition from Form to DataForm, where
it belongs.
2014-06-19 16:52:19 +02:00
Florian Schmaus 2ce7656180 Fix PrivateDataResult.getChildElementXML()
that method never worked correctly since 11 years, ie. the PrivateData
was never added as element text. It's not surprisingly that this was not
discovered in more then a decade, since Smack usually never *sends*
those stanza but only receives them.

But that's no reason to not fix it. :)
2014-06-19 16:52:19 +02:00
Florian Schmaus eec0df386c s/JEP/XEP/
also s;jabber.org/jeps;xmpp.org/extensions;
2014-06-14 11:48:46 +02:00
Florian Schmaus 273c2d7da9 Fix PingManager, use 'nextPingIn' to schedule
pings, instead of 'pingInterval'. Fixes SMACK-575.
2014-06-12 18:43:51 +02:00
Florian Schmaus 36a86f2dfc Improve getMultipleRecipientServiceAddress
and MultipleRecipient (XEP-33) related code in general (e.g. use
constants where possible).

For getMultipleRecipientServiceAddress() this means that
- the "synchronized (services)" block is removed
- ServiceDiscoveryManager is only retrieved once
2014-06-05 15:38:27 +02:00
Florian Schmaus 0680553ef7 Make getMulitipleRecipientServiceAddress() more robust
the method should not throw if one of server's items fail to query.
2014-06-05 15:16:46 +02:00
Florian Schmaus c3ae73472e Do not filter groupchat messages without body
for MessageListeners in MultiUserChat

SMACK-568
2014-05-29 17:49:52 +02:00
Florian Schmaus d790db5729 Don't throw an IOException if IBBStream got closed by the remote
Smack should not throw an IOException in case a stream got closed by
the remote peer and the user is trying to read() from the stream. This
commit fixes that, by making Smack return '-1' if the stream got
closed by the remote. An IOException will only be thrown if the user
tries to read from a stream that got already closed by *himself*.

SMACK-468
2014-05-23 13:13:24 +02:00
Florian Schmaus a19181ce04 Make XMPPConnection.schedule() protected
This method was never intended to be part of the public API. It's also
critical that the given Runnables complete within a reasonable
time frame so that they don't block following ones.
2014-05-23 13:13:24 +02:00
Florian Schmaus 4c76f2652d Reworked OSGi support of Smack (SMACK-343)
Because of OSGi, no subproject of Smack (which is the same as a OSGi
bundle) must export a package that is already exported by another
subproject.

Therefore it was necessary to move the TCP and BOSH code into their own
packages: org.jivesoftware.smack.(tcp|bosh).

OSGi classloader restrictions also made it necessary to create a
Declarative Service for smack-extensions, smack-experimental and
smack-lagacy (i.e. smack subprojects which should be initialized), in
order to initialize them accordingly, as smack-core is, when used in a
OSGi environment, unable to load and initialize classes from other smack
bundles. OSGi's "Service Component Runtime" (SCR) will now take care of
running the initialization code of the particular Smack bundle by
activating its Declarative Service.

That is also the reason why most initialization related method now have an
additional classloader argument.

Note that due the refactoring, some ugly changes in XMPPTCPConnection
and its PacketReader and PacketWriter where necessary.
2014-05-15 16:09:37 +02:00
Florian Schmaus 90ea9ba2fc Make ProviderManager static
also remove initialize() from ProviderFileLoader, by simply putting the
code into the constructor.
2014-05-11 09:27:41 +02:00
Florian Schmaus 7a5533c823 Fix NPE in DiscoverInfo.Identities XmlStringBuilder
The 'name' attribute of an service discovery identity is
optional. Thanks to Jens Offenbach for reporting.
2014-05-07 12:46:24 +02:00
Florian Schmaus 2375c59791 Extend JivePropertiesManager
with getPropertiesNames() and getProperties()
2014-04-28 20:23:26 +02:00
Florian Schmaus 91fd15ad86 Prefix subprojects with 'smack-'
instead of using the old baseName=smack appendix=project.name approach,
we are now going convention over configuration and renaming the
subprojects directories to the proper name.

Having a prefix is actually very helpful, because the resulting
libraries will be named like the subproject. And a core-4.0.0-rc1.jar is
not as explicit about what it actually *is* as a
smack-core-4.0.0-rc1.jar.

SMACK-265
2014-04-28 19:44:14 +02:00