Commit Graph

25 Commits

Author SHA1 Message Date
Florian Schmaus 5bb4727c57 Use Jid (and subclasses) from jxmpp-jid
Fixes SMACK-634
2015-02-17 16:07:16 +01:00
Florian Schmaus 4698805a34 Rename 'Packet' class to 'Stanza'
Smack still uses the term 'Packet' in some places. This is just the
first step towards using correct XMPP terms in Smack.
2015-02-06 09:34:51 +01:00
Florian Schmaus 4a769b0262 Throw IAE in IQReplyFilter if there is no local JID
available yet.
2015-01-30 09:37:55 +01:00
Florian Schmaus 86ea027301 Add StringUtils.requireNotNullOrEmpty and Objects.requireNonNull
and use this in a few places.
2015-01-26 20:47:09 +01:00
Florian Schmaus dc6af6dd99 Add IQ.isRequestIQ()
and check IQ argument in IQReplyFilter.
2015-01-21 23:39:03 +01:00
Florian Schmaus 1bc3e10cff Improve Message Delivery Receipt (XEP-184) API
add a new AutoReceiptMode enum that specifies how delivery receipt
requests are handled. Default is to send receipts if the requstor is
subscribed to the user's presence.

Also make sure that messages contain an id if a receipt request is
added to it.
2015-01-20 12:43:11 +01:00
Florian Schmaus 3dd1365a5a Improve Privacy List code
notably add a cache for the active and default privacy list to avoid
IQ get/response round-trips.

Also add a few methods to PrivacyListManager to get the privacy list
names. The already existing methods always returned the whole list
together with the name, which caused two round-trips.

Simplified some code.

Properly escape Privacy XML.
2015-01-07 20:54:23 +01:00
Florian Schmaus b23c3226d2 Add MessageTypeFilter.NORMAL_OR_CHAT 2015-01-07 16:04:36 +01:00
Florian Schmaus 9c2f6dcfbc Add IQTypeFilter.GET_OR_SET 2015-01-07 14:35:22 +01:00
Florian Schmaus 469548f53a Use '==' in (IQ|Message|Presence)TypeFilter
instead of 'equals()'
2014-12-22 16:17:17 +01:00
Florian Schmaus a4e3833468 Add PresenceTypeFilter 2014-12-22 13:53:11 +01:00
Florian Schmaus c9bf420b37 Make Filters fields final and use StringUtils 2014-12-09 14:32:09 +01:00
Florian Schmaus 1c08d1c594 Remove PacketExtensionFilter(Class) constructor
as it's potential error prone, because most PacketExtension's don't
have a non-argument constructor required for this to work.

Also add some javadoc.
2014-12-09 14:32:09 +01:00
Florian Schmaus fe3dcba9b2 Fix javadoc warnings and deprecated methods 2014-11-02 12:12:56 +01:00
Florian Schmaus f94f7590a6 Store packet extensions in a HashMap
allowing O(1) lookups for PacketExtensions

The one EntityCapsManagerTest becomes obsolete with this change, as
duplicate extension elements (RFC 6120 § 8.4) are now no longer possible
after the stanza has been parsed (they still may be received on the
wire, but only the last duplicate will be added).
2014-10-28 15:11:43 +01:00
Florian Schmaus 8ce474b0df Improve MUC Presence interceptors
Use PresenceListener as intercepting callback interface.

Remove the for-each loops in MultiUserChat by using the interception
facilities of the XMPPConnection.

Add ToFilter.
2014-10-12 19:34:14 +02:00
Florian Schmaus e835df5641 Improve MUC message and presence listeners
instead of using a PacketListener, which means that the user has to
downcast the Packet to Message, we now use a Listener which callback
parameter is already Message/Presence.

It is necessary to introduce MessageListener and PresenceListener, which
are interfaces that have a callback for Message/Presence instead of
Packet. The 'old' MessageListener is renamed to ChatMessageListener.

Use Generics in ConnectionDetachedPacketCollector.
2014-10-12 18:11:02 +02:00
Florian Schmaus b945e591ff Add MessageWithBodies and DelayedStanza Filter 2014-09-24 19:23:49 +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 1b2231be0b Add PacketExtensionFilter(PacketExtension) constructor
and PacketExtensionFilter(Class<? extends PacketExtension).
2014-06-10 18:52:46 +02:00
Florian Schmaus 0fe263106a Fix MessageTypeFilter.ERROR
s/Type.headline/Type.error/
2014-06-10 17:59:13 +02:00
Júlio Cesar Bueno Cotta 9be0c480e3 Change IQ.Type to enum 2014-06-06 21:10:13 -03: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 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
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