this.connection = new XMPPConnection(connectionConfiguration);
this.connection.connect();
// add connection listener so we get notified if it will be closed
if (this.smackConnectionListener == null) {
this.smackConnectionListener = new SafeConnectionListener(log,
new XMPPConnectionListener());
}
connection.addConnectionListener(this.smackConnectionListener);
Roster.setDefaultSubscriptionMode(Roster.SubscriptionMode.manual);