From f5e0acc528a875521fdc24a351d7c72559ba3e3a Mon Sep 17 00:00:00 2001 From: HanzZ Date: Sun, 27 Jan 2013 14:15:55 +0100 Subject: [PATCH] Send non-escaped JID in gateway responder if jid_escaping is disabled --- src/gatewayresponder.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gatewayresponder.cpp b/src/gatewayresponder.cpp index 1306a9da..fa29711e 100644 --- a/src/gatewayresponder.cpp +++ b/src/gatewayresponder.cpp @@ -52,7 +52,14 @@ bool GatewayResponder::handleGetRequest(const Swift::JID& from, const Swift::JID bool GatewayResponder::handleSetRequest(const Swift::JID& from, const Swift::JID& to, const std::string& id, boost::shared_ptr payload) { std::string prompt = payload->getPrompt(); + std::string escaped = Swift::JID::getEscapedNode(prompt); + if (!CONFIG_BOOL_DEFAULTED(m_userManager->getComponent()->getConfig(), "service.jid_escaping", true)) { + escaped = prompt; + if (escaped.find_last_of("@") != std::string::npos) { + escaped.replace(escaped.find_last_of("@"), 1, "%"); + } + } // This code is here to workaround Gajim (and probably other clients bug too) bug // https://trac.gajim.org/ticket/7277 if (prompt.find("\\40") != std::string::npos) {