Commit Graph

52 Commits

Author SHA1 Message Date
Florian Schmaus c125a3b055 Bump jxmpp to 0.5.0-alpha4 2015-05-27 19:29:51 +02:00
Florian Schmaus ff72ea320c Check if MUC room is hosted on a MUC service
when trying to enter a room.
2015-05-12 11:54:54 +02:00
Florian Schmaus fcc62ad131 Add support for MUC roomnick rewrite
SMACK-646
2015-04-23 23:11:40 +02:00
Florian Schmaus 5af4f1a5d1 Synchronize MultiUserchat.changeNickname(Resourcepart) 2015-04-23 21:45:33 +02:00
Florian Schmaus f274581c27 Add MucBookmarkAutojoinManager
Also add MucConfigFormManager and improve the MUC API (SMACK-648). Bump
to jxmpp 0.5.0-alpha3.

Improve and extend PrivateDataManager and BookmarkManager.
2015-04-21 19:31:10 +02:00
Florian Schmaus 83b84c5bd3 Merge branch '4.1'
Conflicts:
	smack-core/src/main/java/org/jivesoftware/smack/StanzaListener.java
	smack-core/src/main/java/org/jivesoftware/smack/XMPPConnection.java
	smack-core/src/main/java/org/jivesoftware/smack/packet/Stanza.java
	smack-core/src/main/java/org/jivesoftware/smack/util/PacketParserUtils.java
	version.gradle
2015-03-24 17:16:18 +01:00
Florian Schmaus 5e86db4f80 Substitute 'packet' with 'stanza(/packet)' in javadoc 2015-03-21 09:36:28 +01:00
meisterfuu 05c97c494b Add roomDestroyed callback to MUC UserStatusListener
Fixes SMACK-619
2015-03-17 09:51:20 +01:00
Florian Schmaus 516e397679 Improve MUC's Destroy element class
- Made jid of type BareJid
- Made it implement TypedCloneable
- Made it implement Serializable
- Made it immutable

Also update its parsing code. And add some convenience methods to
ParserUtils.
2015-03-11 21:31:37 +01:00
Florian Schmaus c540ac9703 Merge Smack 4.1.0-rc3
Conflicts:
	smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/provider/BytestreamsProvider.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java
	version.gradle
2015-03-07 21:31:56 +01:00
Florian Schmaus 48aae12ba3 Remove XMPPException from MultiUserChat.sendMessage
as it's not actually thrown.
2015-03-07 20:52:44 +01:00
Florian Schmaus 701aa7d9c4 Merge branch '4.1'
Conflicts:
	smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
	smack-core/src/main/java/org/jivesoftware/smack/PacketCollector.java
	smack-core/src/main/java/org/jivesoftware/smack/PacketListener.java
	smack-core/src/main/java/org/jivesoftware/smack/XMPPConnection.java
	smack-core/src/main/java/org/jivesoftware/smack/debugger/SmackDebugger.java
	smack-core/src/main/java/org/jivesoftware/smack/packet/Packet.java
	smack-core/src/main/java/org/jivesoftware/smack/util/XmlStringBuilder.java
	smack-core/src/test/java/org/jivesoftware/smack/ThreadedDummyConnection.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/address/provider/MultipleAddressesProvider.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/ibb/DataListener.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/FaultTolerantNegotiator.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/IBBTransferNegotiator.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/Socks5TransferNegotiator.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/StreamNegotiator.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/LeafNode.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/main/java/org/jivesoftware/smackx/pubsub/packet/PubSub.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/vcardtemp/VCardManager.java
	smack-extensions/src/test/java/org/jivesoftware/smackx/receipts/DeliveryReceiptTest.java
	smack-im/src/main/java/org/jivesoftware/smack/chat/ChatManager.java
	smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/JingleSession.java
	smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/provider/JingleProvider.java
	smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/packet/UserID.java
	smack-legacy/src/main/java/org/jivesoftware/smackx/xroster/provider/RosterExchangeProvider.java
	smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
	version.gradle
2015-03-04 22:42:36 +01:00
Florian Schmaus ed4fa3390f Add XMPPConnection.sendStanza(Stanza)
and deprecate sendPacket().
2015-03-04 21:46:44 +01:00
Florian Schmaus 85a9b07230 Fix MUC participantStatusListeners
Thanks to Anno van Vliet for reporting the issue and proposing the fix.
2015-03-03 17:11:42 +01:00
Florian Schmaus 75ec271c6c Rename PacketListener to StanzaListener
and add the PacketListener as deprecated interface.
2015-03-02 15:49:56 +01:00
Florian Schmaus d4a6d8e653 Rename PacketFilter (and implementing classes) and PacketExtension
to StanzaFilter and ExtensionElement.
2015-02-28 13:49:38 +01:00
Florian Schmaus 5bb4727c57 Use Jid (and subclasses) from jxmpp-jid
Fixes SMACK-634
2015-02-17 16:07:16 +01:00
Florian Schmaus bc61527bd2 Expose InterruptedException
SMACK-632
2015-02-14 14:57:33 +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 86ea027301 Add StringUtils.requireNotNullOrEmpty and Objects.requireNonNull
and use this in a few places.
2015-01-26 20:47:09 +01:00
Florian Schmaus d5b8647d9d Create smack-im subproject for XMPP-IM
Move Roster and Chat(Manager) code into their own packages within the
new smack-im subproject.

