Fix compilation with Swiften 2

This commit is contained in:
Jan Kaluza 2015-11-24 12:42:46 +01:00
parent ed56f45984
commit 0a13c5f0ce
2 changed files with 14 additions and 1 deletions

View file

@ -39,9 +39,16 @@ SlackRTM::SlackRTM(Component *component, StorageBackend *storageBackend, UserInf
m_component = component;
m_storageBackend = storageBackend;
#if HAVE_SWIFTEN_3
Swift::TLSOptions o;
#endif
Swift::PlatformTLSFactories *m_tlsFactory = new Swift::PlatformTLSFactories();
#if HAVE_SWIFTEN_3
m_tlsConnectionFactory = new Swift::TLSConnectionFactory(m_tlsFactory->getTLSContextFactory(), component->getNetworkFactories()->getConnectionFactory(), o);
#else
m_tlsConnectionFactory = new Swift::TLSConnectionFactory(m_tlsFactory->getTLSContextFactory(), component->getNetworkFactories()->getConnectionFactory());
#endif
std::string url = "https://slack.com/api/rtm.start?";

View file

@ -26,12 +26,18 @@
#include <Swiften/Network/TLSConnectionFactory.h>
#include <Swiften/Network/HostAddressPort.h>
#include <Swiften/TLS/PlatformTLSFactories.h>
#include <Swiften/TLS/TLSOptions.h>
#include <Swiften/Network/DomainNameResolveError.h>
#include <Swiften/Network/DomainNameAddressQuery.h>
#include <Swiften/Network/DomainNameResolver.h>
#include <Swiften/Network/HostAddress.h>
#include <Swiften/Base/SafeByteArray.h>
#include "Swiften/Version.h"
#define HAVE_SWIFTEN_3 (SWIFTEN_VERSION >= 0x030000)
#if HAVE_SWIFTEN_3
#include <Swiften/TLS/TLSOptions.h>
#endif
#include <string>
#include <algorithm>