diff options
Diffstat (limited to 'Swiften/Parser/PayloadParsers/S5BProxyRequestParser.cpp')
-rw-r--r-- | Swiften/Parser/PayloadParsers/S5BProxyRequestParser.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Swiften/Parser/PayloadParsers/S5BProxyRequestParser.cpp b/Swiften/Parser/PayloadParsers/S5BProxyRequestParser.cpp index 6e33f16..5cfd28d 100644 --- a/Swiften/Parser/PayloadParsers/S5BProxyRequestParser.cpp +++ b/Swiften/Parser/PayloadParsers/S5BProxyRequestParser.cpp @@ -1,12 +1,18 @@ /* * Copyright (c) 2011 Tobias Markmann * Licensed under the simplified BSD license. * See Documentation/Licenses/BSD-simplified.txt for more information. */ +/* + * Copyright (c) 2015 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ + #include "S5BProxyRequestParser.h" #include <boost/lexical_cast.hpp> #include <boost/optional.hpp> namespace Swift { @@ -17,24 +23,25 @@ S5BProxyRequestParser::S5BProxyRequestParser() : parseActivate(false) { S5BProxyRequestParser::~S5BProxyRequestParser() { } void S5BProxyRequestParser::handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes) { if (element == "streamhost") { if (attributes.getAttributeValue("host") && attributes.getAttributeValue("jid") && attributes.getAttributeValue("port")) { - HostAddress address = attributes.getAttributeValue("host").get_value_or(""); + std::string host = attributes.getAttributeValue("host").get_value_or(""); int port = -1; JID jid = attributes.getAttributeValue("jid").get_value_or(""); try { port = boost::lexical_cast<int>(attributes.getAttributeValue("port").get()); } catch (boost::bad_lexical_cast &) { port = -1; } - if (address.isValid() && port != -1 && jid.isValid()) { + if (!host.empty() && port != -1 && jid.isValid()) { S5BProxyRequest::StreamHost streamHost; - streamHost.addressPort = HostAddressPort(address, port); + streamHost.host = host; + streamHost.port = port; streamHost.jid = jid; getPayloadInternal()->setStreamHost(streamHost); } } } else if (element == "activate") { parseActivate = true; |