Commit Graph

92 Commits

Author SHA1 Message Date
Florian Schmaus 9016120d71 Add support for (custom) data form extensions
Fixes SMACK-605
2014-09-12 13:43:04 +02:00
Florian Schmaus 3a37b71e19 Use XmlStringBuilder in AdHocCommandData
also remove 'lang' attribute, since it belongs into IQ, see XEP-50 3.7:

"The requester SHOULD provide its locale information using the "xml:lang"
attribute on either the <iq/> (RECOMMENDED) or <command/> element."
2014-09-12 11:22:49 +02:00
Florian Schmaus 46a4402a69 Add StreamFeatureProvider
so that AccountManager and the CapsExtension can be moved to
smack-extensions, where they belong.
2014-09-11 23:58:07 +02:00
Florian Schmaus fc51f3df48 Add support for XEP-0198: Stream Management
- De-duplicate code by moving it into AbstractXMPPConnection
- Introduce TopLevelStreamElement as superclass for all XMPP stream elements.
- Add SynchronizationPoint, ParserUtils
- Add ParserUtils

Fixes SMACK-333 and SMACK-521
2014-09-11 09:49:16 +02:00
Florian Schmaus d8db43e4c5 Improve FileTransfer.writeToStream()
let's use the standard idiom for Input- to OutputStream transfers. This
also avoids an initial no-op on the first write, when the count is '0'.

