diff options
author | Remko Tronçon <git@el-tramo.be> | 2012-04-23 10:05:24 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2012-04-23 10:05:24 (GMT) |
commit | c5dc30ae9ad8b9f3b0209c8ba177f1ce170a6364 (patch) | |
tree | cc28fb37c1ea9e136a5d96764dfe7bc700b47621 /Swiften/Queries/Request.cpp | |
parent | d072dcd1ee143357c41e53ee94a4b6d13e48e2fc (diff) | |
download | swift-contrib-c5dc30ae9ad8b9f3b0209c8ba177f1ce170a6364.zip swift-contrib-c5dc30ae9ad8b9f3b0209c8ba177f1ce170a6364.tar.bz2 |
Work around incorrect roster responses from ejabberd.
Resolves: #1072
Diffstat (limited to 'Swiften/Queries/Request.cpp')
-rw-r--r-- | Swiften/Queries/Request.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Swiften/Queries/Request.cpp b/Swiften/Queries/Request.cpp index f3f56c9..422f36c 100644 --- a/Swiften/Queries/Request.cpp +++ b/Swiften/Queries/Request.cpp @@ -7,6 +7,7 @@ #include <Swiften/Queries/Request.h> #include <Swiften/Queries/IQRouter.h> #include <Swiften/Elements/RawXMLPayload.h> +#include <Swiften/Base/Log.h> namespace Swift { @@ -75,6 +76,11 @@ bool Request::handleIQ(boost::shared_ptr<IQ> iq) { bool Request::isCorrectSender(const JID& jid) { if (router_->isAccountJID(receiver_)) { + if (jid.isValid() && jid.equals(router_->getJID(), JID::WithResource)) { + // This unspecified behavior seems to happen in ejabberd versions (e.g. 2.0.5) + SWIFT_LOG(warning) << "Server responded to an account request with a full JID, which is not allowed. Handling it anyway."; + return true; + } return router_->isAccountJID(jid); } else { |