summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Queries/IQRouter.cpp')
-rw-r--r--Swiften/Queries/IQRouter.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/Swiften/Queries/IQRouter.cpp b/Swiften/Queries/IQRouter.cpp
index 1bfff70..c84e1bb 100644
--- a/Swiften/Queries/IQRouter.cpp
+++ b/Swiften/Queries/IQRouter.cpp
@@ -4,15 +4,15 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/Queries/IQRouter.h"
+#include <Swiften/Queries/IQRouter.h>
-#include <algorithm>
#include <boost/bind.hpp>
-#include "Swiften/Base/foreach.h"
-#include "Swiften/Queries/IQHandler.h"
-#include "Swiften/Queries/IQChannel.h"
-#include "Swiften/Elements/ErrorPayload.h"
+#include <Swiften/Base/Algorithm.h>
+#include <Swiften/Base/foreach.h>
+#include <Swiften/Queries/IQHandler.h>
+#include <Swiften/Queries/IQChannel.h>
+#include <Swiften/Elements/ErrorPayload.h>
namespace Swift {
@@ -54,7 +54,7 @@ void IQRouter::handleIQ(boost::shared_ptr<IQ> iq) {
void IQRouter::processPendingRemoves() {
foreach(boost::shared_ptr<IQHandler> handler, queuedRemoves_) {
- handlers_.erase(std::remove(handlers_.begin(), handlers_.end(), handler), handlers_.end());
+ erase(handlers_, handler);
}
queuedRemoves_.clear();
}
@@ -76,12 +76,12 @@ void IQRouter::removeHandler(boost::shared_ptr<IQHandler> handler) {
queuedRemoves_.push_back(handler);
}
else {
- handlers_.erase(std::remove(handlers_.begin(), handlers_.end(), handler), handlers_.end());
+ erase(handlers_, handler);
}
}
void IQRouter::sendIQ(boost::shared_ptr<IQ> iq) {
- if (from_.isValid()) {
+ if (from_.isValid() && !iq->getFrom().isValid()) {
iq->setFrom(from_);
}
channel_->sendIQ(iq);