use of org.eclipse.ecf.internal.provider.xmpp.smack.ECFConnection in project ecf by eclipse.
the class XMPPChatRoomManager method setConnection.
public void setConnection(Namespace connectNamespace, ID connectedID, ECFConnection connection) {
this.connectNamespace = connectNamespace;
this.connectedID = connectedID;
this.ecfConnection = connection;
if (connection != null) {
// Setup invitation requestListener
MultiUserChat.addInvitationListener(ecfConnection.getXMPPConnection(), new InvitationListener() {
public void invitationReceived(Connection arg0, String arg1, String arg2, String arg3, String arg4, Message arg5) {
fireInvitationReceived(createRoomIDFromName(arg1), createUserIDFromName(arg2), createUserIDFromName(arg5.getTo()), arg5.getSubject(), arg3);
}
});
} else {
disposeChatRooms();
}
}
use of org.eclipse.ecf.internal.provider.xmpp.smack.ECFConnection in project ecf by eclipse.
the class XMPPContainer method handleConnectResponse.
protected ID handleConnectResponse(ID originalTarget, Object serverData) throws Exception {
if (originalTarget != null && !originalTarget.equals(getID())) {
// First reset target resource to whatever the server says it is
resetTargetResource(originalTarget, serverData);
addNewRemoteMember(originalTarget, null);
final ECFConnection conn = getECFConnection();
accountManager.setConnection(conn.getXMPPConnection());
chatRoomManager.setConnection(getConnectNamespace(), originalTarget, conn);
searchManager.setConnection(getConnectNamespace(), originalTarget, conn);
searchManager.setEnabled(!isGoogle(originalTarget));
presenceHelper.setUser(new User(originalTarget));
outgoingFileTransferContainerAdapter.setConnection(conn.getXMPPConnection());
return originalTarget;
} else
throw new ConnectException(Messages.XMPPContainer_EXCEPTION_INVALID_RESPONSE_FROM_SERVER);
}
use of org.eclipse.ecf.internal.provider.xmpp.smack.ECFConnection in project ecf by eclipse.
the class XMPPSContainer method createConnection.
protected ISynchAsynchConnection createConnection(ID remoteSpace, Object data) throws ConnectionCreateException {
boolean google = isGoogle(remoteSpace);
CallbackHandler ch = data instanceof IConnectContext ? ((IConnectContext) data).getCallbackHandler() : null;
return new ECFConnection(google, getConnectNamespace(), receiver, ch);
}
Aggregations