diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-02-24 21:50:17 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-02-24 21:50:17 (GMT) |
commit | 5698df1c136ebfbf943139b27732bf271e007875 (patch) | |
tree | 86dc522849dde483828d73f0b31c593bb2eb605d /Swiften | |
parent | 90d6b45adf84976d99911feb3fb09b27cb6a8d1e (diff) | |
download | swift-5698df1c136ebfbf943139b27732bf271e007875.zip swift-5698df1c136ebfbf943139b27732bf271e007875.tar.bz2 |
Added Sluift client test script and the necessary infrastructure.
Diffstat (limited to 'Swiften')
-rw-r--r-- | Swiften/Client/Client.cpp | 4 | ||||
-rw-r--r-- | Swiften/Client/Client.h | 2 | ||||
-rw-r--r-- | Swiften/Queries/Responders/SoftwareVersionResponder.cpp | 5 | ||||
-rw-r--r-- | Swiften/Queries/Responders/SoftwareVersionResponder.h | 3 |
4 files changed, 8 insertions, 6 deletions
diff --git a/Swiften/Client/Client.cpp b/Swiften/Client/Client.cpp index 904f722..7918c46 100644 --- a/Swiften/Client/Client.cpp +++ b/Swiften/Client/Client.cpp @@ -93,8 +93,8 @@ XMPPRoster* Client::getRoster() const { return roster; } -void Client::setSoftwareVersion(const std::string& name, const std::string& version) { - softwareVersionResponder->setVersion(name, version); +void Client::setSoftwareVersion(const std::string& name, const std::string& version, const std::string& os) { + softwareVersionResponder->setVersion(name, version, os); } void Client::requestRoster() { diff --git a/Swiften/Client/Client.h b/Swiften/Client/Client.h index 868c9c4..d5db1ac 100644 --- a/Swiften/Client/Client.h +++ b/Swiften/Client/Client.h @@ -56,7 +56,7 @@ namespace Swift { * * This will be used to respond to version queries from other entities. */ - void setSoftwareVersion(const std::string& name, const std::string& version); + void setSoftwareVersion(const std::string& name, const std::string& version, const std::string& os); /** * Returns a representation of the roster. diff --git a/Swiften/Queries/Responders/SoftwareVersionResponder.cpp b/Swiften/Queries/Responders/SoftwareVersionResponder.cpp index 0b8362c..445dcc7 100644 --- a/Swiften/Queries/Responders/SoftwareVersionResponder.cpp +++ b/Swiften/Queries/Responders/SoftwareVersionResponder.cpp @@ -12,13 +12,14 @@ namespace Swift { SoftwareVersionResponder::SoftwareVersionResponder(IQRouter* router) : GetResponder<SoftwareVersion>(router) { } -void SoftwareVersionResponder::setVersion(const std::string& client, const std::string& version) { +void SoftwareVersionResponder::setVersion(const std::string& client, const std::string& version, const std::string& os) { this->client = client; this->version = version; + this->os = os; } bool SoftwareVersionResponder::handleGetRequest(const JID& from, const JID&, const std::string& id, boost::shared_ptr<SoftwareVersion>) { - sendResponse(from, id, boost::shared_ptr<SoftwareVersion>(new SoftwareVersion(client, version))); + sendResponse(from, id, boost::shared_ptr<SoftwareVersion>(new SoftwareVersion(client, version, os))); return true; } diff --git a/Swiften/Queries/Responders/SoftwareVersionResponder.h b/Swiften/Queries/Responders/SoftwareVersionResponder.h index f6a3d52..cbda54c 100644 --- a/Swiften/Queries/Responders/SoftwareVersionResponder.h +++ b/Swiften/Queries/Responders/SoftwareVersionResponder.h @@ -16,7 +16,7 @@ namespace Swift { public: SoftwareVersionResponder(IQRouter* router); - void setVersion(const std::string& client, const std::string& version); + void setVersion(const std::string& client, const std::string& version, const std::string& os = ""); private: virtual bool handleGetRequest(const JID& from, const JID& to, const std::string& id, boost::shared_ptr<SoftwareVersion> payload); @@ -24,5 +24,6 @@ namespace Swift { private: std::string client; std::string version; + std::string os; }; } |