diff --git a/include/Swiften/Network/DummyNetworkFactories.cpp b/include/Swiften/Network/DummyNetworkFactories.cpp index 9da055e3..28fbe5b0 100644 --- a/include/Swiften/Network/DummyNetworkFactories.cpp +++ b/include/Swiften/Network/DummyNetworkFactories.cpp @@ -15,8 +15,12 @@ namespace Swift { DummyNetworkFactories::DummyNetworkFactories(EventLoop* eventLoop) { timerFactory = new DummyTimerFactory(); connectionFactory = new DummyConnectionFactory(eventLoop); +#if HAVE_SWIFTEN_3 idnConverter = boost::shared_ptr(PlatformIDNConverter::create()); domainNameResolver = new PlatformDomainNameResolver(idnConverter.get(), eventLoop); +#else + domainNameResolver = new PlatformDomainNameResolver(eventLoop); +#endif connectionServerFactory = new DummyConnectionServerFactory(eventLoop); m_platformXMLParserFactory = new PlatformXMLParserFactory(); this->eventLoop = eventLoop; diff --git a/include/Swiften/Network/DummyNetworkFactories.h b/include/Swiften/Network/DummyNetworkFactories.h index 64694e8a..22537c3f 100644 --- a/include/Swiften/Network/DummyNetworkFactories.h +++ b/include/Swiften/Network/DummyNetworkFactories.h @@ -6,10 +6,15 @@ #pragma once +#include +#define HAVE_SWIFTEN_3 SWIFTEN_VERSION >= 0x030000 + #include #include +#if HAVE_SWIFTEN_3 #include #include +#endif namespace Swift { class EventLoop; @@ -27,9 +32,11 @@ namespace Swift { return connectionFactory; } +#if HAVE_SWIFTEN_3 IDNConverter* getIDNConverter() const { return idnConverter.get(); } +#endif DomainNameResolver* getDomainNameResolver() const { return domainNameResolver; @@ -63,7 +70,9 @@ namespace Swift { PlatformXMLParserFactory *m_platformXMLParserFactory; TimerFactory* timerFactory; ConnectionFactory* connectionFactory; +#if HAVE_SWIFTEN_3 boost::shared_ptr idnConverter; +#endif DomainNameResolver* domainNameResolver; ConnectionServerFactory* connectionServerFactory; EventLoop *eventLoop;