Commit Graph

76 Commits

Author SHA1 Message Date
Florian Schmaus 0c0737942c Make resolver-dnsjava, -minidns initializer
and OSGi components.

There is really no need to treat them different then
resolver-javax. This also allows the removal of the DNSUtil.init() method.
2014-08-11 19:39:31 +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 c3f6c51d0e Add a setting for the used flush mode when compressing data
Fixes SMACK-593
2014-08-07 16:18:44 +02:00
Florian Schmaus 70f1c22bb2 Prevent PacketCollector leaking
in AbstractXMPPConnection.createPacketCollectorAndSend(IQ) in case there
is a NoResponseException.
2014-08-04 18:15:42 +02:00
Florian Schmaus 6caf2cbdb5 Don't use IQReplyFilter for resource binding
as the local username is only available after binding (and legacy
session establishment). This makes Smack compatible again with XMPP
services that use the user's JID as from attribute in the result IQ
after the bind set IQ, e.g. Facebook:

SENT:
<iq id='sqvTK-1' type='set'>
  <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
    <resource>Smack</resource>
  </bind>
</iq>

RCV:
<iq from='user.name.1@chat.facebook.com' id='sqvTK-1' type='result'>
  <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
    <jid>user.name.1@chat.facebook.com/Smack</jid>
  </bind>
</iq>

Fixes SMACK-590
2014-08-04 18:01:05 +02:00
Florian Schmaus 076c7d0b81 Configure default Hostname Verifiers 2014-08-03 21:15:41 +02:00
Florian Schmaus a574e1d56d Verify ConnectionConfiguration parameters
also fix javadoc error for StringUtils.isNullOrEmpty()

Fixes SMACK-539
2014-08-01 23:23:11 +02:00
Florian Schmaus 89dc3a0e85 Add smack-android and redesign SASL authentication
This commit marks an important milestone with the addition of the
smack-android subproject. Smack is now able to run native on Android
without requiring any modifications, which makes the aSmack build
environment obsolete.

It was necessary to redesign the code for SASL authentication to achieve
this. Smack now comes with smack-sasl-provided for SASL implementations
that do not rely on additional APIs like javax for platforms where those
APIs are not available like Android.
2014-08-01 10:34:47 +02:00
Florian Schmaus 057d00c9de Add support for HostnameVerifier
SMACK-586

Conflicts:
	smack-core/src/main/java/org/jivesoftware/smack/ConnectionConfiguration.java
	smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
2014-07-27 23:28:11 +02:00
Georg Lukas 2a05c3b707 Roster: merge the two registered ConnectionListeners 2014-07-23 08:29:46 +02:00
Florian Schmaus d35fd16a21 Add support for HostnameVerifier 2014-07-23 08:29:46 +02:00
Florian Schmaus fe258fe110 Fix XMPPTCPConnection to set 'host' and 'port'
Fixes SMACK-585
2014-07-23 08:29:35 +02:00
Florian Schmaus d06d5b7c69 Merge branch '4.0'
Conflicts:
	build.gradle
2014-07-20 14:19:59 +02:00
Florian Schmaus 59527d320d Add SmackAndOsgiInitializer
OSGi ServiceComponents need the activate method, make sure it exists for
every SmackInitializer by using this class.
2014-07-20 12:58:50 +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
Florian Schmaus 1ed5c48bcc Merge branch '4.0'
Conflicts:
	smack-core/src/main/java/org/jivesoftware/smack/XMPPConnection.java
2014-07-16 10:52:58 +02:00
Florian Schmaus cea79d1bb8 Use single threaded ExecutorService
for PacketListeners. Fixes SMACK-583.
2014-07-16 10:50:35 +02:00
Florian Schmaus e6aa2416e4 Improve MUC code
Removes a ton of duplicate code, mostly related to MUCItem being
duplicated in MUCOwner and MUCAdmin, but also some other duplicate code.

Make MUC code use XmlStringBuilder.

Add ELEMENT and NAMESPACE constants to the appropriate places. Also add
"static <MUCPacketExtension> getFrom(Packet)" methods.

Make some MUC classes implement Element.
2014-07-14 19:22:02 +02:00
Florian Schmaus 7735a5224c Merge branch '4.0'
Conflicts:
	smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransferManager.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransferNegotiator.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/PubSubManager.java
	smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamRequestTest.java
	smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InitiationListenerTest.java
	smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/InitiationListenerTest.java
2014-07-14 14:31:09 +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 cde6dd65b3 Fix typo: s/no_acceptable/not_acceptable
in XMPPError.Condition
2014-07-12 12:39:04 +02:00
Florian Schmaus b0825f73fd Fix TLSUtils.AcceptAllTrustManager
Should not throw an Exception, but instead return a zero-sized
array. Also add some javadoc.
2014-07-09 09:42:31 +02:00
Florian Schmaus bdf9a75c4f Use XmlStringBuilder in RosterPacket and XMPPError 2014-07-07 12:30:36 +02:00
Florian Schmaus ed7dc1800d Throw IllegalStateException in StringUtils.hash()
instead of Log.