Also fixes a bug when the size of file/stream transferred is '0' (which
is perfectly fine and possible).
2014-09-09 21:06:12 +02:00
Florian Schmaus 090f7cfc49 Add PingManager.pingServerIfNecessary()
which is basically the body of the pingServerRunnable available as
public part of the API. The intention is to allow 3rd party
components (e.g. Android's AlarmManager) to trigger the code.
2014-09-08 10:09:05 +02:00
Florian Schmaus 34bc13bec7 Merge branch '4.0'
Conflicts:
	build.gradle
	smack-core/src/main/java/org/jivesoftware/smack/PacketCollector.java
	smack-core/src/main/java/org/jivesoftware/smack/packet/XMPPError.java
	smack-core/src/main/java/org/jivesoftware/smack/util/PacketParserUtils.java
	smack-core/src/main/java/org/jivesoftware/smack/util/StringUtils.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/provider/ItemProvider.java
2014-09-05 22:11:35 +02:00
Florian Schmaus 28c3554085 Use switch/case in MUCUserProvider 2014-09-05 11:46:44 +02:00
Florian Schmaus afd7c67bf9 Add support for multiple status codes to MUCUser
Fixes SMACK-604
2014-09-05 11:45:06 +02:00
Florian Schmaus 5d4aa76d19 Create smack.util.stringencoder for Base64, Base32,…
Use Android's Base64 implementation when on Android, otherwise, when on
Java7, use the existing one.
2014-09-04 11:07:55 +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 e8471baccb Add ChatState.getChatState() 2014-08-28 19:00:01 +02:00
Florian Schmaus 218dc66cf7 Filetransfer API should not wrap IOException
into SmackException.
2014-08-26 15:26:37 +02:00
Florian Schmaus 6af5d5e462 SDM: Follow guidelines, perform put() where get() is performed 2014-08-26 13:50:47 +02:00
Florian Schmaus 5d159c4be2 Make ServiceDiscoveryManager use constant PacketFilters 2014-08-26 13:50:47 +02:00
Florian Schmaus 191c4429da Fix FileTransferManager invoking request listeners
those need to be called asynchronously.

Also add a small API for that.
2014-08-26 13:50:42 +02:00
Florian Schmaus 856b4a6090 Make FaultTolerantNegotiator respect packetReplyTimeout 2014-08-26 12:04:52 +02:00
Florian Schmaus f282323eec Extend RoomInfo to contain more meta-data
found in the extended disco info result form. See also
http://xmpp.org/extensions/xep-0045.html#disco-roominfo

Fixes SMACK-542

Also change getShortDescription() to getName()
2014-08-25 11:39:57 +02:00
Florian Schmaus 6a43fc7c36 Add shortDescription to RoomInfo
which is obtained from the disco#info result's identity. Fixes
SMACK-600.

Also make fields in RoomInfo final.
2014-08-24 20:00:35 +02:00
Florian Schmaus e19cfa4d83 Introduce MUCRole and MUCAffiliation enums
Also rework MUCItem and parseItem to follow current coding guidelines.
2014-08-24 18:30:18 +02:00
Florian Schmaus 754bdada18 MultiUserChat grant/revoke Admin must use #admin namepsace
SMACK-371
2014-08-24 17:49:08 +02:00
Florian Schmaus 229e526f6d Make AbstractDelayInformationProvider handle empty string as reason 2014-08-21 19:47:31 +02:00
Florian Schmaus 76f8895ae3 Remove Pong class, add NAMESPACE to Ping
The Pong class was harmful, as people could try to use it with
PacketTypeFilter, which wouldn't work, a Pong is just a plain IQ result
without child XML.
2014-08-21 10:55:33 +02:00
Florian Schmaus bbf89c65bf Fix typo in XmlStringBuilder, it's not an Angel
s/rightAngelBracket/rightAngleBracket/
2014-08-20 21:25:14 +02:00
Florian Schmaus eeea0e34ca Add '::1' to the loopbackAddresses 2014-08-20 18:12:48 +02:00
Florian Schmaus b9b43ad5d7 Make the next server ping code easier to read 2014-08-20 10:44:02 +02:00
Florian Schmaus e16997eb9d Fix PingServerRunnable scheduling
should be nextPingIn and not pingInterval.
2014-08-20 10:35:45 +02:00
Florian Schmaus 64e49cb934 Add getLastStanzaReceived() to XMPPConnection
also remove faulty PongFilter from PingManager. It never matched any
stanzas, since a Pong is just a plain result IQ that is not qualified by
any XMPP Ping namespace.

Fixes SMACK-597
2014-08-20 10:35:17 +02:00
Florian Schmaus 62893376dd Cleanup Bytestream and Streamhost
remove unnecessary setPort() setter.
2014-08-19 19:24:57 +02:00
Florian Schmaus b468a29881 Improve Socks5 Bytestreams
- determine all local IPv4 and IPv6 addresses
- prevent loopback addresses from appearing as streamhost

Some unit tests where changed because they assumed that a host only has
one local address. But nowadays hosts often have more, at least because
they are IPv4 and IPv6 multi-homed.
2014-08-19 19:00:43 +02:00
Florian Schmaus 650da55b23 Improve XmlStringBuilder usage in Bytestream 2014-08-19 12:43:21 +02:00
Florian Schmaus 6021f8a8ce Fix Bytestream.getChildElementXML returning invalid XML 2014-08-19 12:42:23 +02:00
Florian Schmaus 397eb88468 Merge branch '4.0'
Conflicts:
	build.gradle
	documentation/connections.html
	documentation/debugging.html
	documentation/extensions/filetransfer.html
	documentation/extensions/rosterexchange.html
	documentation/gettingstarted.html
	documentation/index.html
	documentation/legacy/messageevents.html
	smack-extensions/src/main/java/org/jivesoftware/smackx/address/MultipleRecipientManager.java
2014-08-16 00:30:28 +02:00
Florian Schmaus 18a958e442 Fix faulty string comparison in SubscriptionProvider
'!=' tests for reference inequality, must use '!String.equals(String)'
instead.
2014-08-15 23:22:59 +02:00
Florian Schmaus 7277eb553a Enable more 'checkstyle' checks
AvoidStarImport
IllegalImport
RedundantImport
UpperEll
ArrayTypeStyle
GenericWhitespace
EmptyStatement
PackageDelcaration
2014-08-15 23:17:45 +02:00
Vyacheslav Blinov 522d0f30ff Generify Packet class returned by PackageCollector everywhere
This will help to get rid of repetitive class casts, and make
PacketCollector api more inline with itself (since some methods
are already generic return methods).
2014-08-15 12:14:19 +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 a5eebf3840 Make ServiceDiscoveryManager.findServices() more robust
the method should not throw an exception if the discovery of the service
fails.
2014-08-08 16:23:13 +02:00
Florian Schmaus c9dd1cdc40 Improved iqVersion code
including parsing and the version class.
2014-08-08 16:22:56 +02:00
Florian Schmaus 92a6d01507 Merge branch '4.0'
Also slightly improve OfflineMessageManager.getMessages()

Conflicts:
	build.gradle
	smack-extensions/src/main/java/org/jivesoftware/smackx/offline/OfflineMessageManager.java
2014-08-07 16:51:03 +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 d10ff92d44 Use createPacketCollectorAndSend in FileTransferNegoiator
also fixes a potential PacketCollector leak.
2014-08-04 20:04:39 +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 7b3331dda0 Add API to find services for a given feature
It's a common pattern to look for all services hosted under the users
service that provide a given feature. Let's provide an API for that and
use that API in the methods that benefit from it.
2014-07-26 07:14:42 +02:00
Florian Schmaus 97b17e83b4 Move "Message Events (XEP-22)" code to legacy
Fixes SMACK-569
2014-07-16 12:01:03 +02:00
Florian Schmaus 49ee058c38 Cleanup carbons, forwarded and a few others API
Adopt to common design patterns in Smack:

- getFrom(Packet) in Packetextensions
- INSTANCES.put() in getInstanceFor()
- ELEMENT instead of ELEMENT_NAME
- Use XmlStringBuilder
2014-07-16 11:46:30 +02:00