summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-10-10 18:01:30 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-10-10 18:01:30 (GMT)
commitdcf30da8e1bf6c3e42f9d0ac8adbdb14f77a9622 (patch)
treed564a22737c77fe33e43e42e6ff8f55a98a6dc6d /Swiften/Client
parent1a3208aff3349cdecec30f12dacfd10ecb5901eb (diff)
downloadswift-dcf30da8e1bf6c3e42f9d0ac8adbdb14f77a9622.zip
swift-dcf30da8e1bf6c3e42f9d0ac8adbdb14f77a9622.tar.bz2
Move SoftwareVersion responder from Swift to Client.
Diffstat (limited to 'Swiften/Client')
-rw-r--r--Swiften/Client/Client.cpp13
-rw-r--r--Swiften/Client/Client.h21
-rw-r--r--Swiften/Client/CoreClient.h9
3 files changed, 43 insertions, 0 deletions
diff --git a/Swiften/Client/Client.cpp b/Swiften/Client/Client.cpp
index 44804be..5c64506 100644
--- a/Swiften/Client/Client.cpp
+++ b/Swiften/Client/Client.cpp
@@ -6,9 +6,22 @@
#include "Swiften/Client/Client.h"
+#include "Swiften/Queries/Responders/SoftwareVersionResponder.h"
+
namespace Swift {
Client::Client(const JID& jid, const String& password) : CoreClient(jid, password) {
+ softwareVersionResponder = new SoftwareVersionResponder(getIQRouter());
+ softwareVersionResponder->start();
+}
+
+Client::~Client() {
+ softwareVersionResponder->stop();
+ delete softwareVersionResponder;
+}
+
+void Client::setSoftwareVersion(const String& name, const String& version) {
+ softwareVersionResponder->setVersion(name, version);
}
}
diff --git a/Swiften/Client/Client.h b/Swiften/Client/Client.h
index 7609eb8..54d6e56 100644
--- a/Swiften/Client/Client.h
+++ b/Swiften/Client/Client.h
@@ -9,8 +9,29 @@
#include "Swiften/Client/CoreClient.h"
namespace Swift {
+ class SoftwareVersionResponder;
+
+ /**
+ * Provides the core functionality for writing XMPP client software.
+ *
+ * Besides connecting to an XMPP server, this class also provides interfaces for
+ * performing most tasks on the XMPP network.
+ */
class Client : public CoreClient {
public:
Client(const JID& jid, const String& password);
+ ~Client();
+
+
+ /**
+ * Sets the software version of the client.
+ *
+ * This will be used to respond to version queries from other entities.
+ */
+ void setSoftwareVersion(const String& name, const String& version);
+
+ private:
+ SoftwareVersionResponder* softwareVersionResponder;
+
};
}
diff --git a/Swiften/Client/CoreClient.h b/Swiften/Client/CoreClient.h
index 704cf3b..02d98b6 100644
--- a/Swiften/Client/CoreClient.h
+++ b/Swiften/Client/CoreClient.h
@@ -32,6 +32,15 @@ namespace Swift {
class ClientSession;
class BasicSessionStream;
+ /**
+ * The central class for communicating with an XMPP server.
+ *
+ * This class is responsible for setting up the connection with the XMPP server, authenticating, and
+ * initializing the session.
+ *
+ * This class can be used directly in your application, although the Client subclass provides more
+ * functionality and interfaces, and is better suited for most needs.
+ */
class CoreClient {
public:
CoreClient(const JID& jid, const String& password);