diff options
18 files changed, 26 insertions, 27 deletions
diff --git a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot1.cpp b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot1.cpp index f5268ef..de58f77 100644 --- a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot1.cpp +++ b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot1.cpp @@ -12,7 +12,7 @@ int main(int, char**) {  	SimpleEventLoop eventLoop;  	BoostNetworkFactories networkFactories(&eventLoop); -	Client client(&eventLoop, &networkFactories, JID("echobot@wonderland.lit"), "mypass"); +	Client client(JID("echobot@wonderland.lit"), "mypass", &networkFactories);  	client.connect();  	eventLoop.run(); diff --git a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot2.cpp b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot2.cpp index 99efdf9..bf1c74a 100644 --- a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot2.cpp +++ b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot2.cpp @@ -21,7 +21,7 @@ int main(int, char**) {  	SimpleEventLoop eventLoop;  	BoostNetworkFactories networkFactories(&eventLoop); -	client = new Client(&eventLoop, &networkFactories, JID("echobot@wonderland.lit"), "mypass"); +	client = new Client(JID("echobot@wonderland.lit"), "mypass", &networkFactories);  	client->onConnected.connect(&handleConnected);  	client->onMessageReceived.connect(bind(&handleMessageReceived, _1));  	client->connect(); diff --git a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot3.cpp b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot3.cpp index 3404c2a..d815d1f 100644 --- a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot3.cpp +++ b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot3.cpp @@ -14,8 +14,8 @@ using namespace boost;  class EchoBot {  	public: -		EchoBot(EventLoop* eventLoop, NetworkFactories* networkFactories) { -			client = new Client(eventLoop, networkFactories, JID("echobot@wonderland.lit"), "mypass"); +		EchoBot(NetworkFactories* networkFactories) { +			client = new Client(JID("echobot@wonderland.lit"), "mypass", networkFactories);  			client->onConnected.connect(bind(&EchoBot::handleConnected, this));  			client->onMessageReceived.connect(  					bind(&EchoBot::handleMessageReceived, this, _1)); @@ -49,7 +49,7 @@ int main(int, char**) {  	SimpleEventLoop eventLoop;  	BoostNetworkFactories networkFactories(&eventLoop); -	EchoBot bot(&eventLoop, &networkFactories); +	EchoBot bot(&networkFactories);  	eventLoop.run();  	return 0; diff --git a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot4.cpp b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot4.cpp index 0309768..fc846d3 100644 --- a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot4.cpp +++ b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot4.cpp @@ -15,9 +15,9 @@ using namespace boost;  //...  class EchoBot {  	public: -		EchoBot(EventLoop* eventLoop, NetworkFactories* networkFactories) { +		EchoBot(NetworkFactories* networkFactories) {  			//... -			client = new Client(eventLoop, networkFactories, JID("echobot@wonderland.lit"), "mypass"); +			client = new Client(JID("echobot@wonderland.lit"), "mypass", networkFactories);  			client->onConnected.connect(bind(&EchoBot::handleConnected, this));  			client->onMessageReceived.connect(  					bind(&EchoBot::handleMessageReceived, this, _1)); @@ -84,7 +84,7 @@ int main(int, char**) {  	SimpleEventLoop eventLoop;  	BoostNetworkFactories networkFactories(&eventLoop); -	EchoBot bot(&eventLoop, &networkFactories); +	EchoBot bot(&networkFactories);  	eventLoop.run();  	return 0; diff --git a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot5.cpp b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot5.cpp index 4c09e1b..bc4cc3b 100644 --- a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot5.cpp +++ b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot5.cpp @@ -15,9 +15,9 @@ using namespace boost;  //...  class EchoBot {  	public: -		EchoBot(EventLoop* eventLoop, NetworkFactories* networkFactories) { +		EchoBot(NetworkFactories* networkFactories) {  			//... -			client = new Client(eventLoop, networkFactories, JID("echobot@wonderland.lit"), "mypass"); +			client = new Client(JID("echobot@wonderland.lit"), "mypass", networkFactories);  			client->onConnected.connect(bind(&EchoBot::handleConnected, this));  			client->onMessageReceived.connect(  					bind(&EchoBot::handleMessageReceived, this, _1)); @@ -92,7 +92,7 @@ int main(int, char**) {  	SimpleEventLoop eventLoop;  	BoostNetworkFactories networkFactories(&eventLoop); -	EchoBot bot(&eventLoop, &networkFactories); +	EchoBot bot(&networkFactories);  	eventLoop.run();  	return 0; diff --git a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot6.cpp b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot6.cpp index 7bbeaaf..6443438 100644 --- a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot6.cpp +++ b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot6.cpp @@ -20,9 +20,9 @@ using namespace boost;  class EchoBot {  	public: -		EchoBot(EventLoop* eventLoop, NetworkFactories* networkFactories) { +		EchoBot(NetworkFactories* networkFactories) {  			//... -			client = new Client(eventLoop, networkFactories, JID("echobot@wonderland.lit"), "mypass"); +			client = new Client(JID("echobot@wonderland.lit"), "mypass", networkFactories);  			client->onConnected.connect(bind(&EchoBot::handleConnected, this));  			client->onMessageReceived.connect(  					bind(&EchoBot::handleMessageReceived, this, _1)); @@ -113,7 +113,7 @@ int main(int, char**) {  	SimpleEventLoop eventLoop;  	BoostNetworkFactories networkFactories(&eventLoop); -	EchoBot bot(&eventLoop, &networkFactories); +	EchoBot bot(&networkFactories);  	eventLoop.run();  	return 0; diff --git a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/SConscript b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/SConscript index 1e410cf..ca9ce62 100644 --- a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/SConscript +++ b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/SConscript @@ -6,4 +6,5 @@ example_env.MergeFlags(example_env["SWIFTEN_DEP_FLAGS"])  for i in range(1,7) :  	example_env.Program("EchoBot" + str(i), ["EchoBot" + str(i) + ".cpp"]) +#example_env.Program("EchoBot0x", "EchoBot0x.cpp")  example_env.Program("EchoComponent", "EchoComponent.cpp") diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp index d7e1941..1b513cd 100644 --- a/Swift/Controllers/MainController.cpp +++ b/Swift/Controllers/MainController.cpp @@ -377,7 +377,7 @@ void MainController::performLoginFromCachedCredentials() {  		certificateStorage_ = certificateStorageFactory_->createCertificateStorage(jid_.toBare());  		certificateTrustChecker_ = new CertificateStorageTrustChecker(certificateStorage_); -		client_ = boost::make_shared<Swift::Client>(eventLoop_, networkFactories_, clientJID, password_, storages_); +		client_ = boost::make_shared<Swift::Client>(clientJID, password_, networkFactories_, storages_);  		clientInitialized_ = true;  		client_->setCertificateTrustChecker(certificateTrustChecker_);  		client_->onDataRead.connect(boost::bind(&XMLConsoleController::handleDataRead, xmlConsoleController_, _1)); diff --git a/Swiften/Client/Client.cpp b/Swiften/Client/Client.cpp index d3dcd3e..168c357 100644 --- a/Swiften/Client/Client.cpp +++ b/Swiften/Client/Client.cpp @@ -28,7 +28,7 @@  namespace Swift { -Client::Client(EventLoop* eventLoop, NetworkFactories* networkFactories, const JID& jid, const String& password, Storages* storages) : CoreClient(eventLoop, networkFactories, jid, password), storages(storages) { +Client::Client(const JID& jid, const String& password, NetworkFactories* networkFactories, Storages* storages) : CoreClient(jid, password, networkFactories), storages(storages) {  	memoryStorages = new MemoryStorages();  	softwareVersionResponder = new SoftwareVersionResponder(getIQRouter()); diff --git a/Swiften/Client/Client.h b/Swiften/Client/Client.h index 975d499..4725d50 100644 --- a/Swiften/Client/Client.h +++ b/Swiften/Client/Client.h @@ -47,7 +47,7 @@ namespace Swift {  			 *	this is NULL,  			 *	all data will be stored in memory (and be lost on shutdown)  			 */ -			Client(EventLoop* eventLoop, NetworkFactories* networkFactories, const JID& jid, const String& password, Storages* storages = NULL); +			Client(const JID& jid, const String& password, NetworkFactories* networkFactories, Storages* storages = NULL);  			~Client(); diff --git a/Swiften/Client/CoreClient.cpp b/Swiften/Client/CoreClient.cpp index 0a684b1..2bd22c8 100644 --- a/Swiften/Client/CoreClient.cpp +++ b/Swiften/Client/CoreClient.cpp @@ -22,7 +22,7 @@  namespace Swift { -CoreClient::CoreClient(EventLoop* eventLoop, NetworkFactories* networkFactories, const JID& jid, const String& password) : jid_(jid), password_(password), eventLoop(eventLoop), networkFactories(networkFactories), disconnectRequested_(false), certificateTrustChecker(NULL) { +CoreClient::CoreClient(const JID& jid, const String& password, NetworkFactories* networkFactories) : jid_(jid), password_(password), networkFactories(networkFactories), disconnectRequested_(false), certificateTrustChecker(NULL) {  	stanzaChannel_ = new ClientSessionStanzaChannel();  	stanzaChannel_->onMessageReceived.connect(boost::bind(&CoreClient::handleMessageReceived, this, _1));  	stanzaChannel_->onPresenceReceived.connect(boost::bind(&CoreClient::handlePresenceReceived, this, _1)); diff --git a/Swiften/Client/CoreClient.h b/Swiften/Client/CoreClient.h index bac78a3..5ecf2c9 100644 --- a/Swiften/Client/CoreClient.h +++ b/Swiften/Client/CoreClient.h @@ -32,7 +32,6 @@ namespace Swift {  	class TimerFactory;  	class ClientSession;  	class BasicSessionStream; -	class EventLoop;  	class PlatformTLSFactories;  	class CertificateTrustChecker;  	class NetworkFactories; @@ -53,7 +52,7 @@ namespace Swift {  			 * Constructs a client for the given JID with the given password.  			 * The given eventLoop will be used to post events to.  			 */ -			CoreClient(EventLoop* eventLoop, NetworkFactories* networkFactories, const JID& jid, const String& password); +			CoreClient(const JID& jid, const String& password, NetworkFactories* networkFactories);  			~CoreClient();  			void setCertificate(const String& certificate); @@ -207,7 +206,6 @@ namespace Swift {  		private:  			JID jid_;  			String password_; -			EventLoop* eventLoop;  			NetworkFactories* networkFactories;  			ClientSessionStanzaChannel* stanzaChannel_;  			IQRouter* iqRouter_; diff --git a/Swiften/Examples/BenchTool/BenchTool.cpp b/Swiften/Examples/BenchTool/BenchTool.cpp index 9b6f1ae..aaf83b5 100644 --- a/Swiften/Examples/BenchTool/BenchTool.cpp +++ b/Swiften/Examples/BenchTool/BenchTool.cpp @@ -45,7 +45,7 @@ int main(int, char**) {  	BlindCertificateTrustChecker trustChecker;  	std::vector<CoreClient*> clients;  	for (int i = 0; i < numberOfInstances; ++i) { -		CoreClient* client = new Swift::CoreClient(&eventLoop, &networkFactories, JID(jid), String(pass)); +		CoreClient* client = new Swift::CoreClient(JID(jid), String(pass), &networkFactories);  		client->setCertificateTrustChecker(&trustChecker);  		client->onConnected.connect(&handleConnected);  		clients.push_back(client); diff --git a/Swiften/Examples/ConnectivityTest/ConnectivityTest.cpp b/Swiften/Examples/ConnectivityTest/ConnectivityTest.cpp index 578cab5..2f3a751 100644 --- a/Swiften/Examples/ConnectivityTest/ConnectivityTest.cpp +++ b/Swiften/Examples/ConnectivityTest/ConnectivityTest.cpp @@ -68,7 +68,7 @@ int main(int argc, char* argv[]) {  		connectHost = argv[argi++];  	} -	client = new Swift::Client(&eventLoop, &networkFactories, JID(jid), String(argv[argi++])); +	client = new Swift::Client(JID(jid), String(argv[argi++]), &networkFactories);  	char* timeoutChar = argv[argi++];  	int timeout = atoi(timeoutChar);  	timeout = (timeout ? timeout : 30) * 1000; diff --git a/Swiften/Examples/SendFile/ReceiveFile.cpp b/Swiften/Examples/SendFile/ReceiveFile.cpp index a6386cd..278cc3e 100644 --- a/Swiften/Examples/SendFile/ReceiveFile.cpp +++ b/Swiften/Examples/SendFile/ReceiveFile.cpp @@ -26,7 +26,7 @@ int exitCode = 2;  class FileReceiver {  	public:  		FileReceiver(const JID& jid, const String& password) : jid(jid), password(password), jingleSessionManager(NULL), incomingFileTransferManager(NULL) { -			client = new Swift::Client(&eventLoop, &networkFactories, jid, password); +			client = new Swift::Client(jid, password, &networkFactories);  			client->onConnected.connect(boost::bind(&FileReceiver::handleConnected, this));  			client->onDisconnected.connect(boost::bind(&FileReceiver::handleDisconnected, this, _1));  			//tracer = new ClientXMLTracer(client); diff --git a/Swiften/Examples/SendFile/SendFile.cpp b/Swiften/Examples/SendFile/SendFile.cpp index c355ce7..b2db22b 100644 --- a/Swiften/Examples/SendFile/SendFile.cpp +++ b/Swiften/Examples/SendFile/SendFile.cpp @@ -32,7 +32,7 @@ class FileSender {  			connectionServer = BoostConnectionServer::create(port, networkFactories.getIOServiceThread()->getIOService(), &eventLoop);  			socksBytestreamServer = new SOCKS5BytestreamServer(connectionServer); -			client = new Swift::Client(&eventLoop, &networkFactories, jid, password); +			client = new Swift::Client(jid, password, &networkFactories);  			client->onConnected.connect(boost::bind(&FileSender::handleConnected, this));  			client->onDisconnected.connect(boost::bind(&FileSender::handleDisconnected, this, _1));  			//tracer = new ClientXMLTracer(client); diff --git a/Swiften/Examples/SendMessage/SendMessage.cpp b/Swiften/Examples/SendMessage/SendMessage.cpp index 8e28dab..d763ffc 100644 --- a/Swiften/Examples/SendMessage/SendMessage.cpp +++ b/Swiften/Examples/SendMessage/SendMessage.cpp @@ -57,7 +57,7 @@ int main(int argc, char* argv[]) {  		connectHost = argv[argi++];  	} -	client = new Swift::Client(&eventLoop, &networkFactories, JID(jid), String(argv[argi++])); +	client = new Swift::Client(JID(jid), String(argv[argi++]), &networkFactories);  	client->setAlwaysTrustCertificates();  	recipient = JID(argv[argi++]); diff --git a/Swiften/QA/ClientTest/ClientTest.cpp b/Swiften/QA/ClientTest/ClientTest.cpp index f5ea43f..0fb02ad 100644 --- a/Swiften/QA/ClientTest/ClientTest.cpp +++ b/Swiften/QA/ClientTest/ClientTest.cpp @@ -59,7 +59,7 @@ int main(int, char**) {  		return -1;  	} -	client = new Swift::Client(&eventLoop, &networkFactories, JID(jid), String(pass)); +	client = new Swift::Client(JID(jid), String(pass), &networkFactories);  	ClientXMLTracer* tracer = new ClientXMLTracer(client);  	client->onConnected.connect(&handleConnected);  	client->setAlwaysTrustCertificates();  | 
 Swift