Florian Schmaus
8bf74c6e92
Add Packet to onReceiptReceived parameters
...
in ReceiptReceivedListener. SMACK-582
2014-10-05 12:56:32 +02:00
Florian Schmaus
1e803ab29d
Use from(Packet) instead of getFrom(Packet) in DeliveryReceiptManager
2014-10-05 12:52:19 +02:00
Florian Schmaus
5f06234149
Use CopyOnWriteArraySet in InvitationsMonitor
2014-10-05 12:46:51 +02:00
Florian Schmaus
f7517ab6cc
Apply Manager pattern to InvitationsMonitor
...
Don't remove listeners on disconnect (SMACK-571).
2014-10-05 12:04:46 +02:00
Florian Schmaus
a0fe337bcd
Use Collections.emptyList() in MultiUserChat
2014-10-05 12:04:46 +02:00
Florian Schmaus
8529d1463f
Use from(Packet) instead of getFrom(Packet) in MultiUserChat
2014-10-05 12:04:45 +02:00
Florian Schmaus
414db1ebbe
Add PingManager.pingMyServer(boolean,long)
2014-09-30 13:09:09 +02:00
Florian Schmaus
7521ef951a
Ensure that connection is authenticated in PingManager
2014-09-29 17:04:18 +02:00
Florian Schmaus
50e068b6a7
Merge branch '4.0'
...
Conflicts:
build.gradle
2014-09-29 14:00:48 +02:00
Florian Schmaus
039fac7ab7
Fix PingManager.ping(String,long)
...
ignoring timeout. SMACK-609
2014-09-29 13:52:13 +02:00
Abmar Barros
ae385e6b44
Enabling additional and returned extensions in getItems()
2014-09-26 16:56:08 +02:00
Florian Schmaus
13f4f36995
Use non-deprecated method in DelayInformationManager
2014-09-24 19:23:49 +02:00
Florian Schmaus
b945e591ff
Add MessageWithBodies and DelayedStanza Filter
2014-09-24 19:23:49 +02:00
Florian Schmaus
d8c77de785
Remove duplicate code in pubusb LeafNode
...
Make fields of GetItemsRequest and NodeExtension final and use
XmlStringBuilder.
2014-09-21 20:49:11 +02:00
Florian Schmaus
bd0fb973c8
Add new RSMSet constructors
...
and fix typo in RSMSetManager
2014-09-20 16:54:36 +02:00
Florian Schmaus
58e430af42
PacketExtension.from(Packet), deprecate getFrom()
...
add 'from(Packet)' to DataForm
2014-09-16 22:22:25 +02:00
Florian Schmaus
f0651bae2d
Remove unnecessary check for non-null in PubSubProvider
...
addExtension() does that already.
2014-09-13 12:33:51 +02:00
Florian Schmaus
2dc93d7639
Add support for XEP-0059: Result Set Management
...
SMACK-581
2014-09-13 12:28:18 +02:00
Florian Schmaus
f2718c2d76
Remove smack.util.Cache
...
and use the Cache from jxmpp-util-cache instead.
2014-09-13 00:38:11 +02:00
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
Florian Schmaus
06ab0e32d7
Fix XHTMLText.appendBrTag()
...
It's an empty element and not a closing one.
2014-07-15 23:32:10 +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
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
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
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
afd1f6bc36
Remove some duplicate code from smackx.filetransfer
...
packet.IQ provides all the utility functions we need. An extension should
never (re-)implemented it's own core functionality.
2014-07-04 23:17:15 +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
fdaf7940fb
Remove decorators for "Legacy Delayed Delivery"
...
(aka. XEP-91) in favor of Delayed Delivery (XEP-203)
SMACK-578
2014-07-01 23:29:45 +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
fe51a17324
MessageEventManager's PacketFilter should ignore error type messages
...
Fixes SMACK-573
2014-06-10 18:56:50 +02:00
Florian Schmaus
92bf90d059
Use new PacketExtensionFilter constructor
...
in OfflineMessageManager
2014-06-10 18:54:53 +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
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
8bf30b960c
Don't remove the MUC listeners after a disconnect
...
keep state of XMPPConnection between disconnects.
Fixes SMACK-571
2014-06-02 16:58:53 +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
Florian Schmaus
8cc2a76e7f
Refactor Message Event (XEP-22) code to current design
2014-05-29 21:04:56 +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
2a091debc1
Add FlexiblePacketTypeFilter
...
and make constructors of MessageTypeFilter and IQTypeFilter
private, because we now provide constants instead.
2014-05-29 17:45:32 +02:00