diff options
Diffstat (limited to 'Swiften/Disco')
-rw-r--r-- | Swiften/Disco/CapsInfoGenerator.cpp | 11 | ||||
-rw-r--r-- | Swiften/Disco/DiscoServiceWalker.cpp | 9 |
2 files changed, 9 insertions, 11 deletions
diff --git a/Swiften/Disco/CapsInfoGenerator.cpp b/Swiften/Disco/CapsInfoGenerator.cpp index b4637c7..961ef43 100644 --- a/Swiften/Disco/CapsInfoGenerator.cpp +++ b/Swiften/Disco/CapsInfoGenerator.cpp @@ -8,7 +8,6 @@ #include <algorithm> -#include <Swiften/Base/foreach.h> #include <Swiften/Crypto/CryptoProvider.h> #include <Swiften/Elements/DiscoInfo.h> #include <Swiften/Elements/FormField.h> @@ -30,28 +29,28 @@ CapsInfo CapsInfoGenerator::generateCapsInfo(const DiscoInfo& discoInfo) const { std::vector<DiscoInfo::Identity> identities(discoInfo.getIdentities()); std::sort(identities.begin(), identities.end()); - foreach (const DiscoInfo::Identity& identity, identities) { + for (const auto& identity : identities) { serializedCaps += identity.getCategory() + "/" + identity.getType() + "/" + identity.getLanguage() + "/" + identity.getName() + "<"; } std::vector<std::string> features(discoInfo.getFeatures()); std::sort(features.begin(), features.end()); - foreach (const std::string& feature, features) { + for (const auto& feature : features) { serializedCaps += feature + "<"; } - foreach(Form::ref extension, discoInfo.getExtensions()) { + for (const auto& extension : discoInfo.getExtensions()) { serializedCaps += extension->getFormType() + "<"; std::vector<FormField::ref> fields(extension->getFields()); std::sort(fields.begin(), fields.end(), &compareFields); - foreach(FormField::ref field, fields) { + for (const auto& field : fields) { if (field->getName() == "FORM_TYPE") { continue; } serializedCaps += field->getName() + "<"; std::vector<std::string> values(field->getValues()); std::sort(values.begin(), values.end()); - foreach(const std::string& value, values) { + for (const auto& value : values) { serializedCaps += value + "<"; } } diff --git a/Swiften/Disco/DiscoServiceWalker.cpp b/Swiften/Disco/DiscoServiceWalker.cpp index 761e6ab..a3f95d2 100644 --- a/Swiften/Disco/DiscoServiceWalker.cpp +++ b/Swiften/Disco/DiscoServiceWalker.cpp @@ -9,7 +9,6 @@ #include <boost/bind.hpp> #include <Swiften/Base/Log.h> -#include <Swiften/Base/foreach.h> namespace Swift { @@ -28,10 +27,10 @@ void DiscoServiceWalker::beginWalk() { void DiscoServiceWalker::endWalk() { if (active_) { SWIFT_LOG(debug) << "Ending walk to " << service_ << std::endl; - foreach (GetDiscoInfoRequest::ref request, pendingDiscoInfoRequests_) { + for (auto&& request : pendingDiscoInfoRequests_) { request->onResponse.disconnect(boost::bind(&DiscoServiceWalker::handleDiscoInfoResponse, this, _1, _2, request)); } - foreach (GetDiscoItemsRequest::ref request, pendingDiscoItemsRequests_) { + for (auto&& request : pendingDiscoItemsRequests_) { request->onResponse.disconnect(boost::bind(&DiscoServiceWalker::handleDiscoItemsResponse, this, _1, _2, request)); } active_ = false; @@ -65,7 +64,7 @@ void DiscoServiceWalker::handleDiscoInfoResponse(std::shared_ptr<DiscoInfo> info } bool couldContainServices = false; - foreach (DiscoInfo::Identity identity, info->getIdentities()) { + for (const auto& identity : info->getIdentities()) { if (identity.getCategory() == "server") { couldContainServices = true; } @@ -98,7 +97,7 @@ void DiscoServiceWalker::handleDiscoItemsResponse(std::shared_ptr<DiscoItems> it handleDiscoError(request->getReceiver(), error); return; } - foreach (DiscoItems::Item item, items->getItems()) { + for (auto&& item : items->getItems()) { if (item.getNode().empty()) { /* Don't look at noded items. It's possible that this will exclude some services, * but I've never seen one in the wild, and it's an easy fix for not looping. |