diff --git a/spectrum/src/frontends/slack/SlackRTM.cpp b/spectrum/src/frontends/slack/SlackRTM.cpp index 7e12f75475f4b889f865721c736331b2937a4496..1d12860ed8f0dfad20b3554a8461420644eef201 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 a6722ffbb16f8f2b59927ca8888ed624e8cb23c7..26b6c4bf839e9c93768ebfce26cf214527beea50 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