JaXMPP V3.2.0 Release Notes
Tigase JaXMPP v3.2.0 has been released! Please review the change notes below to see what has changed since our last release.
1. Changes
-
#4369: Support for XEP-0313: Message Archive Management has now been added within Jaxmpp-MAM module.
-
Implementation of XEP-0357: Push Notifications
-
SCRAM-SHA-1 and SCRAM-SHA-1-PLUS are now enabled by default for Authorization.
-
#4280: added support for XEP-0352: Client State Indication
-
#5950: added support for XEP-0363: HTTP File Upload
-
#5223: in-band registration to use XMPP Data Forms XEP-0004
-
#4288: Login and Disconnect methods have been changed in blocking mode.
-
#4398: Removed JDK8 specific features not supported by GWT to prevent errors.
-
#4762: added support for handling WebSocket PONG frames
-
#7387: added support for PubSub notifications about node removal and association/dissociation to the collection node
2. Fixes
-
#4317: fixed NPE if receiver of file transfer is not connected or disconnected in SOCKS5.
-
#4318: added checking if destination file is set when file transfer is accepted.
-
#4378: fixed exceptions occuring when a server-initiated disconnection could lead to an invalid connector state, fix issue with invalid connector state when connecting using Websocket Protocol over TCP.
-
#8104: fixing issue with parsing timestamp
-
#8033: added thread safety to ExtensionsChain implementation
-
#2654: improve DNS resolution for local addresses
-
#7793: fixing possible NPE in UnifiedRegistrationForm when value for a fiels is null
-
#7649: improving GWT code for sites hosted on HTTPS enabled servers
-
#7525: added method for retrieving error text from error stanzas
-
#6330: fixes for AdHocCommansAsyncCallback not calling onResponseReceived() if there is no data form in the response and for ElementWrapper which failed to set GwtElement value
-
#6330: added event for notification about PubSub node configuration change
-
#6212, #6232: fixing issue introduced by recent changes in sending authcid and authzid during authentication
-
#6212: improvements to SASL implementations
-
#5749: fix issue with login to jabber.org, says incorrect password, even though password is correct
-
#1590: add support for subscription pre-approval in RosterModule and RosterItem
-
#5669: removed firing ErrorEvent by connectors if exception is thrown in start() method within the same thread
-
#5624: fixed possible lock if Jaxmpp::login() method throws an exception and login(true) was called
-
#5582: fixing race condition during Jaxmpp login leading to a thread being permanently locked
-
#5584: MAM module not being called for incoming messages
-
#5588: fixed issue with messages without from causing NPE in MessegeModule
-
#5527: added support for connection using plain SSL instead of STARTTLS
-
#5529: fixed handling of see-other-host in ConnectionManager for GWT
-
#5318: added implementation for GwtElement::removeChild() method
-
#5421: fixed issue with handling PONG WebSocket frames with payload
-
#4961: fix JaXMPP problems on Android
-
#4733: fixed issue with comparision of elements with XMLNS
-
#4732: minor fix in MessageArchiveManagementModule
-
#4460: fixed issue with retrieving PubSub node configuration
-
#4728: fix minor issue with element equals() method
-
#4348: fixed issues with Jaxmpp state and reconnecting
-
#4348: changed DEFAULT_SOCKET_TIMEOUT to 0 as value bigger than zero causes issues for long connections without any activity
-
#4460: improved usage of events with callbacks called after all handlers processed event
-
#4266: fixing issue with reconnection after disconnection by client
-
#4505: fix handling of badly encoded channel binding data
-
#4398: remove used JDK8 specific features which are not supported by GWT
-
#4291: ContactChangedPresenceEvent has show "online" for unavailable presence
-
#4266: fixed issue with blocking disconnection
-
#4124: fixed issue with support for see-other-host with WebSocket in GWT version
4. Examples
4.1. A very simple client in Groovy (sending and listening for message)
import tigase.jaxmpp.core.client.BareJID
import tigase.jaxmpp.core.client.JID
import tigase.jaxmpp.core.client.SessionObject
import tigase.jaxmpp.core.client.exceptions.JaxmppException
import tigase.jaxmpp.core.client.xmpp.modules.chat.Chat
import tigase.jaxmpp.core.client.xmpp.modules.chat.MessageModule
import tigase.jaxmpp.core.client.xmpp.stanzas.Message
import tigase.jaxmpp.j2se.Jaxmpp
final Jaxmpp contact = new Jaxmpp()
tigase.jaxmpp.j2se.Presence.initialize(contact);
contact.getModulesManager().register(new MessageModule());
contact.getProperties().setUserProperty(SessionObject.USER_BARE_JID, BareJID.bareJIDInstance("admin@atlantiscity"))
contact.getProperties().setUserProperty(SessionObject.PASSWORD, "admin")
contact.getEventBus().addHandler(MessageModule.MessageReceivedHandler.MessageReceivedEvent.class,
new MessageModule.MessageReceivedHandler() {
@Override
public void onMessageReceived(SessionObject sessionObject, Chat chat, Message stanza) {
System.out.println("message: " + stanza.getBody());
}
});
println("Loging in...");
contact.login(true)
if (contact.isConnected()) {
contact.getModule(MessageModule.class).sendMessage(JID.jidInstance("tigase1@atlantiscity"), "Test", "This is a test")
Thread.sleep(1 * 10 * 1000)
contact.disconnect()
}
4.2. A very simple client in Groovy (direct presence + presence listen)
It sends direct presence and then listens for 10 minutes for any presence changes.
import tigase.jaxmpp.core.client.BareJID
import tigase.jaxmpp.core.client.JID
import tigase.jaxmpp.core.client.SessionObject
import tigase.jaxmpp.core.client.exceptions.JaxmppException
import tigase.jaxmpp.core.client.xmpp.modules.chat.MessageModule
import tigase.jaxmpp.core.client.xmpp.modules.presence.PresenceModule
import tigase.jaxmpp.core.client.xmpp.stanzas.Presence
import tigase.jaxmpp.j2se.Jaxmpp
import tigase.jaxmpp.j2se.connectors.socket.SocketConnector
final Jaxmpp contact = new Jaxmpp()
tigase.jaxmpp.j2se.Presence.initialize(contact);
tigase.jaxmpp.j2se.Roster.initialize(contact);
contact.getModulesManager().register(new MessageModule());
contact.getProperties().setUserProperty(SessionObject.USER_BARE_JID, BareJID.bareJIDInstance("admin@atlantiscity"))
contact.getProperties().setUserProperty(SessionObject.PASSWORD, "admin")
contact.getEventBus().addHandler(PresenceModule.ContactChangedPresenceHandler.ContactChangedPresenceEvent.class, new PresenceModule.ContactChangedPresenceHandler() {
@Override
void onContactChangedPresence(SessionObject sessionObject, Presence stanza, JID jid, Presence.Show show, String status, Integer priority) throws JaxmppException {
System.out.println("Presence received:\t" + jid + " is now " + show + " (" + status + ")");
}
});
println("Loging in...");
contact.login(true)
if (contact.isConnected()) {
println("Sending direct presence")
def presenceModule = contact.getModulesManager().getModule(PresenceModule.class);
presenceModule.sentDirectPresence(JID.jidInstance("tigase2@atlantiscity/Psi+"), Presence.Show.away, "new status", 65);
Thread.sleep(1 * 1000)
println("Sending direct unavailable presence")
presenceModule.sentDirectPresence(JID.jidInstance("tigase2@atlantiscity/Psi+"), Presence.Show.offline, "new status", 65);
Thread.sleep(1 * 1000)
println("Waiting for the presence for 10 minutes")
Thread.sleep(10 * 60 * 1000)
contact.disconnect()
}