diff --git a/src/gatewayresponder.cpp b/src/gatewayresponder.cpp index 1306a9dae074f8f6207da9a8dfda4bd7c6f6a92d..fa29711e7a9a0649abe0e5243f8a76e25e938a46 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) {