Also create UTF8 and SHA1 constant.
2014-07-07 00:11:00 +02:00
Florian Schmaus e469601468 Do not hardcode the char[] length in StringUtils 2014-07-07 00:03:11 +02:00
Florian Schmaus 8b16c49a31 Remove Packet.ID_NOT_AVAILABLE 2014-07-06 23:57:06 +02:00
Florian Schmaus f671b9e781 Use CharSequence instead of String in parseContent()
and parseContentDepth(). This also means that the type of some fields
changed from String to CharSequence.

Also add Matcher for CharSequences.
2014-07-06 21:10:40 +02:00
Florian Schmaus 54b18e3575 Make XHMTMLExtensionProvider use parseElement()
which makes the whole provider much simpler.

Also use CharSequence as Base for XHTML-IM bodies.
2014-07-05 15:04:35 +02:00
Florian Schmaus 94a16ba41e Merge branch '4.0'
Conflicts:
	build.gradle
	documentation/connections.html
	documentation/gettingstarted.html
	smack-core/src/main/java/org/jivesoftware/smack/SmackException.java
	smack-core/src/test/java/org/jivesoftware/smack/parsing/ParsingExceptionTest.java
	smack-core/src/test/java/org/jivesoftware/smack/test/util/TestUtils.java
	smack-core/src/test/java/org/jivesoftware/smack/util/PacketParserUtilsTest.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/caps/cache/SimpleDirectoryPersistentCache.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/ping/PingManager.java
	smack-tcp/src/main/java/org/jivesoftware/smack/tcp/PacketReader.java
2014-07-05 14:37:22 +02:00
Florian Schmaus d8d88d9abd Make XHTMLText use XmlStringBuidler
also define all element and attribute names as constants.
2014-07-05 14:19:31 +02:00
Florian Schmaus 4477561d4b Replace references to 'smack.jar'
Also don't mention the required JDK version in the README as such information
tends to become wrong easily.
2014-07-05 12:10:43 +02:00
Florian Schmaus 8526f8ab29 Introduce packet.Element
Re-work filetransfer/bytestream stanza toXML() method to use
XmlStringBuilder. Move the ELEMENT and NAMESPACE definitions in the
right place, ie. the stanza class.
2014-07-05 11:59:45 +02:00
Florian Schmaus 09425609af Refactor FileTransfer(Manager|Negotiator)
to use WeakHashMaps and extend Manager.

SMACK-579
2014-07-02 09:52:40 +02:00
Florian Schmaus 609c225865 Add smack-resolver-minidns 2014-06-25 08:27:20 +02:00
Florian Schmaus 1f6d0fa415 Use BufferedReader to read version 2014-06-22 23:14:11 +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 46f4a553e0 Add javadoc to SmackException.ConnectionException
and HostAddress
2014-06-17 13:17:15 +02:00
Florian Schmaus 02651c668f Improve HostAddress, make some members final
also
- add getException()
- improve constructor logic
2014-06-17 11:00:46 +02:00
Florian Schmaus 1b2231be0b Add PacketExtensionFilter(PacketExtension) constructor
and PacketExtensionFilter(Class<? extends PacketExtension).
2014-06-10 18:52:46 +02:00
Florian Schmaus b083449cc3 Throw more exceptions when parsing Presences
when parsing core elements of Presences.
2014-06-10 18:42:17 +02:00
Florian Schmaus 009057e2e2 Streamline String to Enum transformation
for the core stanza Enums.
2014-06-10 18:35:24 +02:00
Florian Schmaus 0fe263106a Fix MessageTypeFilter.ERROR
s/Type.headline/Type.error/
2014-06-10 17:59:13 +02:00
Florian Schmaus 3e18a23e47 Merge branch '4.0'
Conflicts:
	build.gradle
	smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java
2014-06-07 12:24:51 +02:00
Júlio Cesar Bueno Cotta 9be0c480e3 Change IQ.Type to enum 2014-06-06 21:10:13 -03:00
Florian Schmaus 91fa7a8219 Add missing mechanism-too-weak SASL Error 2014-06-05 20:52:10 +02:00
Júlio Cesar Bueno Cotta 944ac37fc3 Remove getConfiguration() from XMPPConnection
interface definition.
2014-06-05 11:42:26 +02:00
Florian Schmaus c7db63612c Remove javadoc references to code now in JXMPP 2014-06-02 16:59:45 +02:00
Florian Schmaus 12b9e9d507 Add AndroidDebugger as possible debugger
Create AbstractXMPPConnection.DEBUGGERS with possible debugger classes.
2014-06-01 12:24:50 +02:00
Florian Schmaus f67d655fe7 Use jxmpp-core (0.1.0-alpha1-SNAPSHOT)
fixes also SMACK-570, since jxmpp-core's XmppStringUtil contains the fix
for SMACK-570.
2014-06-01 12:24:30 +02:00