Apply Manager pattern to Roster.

Fixes SMACK-637.
2015-01-26 07:54:05 +01:00
Florian Schmaus 6bf9498904 Add note about getMultiUserChat in MUC's javadoc 2015-01-19 08:38:11 +01:00
Florian Schmaus eb6b8df7c5 Add MultiUserChat.requestVoice() 2015-01-13 13:31:45 +01:00
Florian Schmaus 717090d272 Rework incoming packet listeners and Roster
Differentiate between asynchronous and synchronous ones. Asynchronous
are the ones where the invocation order may not be the same as the order
in which the stanzas arrived.

Since it's no longer guaranteed that when a unit test calls

processPacket(stanza)

the stanza will be completely processed when the call returns, it was
necessary to extend the unit tests (mostly Roster and ChatManager) with
a packet listener that waits for his invocation. Since we now also use
LinkedHashMaps as Map for the packet listeners (SMACK-531, SMACK-424),
adding a packet listeners as last also means that it will be called as
last. We exploit this behavior change now in the unit tests.

Rename 'recvListeners' to 'syncRecvListeners' in AbstractXMPPConnection.

Rename 'rosterInitialized' to 'loaded' in Roster.

Add Roster.isLoaded().

Reset 'loaded' to false in
Roster.setOfflinePresencesAndResetLoaded() (was setOfflinePresences()).

Fixes SMACK-583, SMACK-532, SMACK-424
2015-01-07 14:35:23 +01:00
Florian Schmaus e6593cb200 Use createMessage() where possible in MultiUserChat 2014-12-30 12:13:58 +01:00
Florian Schmaus cba681a967 Add MultiUserChat.toString() 2014-12-30 12:10:12 +01:00
Florian Schmaus 0293ca2bcd Add MultiUserChat.createOrJoin(String,String,DiscussionHistory,long) 2014-12-26 18:22:06 +01:00
Florian Schmaus 7874daa59b Use switch-case for Presence.getType() 2014-12-22 16:17:18 +01:00
Florian Schmaus b5328d38fa MUC: Establish callbacks before sending the presence 2014-10-14 09:41:48 +02:00
Florian Schmaus b54d133b36 Add MultiUserChatManager
apply the Manager pattern to 'muc'. This prevents the user creating
multiple MultiUserChat instances for the same MUC.

Move the static method from MultiUserChat to MultiUserChatManager.

Also add AbstractNodeInformationProvider.
2014-10-13 22:32:34 +02:00
Florian Schmaus c674808a4a Improve MultiUserChat
Use CopyOnWriteArraySet for listeners, remove the old reflection based
listener invocation approach.

Remove unnecessary casts.

Return List instead of Collection where possible.

sendMessage(Message) now set's the MUC as 'to' and the message type to
groupchat.
2014-10-13 16:39:17 +02:00
Florian Schmaus 365c71db79 Rework MultiUserChat
remove PacketMultiplexListener, RoomListenerMultiplexor and
ConnectionDetachedPacketCollector(Test), which was a bunch of
(in same cases redundant) code that formed a complex construct that
presumably tried to make MultiUserChat instances easily garbage
collect-able.

Now, MultiUserChat should be eligible for gc if the userHashLeft() is
invoked before the reference to the instance is dropped, which should be
the case in the most scenarios. Otherwise the connection may references
the MultiUserChat instance over Packet(Listener|Interceptor)s preventing
the gc.
2014-10-13 11:10:30 +02:00
Florian Schmaus 98a3c46e9a Add XMPPConnection.createPacketcollectorAndSend(PacketFilter, Packet)
Using

createPacketCollector(filter);
sendPacket(packet);

was error prone, i.e. the PacketCollector could leak if sendPacket()
would throw an exception and the user forgot to call
PacketCollector.cancel(). For cases where
createPacketCollectorAndSend(IQ) is not sufficient (because we don't
send IQs), createPacketCollectorAndSend(PacketFilter, Packet) is now
used, which does take care that the PacketCollector does not leak if
sendPacket() throws an Exception.
2014-10-13 10:45:00 +02: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 63d52f6eaa Replace PacketInterceptor with PacketListener
both serve the same purpose: As callback for Packets. There is no need
to have both, so remace PacketInterceptor and let PacketListener take
its place. Some classes like ChatStateManager can now use
MessageListener as interceptor callback, which is more convenient.
2014-10-12 19:19:44 +02:00
Florian Schmaus fd7b747987 Remove init() in MultiUserChat
and mark more members 'final'

Also use CopyOnWriteArraySet for presenceInterceptors.
2014-10-12 18:53:19 +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 38582eed84 Make getServiceNames() return List
instead of Collection. Return types should always be as specific as
possible. Because e.g. Collection does not allow 'get(0)', but List
does.
2014-10-12 16:54:21 +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 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 afd7c67bf9 Add support for multiple status codes to MUCUser
Fixes SMACK-604
2014-09-05 11:45:06 +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 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 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
Júlio Cesar Bueno Cotta 9be0c480e3 Change IQ.Type to enum 2014-06-06 21:10:13 -03: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