From 0a13c5f0ceb39bce48d7ff332cda945983e55f63 Mon Sep 17 00:00:00 2001 From: Jan Kaluza Date: Tue, 24 Nov 2015 12:42:46 +0100 Subject: [PATCH] Fix compilation with Swiften 2 --- spectrum/src/frontends/slack/SlackRTM.cpp | 7 +++++++ spectrum/src/frontends/slack/SlackRTM.h | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/spectrum/src/frontends/slack/SlackRTM.cpp b/spectrum/src/frontends/slack/SlackRTM.cpp index 7e12f754..1d12860e 100644 --- a/spectrum/src/frontends/slack/SlackRTM.cpp +++ b/spectrum/src/frontends/slack/SlackRTM.cpp @@ -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?"; diff --git a/spectrum/src/frontends/slack/SlackRTM.h b/spectrum/src/frontends/slack/SlackRTM.h index a6722ffb..26b6c4bf 100644 --- a/spectrum/src/frontends/slack/SlackRTM.h +++ b/spectrum/src/frontends/slack/SlackRTM.h @@ -26,12 +26,18 @@ #include #include #include -#include #include #include #include #include #include +#include "Swiften/Version.h" + +#define HAVE_SWIFTEN_3 (SWIFTEN_VERSION >= 0x030000) + +#if HAVE_SWIFTEN_3 +#include +#endif #include #include