diff options
author | Remko Tronçon <git@el-tramo.be> | 2009-11-08 16:12:48 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2009-11-08 18:32:15 (GMT) |
commit | f1d74218cb432513c376b46aa115acb3e107ed3a (patch) | |
tree | 24df6a3233f1fd3c2c2592637cfcfd1846040dee /Swiften/Queries/Requests | |
parent | b6003bea740e8898127ec135e230eed421924370 (diff) | |
download | swift-f1d74218cb432513c376b46aa115acb3e107ed3a.zip swift-f1d74218cb432513c376b46aa115acb3e107ed3a.tar.bz2 |
Added Error class.
Diffstat (limited to 'Swiften/Queries/Requests')
3 files changed, 8 insertions, 8 deletions
diff --git a/Swiften/Queries/Requests/GetPrivateStorageRequest.h b/Swiften/Queries/Requests/GetPrivateStorageRequest.h index c5f8aef..5d6440e 100644 --- a/Swiften/Queries/Requests/GetPrivateStorageRequest.h +++ b/Swiften/Queries/Requests/GetPrivateStorageRequest.h @@ -5,7 +5,7 @@ #include "Swiften/Queries/Request.h" #include "Swiften/Elements/PrivateStorage.h" -#include "Swiften/Elements/Error.h" +#include "Swiften/Elements/ErrorPayload.h" namespace Swift { template<typename PAYLOAD_TYPE> @@ -14,7 +14,7 @@ namespace Swift { GetPrivateStorageRequest(IQRouter* router) : Request(IQ::Get, JID(), boost::shared_ptr<PrivateStorage>(new PrivateStorage(boost::shared_ptr<Payload>(new PAYLOAD_TYPE()))), router) { } - virtual void handleResponse(boost::shared_ptr<Payload> payload, boost::optional<Error> error) { + virtual void handleResponse(boost::shared_ptr<Payload> payload, boost::optional<ErrorPayload> error) { boost::shared_ptr<PrivateStorage> storage = boost::dynamic_pointer_cast<PrivateStorage>(payload); if (storage) { onResponse(boost::dynamic_pointer_cast<PAYLOAD_TYPE>(storage->getPayload()), error); @@ -25,6 +25,6 @@ namespace Swift { } public: - boost::signal<void (boost::shared_ptr<PAYLOAD_TYPE>, const boost::optional<Error>&)> onResponse; + boost::signal<void (boost::shared_ptr<PAYLOAD_TYPE>, const boost::optional<ErrorPayload>&)> onResponse; }; } diff --git a/Swiften/Queries/Requests/SetPrivateStorageRequest.h b/Swiften/Queries/Requests/SetPrivateStorageRequest.h index 63ac8dc..834ddd8 100644 --- a/Swiften/Queries/Requests/SetPrivateStorageRequest.h +++ b/Swiften/Queries/Requests/SetPrivateStorageRequest.h @@ -5,7 +5,7 @@ #include "Swiften/Queries/Request.h" #include "Swiften/Elements/PrivateStorage.h" -#include "Swiften/Elements/Error.h" +#include "Swiften/Elements/ErrorPayload.h" namespace Swift { template<typename PAYLOAD_TYPE> @@ -14,11 +14,11 @@ namespace Swift { SetPrivateStorageRequest(boost::shared_ptr<PAYLOAD_TYPE> payload, IQRouter* router) : Request(IQ::Set, JID(), boost::shared_ptr<PrivateStorage>(new PrivateStorage(payload)), router) { } - virtual void handleResponse(boost::shared_ptr<Payload> payload, boost::optional<Error> error) { + virtual void handleResponse(boost::shared_ptr<Payload> payload, boost::optional<ErrorPayload> error) { onResponse(error); } public: - boost::signal<void (const boost::optional<Error>&)> onResponse; + boost::signal<void (const boost::optional<ErrorPayload>&)> onResponse; }; } diff --git a/Swiften/Queries/Requests/UnitTest/GetPrivateStorageRequestTest.cpp b/Swiften/Queries/Requests/UnitTest/GetPrivateStorageRequestTest.cpp index 14e04cf..a86a111 100644 --- a/Swiften/Queries/Requests/UnitTest/GetPrivateStorageRequestTest.cpp +++ b/Swiften/Queries/Requests/UnitTest/GetPrivateStorageRequestTest.cpp @@ -72,7 +72,7 @@ class GetPrivateStorageRequestTest : public CppUnit::TestFixture } private: - void handleResponse(boost::shared_ptr<Payload> p, const boost::optional<Error>& e) { + void handleResponse(boost::shared_ptr<Payload> p, const boost::optional<ErrorPayload>& e) { if (e) { errors.push_back(*e); } @@ -99,7 +99,7 @@ class GetPrivateStorageRequestTest : public CppUnit::TestFixture private: IQRouter* router; DummyIQChannel* channel; - std::vector< Error > errors; + std::vector< ErrorPayload > errors; std::vector< boost::shared_ptr<Payload> > responses; }; |