From 3e1421a61a9e074b98cd8da8da4a159dc316e3a3 Mon Sep 17 00:00:00 2001 From: Sergei Ilinykh Date: Mon, 11 Mar 2024 17:16:27 +0300 Subject: [PATCH] Make iris usable after previous merge --- CMakeLists.txt | 112 +---------------- bundled.cmake | 2 + include/iris/xmpp_bytestream.h | 1 + include/iris/xmpp_form.h | 1 + src/irisnet/CMakeLists.txt | 47 ++++++- src/irisnet/noncore/cutestuff/bsocket.cpp | 4 + src/irisnet/noncore/cutestuff/bsocket.h | 2 +- src/irisnet/noncore/cutestuff/httppoll.cpp | 8 +- src/irisnet/noncore/cutestuff/socks.cpp | 3 + src/irisnet/noncore/iceabstractstundisco.h | 1 - src/irisnet/noncore/processquit.h | 2 +- src/xmpp/CMakeLists.txt | 140 +++++++++++++++++++-- src/xmpp/base/randomnumbergenerator.h | 3 +- src/xmpp/base/randrandomnumbergenerator.h | 2 +- src/xmpp/base/timezone.cpp | 73 +---------- src/xmpp/base/timezone.h | 2 + src/xmpp/xmpp-core/connector.cpp | 1 + src/xmpp/xmpp-core/xmpp.h | 5 +- src/xmpp/xmpp-im/im.h | 56 ++++----- src/xmpp/xmpp-im/jingle-connection.h | 2 +- src/xmpp/xmpp-im/jingle-ice.h | 4 +- src/xmpp/xmpp-im/jingle-s5b.h | 2 +- src/xmpp/xmpp-im/jingle.h | 2 +- src/xmpp/xmpp-im/s5b.h | 10 +- src/xmpp/xmpp-im/xmpp_address.h | 2 +- src/xmpp/xmpp-im/xmpp_bytestream.h | 2 +- src/xmpp/xmpp-im/xmpp_httpauthrequest.h | 2 +- src/xmpp/xmpp-im/xmpp_message.h | 2 +- src/xmpp/xmpp-im/xmpp_task.h | 2 +- 29 files changed, 249 insertions(+), 246 deletions(-) create mode 100644 bundled.cmake create mode 100644 include/iris/xmpp_bytestream.h create mode 100644 include/iris/xmpp_form.h diff --git a/CMakeLists.txt b/CMakeLists.txt index d680eabc..054ceeb4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,13 +59,15 @@ if(APPLE OR (MSVC OR USE_MXE)) set(IRIS_DEFAULT_BUNDLED_QCA ON) endif() -option(IRIS_ENABLE_INSTALL "Enable installation" OFF) +option(IRIS_ENABLE_INSTALL "Enable installation" ON) option(IRIS_ENABLE_JINGLE_SCTP "Enable SCTP over ICE Jingle transport / data channels" ON) option(IRIS_BUNDLED_QCA "Adds: DTLS, Blake2b and other useful for XMPP crypto-stuff" ${IRIS_DEFAULT_BUNDLED_QCA}) option(IRIS_BUNDLED_USRSCTP "Compile compatible UsrSCTP lib (required for datachannel Jingle transport)" ${IRIS_DEFAULT_BUNDLED_USRSCTP}) option(IRIS_BUILD_TOOLS "Build tools and examples" OFF) option(IRIS_ENABLE_DEBUG "Enable debugging code paths" OFF) +set(IRIS_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR}/xmpp/iris) + set(CMAKE_CXX_STANDARD 17) if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug" OR ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")) @@ -151,114 +153,6 @@ if(IRIS_ENABLE_INSTALL) DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig ) - set(IRISNET_CORELIB_HEADERS - src/irisnet/corelib/addressresolver.h - src/irisnet/corelib/irisnetexport.h - src/irisnet/corelib/irisnetglobal.h - src/irisnet/corelib/irisnetplugin.h - src/irisnet/corelib/netavailability.h - src/irisnet/corelib/netinterface.h - src/irisnet/corelib/netnames.h - src/irisnet/corelib/objectsession.h - ) - set(IRISNET_NONCORE_HEADERS - src/irisnet/noncore/cutestuff/bsocket.h - src/irisnet/noncore/cutestuff/bytestream.h - src/irisnet/noncore/cutestuff/httpconnect.h - src/irisnet/noncore/cutestuff/httppoll.h - src/irisnet/noncore/cutestuff/socks.h - src/irisnet/noncore/dtls.h - src/irisnet/noncore/ice176.h - src/irisnet/noncore/iceabstractstundisco.h - src/irisnet/noncore/iceagent.h - src/irisnet/noncore/legacy/ndns.h - src/irisnet/noncore/legacy/srvresolver.h - src/irisnet/noncore/processquit.h - src/irisnet/noncore/stunallocate.h - src/irisnet/noncore/stunbinding.h - src/irisnet/noncore/stunmessage.h - src/irisnet/noncore/stuntransaction.h - src/irisnet/noncore/tcpportreserver.h - src/irisnet/noncore/turnclient.h - src/irisnet/noncore/udpportreserver.h - ) - set(XMPP_JID_HEADERS - src/xmpp/jid/jid.h - ) - set(XMPP_CORE_HEADERS - src/xmpp/xmpp-core/xmpp.h - src/xmpp/xmpp-core/xmpp_clientstream.h - src/xmpp/xmpp-core/xmpp_stanza.h - src/xmpp/xmpp-core/xmpp_stream.h - ) - set(XMPP_IM_HEADERS - src/xmpp/xmpp-im/filetransfer.h - src/xmpp/xmpp-im/httpfileupload.h - src/xmpp/xmpp-im/im.h - src/xmpp/xmpp-im/jingle-application.h - src/xmpp/xmpp-im/jingle-ft.h - src/xmpp/xmpp-im/jingle-ice.h - src/xmpp/xmpp-im/jingle-nstransportslist.h - src/xmpp/xmpp-im/jingle-s5b.h - src/xmpp/xmpp-im/jingle-session.h - src/xmpp/xmpp-im/jingle-transport.h - src/xmpp/xmpp-im/jingle.h - src/xmpp/xmpp-im/s5b.h - src/xmpp/xmpp-im/xmpp_address.h - src/xmpp/xmpp-im/xmpp_agentitem.h - src/xmpp/xmpp-im/xmpp_bitsofbinary.h - src/xmpp/xmpp-im/xmpp_caps.h - src/xmpp/xmpp-im/xmpp_captcha.h - src/xmpp/xmpp-im/xmpp_chatstate.h - src/xmpp/xmpp-im/xmpp_client.h - src/xmpp/xmpp-im/xmpp_discoinfotask.h - src/xmpp/xmpp-im/xmpp_discoitem.h - src/xmpp/xmpp-im/xmpp_encryption.h - src/xmpp/xmpp-im/xmpp_encryptionhandler.h - src/xmpp/xmpp-im/xmpp_features.h - src/xmpp/xmpp-im/xmpp_hash.h - src/xmpp/xmpp-im/xmpp_htmlelement.h - src/xmpp/xmpp-im/xmpp_httpauthrequest.h - src/xmpp/xmpp-im/xmpp_liveroster.h - src/xmpp/xmpp-im/xmpp_liverosteritem.h - src/xmpp/xmpp-im/xmpp_message.h - src/xmpp/xmpp-im/xmpp_muc.h - src/xmpp/xmpp-im/xmpp_pubsubitem.h - src/xmpp/xmpp-im/xmpp_pubsubretraction.h - src/xmpp/xmpp-im/xmpp_reference.h - src/xmpp/xmpp-im/xmpp_resource.h - src/xmpp/xmpp-im/xmpp_resourcelist.h - src/xmpp/xmpp-im/xmpp_roster.h - src/xmpp/xmpp-im/xmpp_rosteritem.h - src/xmpp/xmpp-im/xmpp_rosterx.h - src/xmpp/xmpp-im/xmpp_serverinfomanager.h - src/xmpp/xmpp-im/xmpp_status.h - src/xmpp/xmpp-im/xmpp_subsets.h - src/xmpp/xmpp-im/xmpp_task.h - src/xmpp/xmpp-im/xmpp_tasks.h - src/xmpp/xmpp-im/xmpp_thumbs.h - src/xmpp/xmpp-im/xmpp_url.h - src/xmpp/xmpp-im/xmpp_vcard.h - src/xmpp/xmpp-im/xmpp_xdata.h - src/xmpp/xmpp-im/xmpp_xmlcommon.h - ) - - set(IRIS_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR}/xmpp/iris) - install(FILES ${IRISNET_CORELIB_HEADERS} - DESTINATION ${IRIS_INSTALL_INCLUDEDIR}/irisnet/corelib - ) - install(FILES ${IRISNET_NONCORE_HEADERS} - DESTINATION ${IRIS_INSTALL_INCLUDEDIR}/irisnet/noncore - ) - install(FILES ${XMPP_JID_HEADERS} - DESTINATION ${IRIS_INSTALL_INCLUDEDIR}/xmpp/jid - ) - install(FILES ${XMPP_CORE_HEADERS} - DESTINATION ${IRIS_INSTALL_INCLUDEDIR}/xmpp/xmpp-core - ) - install(FILES ${XMPP_IM_HEADERS} - DESTINATION ${IRIS_INSTALL_INCLUDEDIR}/xmpp/xmpp-im - ) install(DIRECTORY include/iris DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/xmpp FILES_MATCHING PATTERN "*.h" diff --git a/bundled.cmake b/bundled.cmake new file mode 100644 index 00000000..b9dc4842 --- /dev/null +++ b/bundled.cmake @@ -0,0 +1,2 @@ +set(IRIS_ENABLE_INSTALL OFF CACHE BOOL "Install iris headers" FORCE) +add_subdirectory( ${CMAKE_CURRENT_LIST_DIR} ) diff --git a/include/iris/xmpp_bytestream.h b/include/iris/xmpp_bytestream.h new file mode 100644 index 00000000..3afd0e3a --- /dev/null +++ b/include/iris/xmpp_bytestream.h @@ -0,0 +1 @@ +#include "xmpp/xmpp-im/xmpp_bytestream.h" diff --git a/include/iris/xmpp_form.h b/include/iris/xmpp_form.h new file mode 100644 index 00000000..cd320c78 --- /dev/null +++ b/include/iris/xmpp_form.h @@ -0,0 +1 @@ +#include "xmpp/xmpp-im/xmpp_form.h" diff --git a/src/irisnet/CMakeLists.txt b/src/irisnet/CMakeLists.txt index 3d3a1aa0..6fbf7a72 100644 --- a/src/irisnet/CMakeLists.txt +++ b/src/irisnet/CMakeLists.txt @@ -7,7 +7,41 @@ list(APPEND CMAKE_MODULE_PATH add_library(irisnet STATIC) +set(IRISNET_CORELIB_HEADERS + corelib/addressresolver.h + corelib/irisnetexport.h + corelib/irisnetglobal.h + corelib/irisnetplugin.h + corelib/netavailability.h + corelib/netinterface.h + corelib/netnames.h + corelib/objectsession.h +) +set(IRISNET_NONCORE_HEADERS + noncore/cutestuff/bsocket.h + noncore/cutestuff/bytestream.h + noncore/cutestuff/httpconnect.h + noncore/cutestuff/httppoll.h + noncore/cutestuff/socks.h + noncore/dtls.h + noncore/ice176.h + noncore/iceabstractstundisco.h + noncore/iceagent.h + noncore/legacy/ndns.h + noncore/legacy/srvresolver.h + noncore/processquit.h + noncore/stunallocate.h + noncore/stunbinding.h + noncore/stunmessage.h + noncore/stuntransaction.h + noncore/tcpportreserver.h + noncore/turnclient.h + noncore/udpportreserver.h +) + target_sources(irisnet PRIVATE + ${IRISNET_CORELIB_HEADERS} + ${IRISNET_NONCORE_HEADERS} corelib/irisnetglobal.cpp corelib/irisnetplugin.cpp @@ -72,8 +106,8 @@ endif() target_include_directories(irisnet PRIVATE - ${CMAKE_SOURCE_DIR}/include/iris - ${CMAKE_SOURCE_DIR}/src + ${iris_SOURCE_DIR}/include/iris + ${iris_SOURCE_DIR}/src ${Qca_INCLUDE_DIR} PUBLIC ${USRSCTP_INCLUDES} @@ -95,3 +129,12 @@ target_link_libraries(irisnet PUBLIC ${Qca_LIBRARY} ${USRSCTP_LIBRARY} Qt5::Core Qt5::Network Qt5::Xml ) + +if(IRIS_ENABLE_INSTALL) + install(FILES ${IRISNET_CORELIB_HEADERS} + DESTINATION ${IRIS_INSTALL_INCLUDEDIR}/irisnet/corelib + ) + install(FILES ${IRISNET_NONCORE_HEADERS} + DESTINATION ${IRIS_INSTALL_INCLUDEDIR}/irisnet/noncore + ) +endif() diff --git a/src/irisnet/noncore/cutestuff/bsocket.cpp b/src/irisnet/noncore/cutestuff/bsocket.cpp index cf91c3f8..a24ad6ec 100644 --- a/src/irisnet/noncore/cutestuff/bsocket.cpp +++ b/src/irisnet/noncore/cutestuff/bsocket.cpp @@ -20,9 +20,13 @@ #include "bsocket.h" +#include "netnames.h" + #include #include #include +#include + #include //#define BS_DEBUG diff --git a/src/irisnet/noncore/cutestuff/bsocket.h b/src/irisnet/noncore/cutestuff/bsocket.h index 079de448..17498585 100644 --- a/src/irisnet/noncore/cutestuff/bsocket.h +++ b/src/irisnet/noncore/cutestuff/bsocket.h @@ -22,7 +22,6 @@ #define CS_BSOCKET_H #include "bytestream.h" -#include "netnames.h" #include #include @@ -30,6 +29,7 @@ class QByteArray; class QObject; class QString; +class QTcpSocket; // CS_NAMESPACE_BEGIN /*! diff --git a/src/irisnet/noncore/cutestuff/httppoll.cpp b/src/irisnet/noncore/cutestuff/httppoll.cpp index 962a0e0c..b914f2bc 100644 --- a/src/irisnet/noncore/cutestuff/httppoll.cpp +++ b/src/irisnet/noncore/cutestuff/httppoll.cpp @@ -24,9 +24,11 @@ #include #include #include -#include -#include -#include +#include +#include +#include +#include + #ifdef PROX_DEBUG #include #endif diff --git a/src/irisnet/noncore/cutestuff/socks.cpp b/src/irisnet/noncore/cutestuff/socks.cpp index c8fc3799..6ccc625f 100644 --- a/src/irisnet/noncore/cutestuff/socks.cpp +++ b/src/irisnet/noncore/cutestuff/socks.cpp @@ -27,6 +27,9 @@ #include #include #include +#include +#include +#include //#define PROX_DEBUG #ifdef PROX_DEBUG diff --git a/src/irisnet/noncore/iceabstractstundisco.h b/src/irisnet/noncore/iceabstractstundisco.h index 8b625af2..f26ff9b6 100644 --- a/src/irisnet/noncore/iceabstractstundisco.h +++ b/src/irisnet/noncore/iceabstractstundisco.h @@ -6,7 +6,6 @@ #include #include -#include #include namespace XMPP { diff --git a/src/irisnet/noncore/processquit.h b/src/irisnet/noncore/processquit.h index 26cc3958..39d0e2d8 100644 --- a/src/irisnet/noncore/processquit.h +++ b/src/irisnet/noncore/processquit.h @@ -23,7 +23,7 @@ #include #define IRISNET_EXPORT #else -#include "irisnetglobal.h" +#include "../corelib/irisnetglobal.h" #endif #ifndef NO_IRISNET diff --git a/src/xmpp/CMakeLists.txt b/src/xmpp/CMakeLists.txt index 90ab90fc..ef1d4b81 100644 --- a/src/xmpp/CMakeLists.txt +++ b/src/xmpp/CMakeLists.txt @@ -4,7 +4,105 @@ find_package(ZLIB REQUIRED) add_library(iris) +set(XMPP_JID_HEADERS jid/jid.h) + +set(XMPP_CORE_HEADERS + xmpp-core/parser.h + xmpp-core/protocol.h + xmpp-core/sm.h + xmpp-core/td.h + xmpp-core/xmlprotocol.h + xmpp-core/xmpp_stanza.h + + xmpp-core/compressionhandler.h + xmpp-core/securestream.h + xmpp-core/xmpp.h + xmpp-core/xmpp_clientstream.h + xmpp-core/xmpp_stream.h +) + +set(XMPP_IM_HEADERS + xmpp-im/xmpp_address.h + xmpp-im/xmpp_hash.h + xmpp-im/xmpp_thumbs.h + xmpp-im/xmpp_agentitem.h + xmpp-im/xmpp_captcha.h + xmpp-im/xmpp_chatstate.h + xmpp-im/xmpp_discoitem.h + xmpp-im/xmpp_features.h + xmpp-im/xmpp_form.h + xmpp-im/xmpp_htmlelement.h + xmpp-im/xmpp_httpauthrequest.h + xmpp-im/xmpp_liveroster.h + xmpp-im/xmpp_liverosteritem.h + xmpp-im/xmpp_message.h + xmpp-im/xmpp_muc.h + xmpp-im/xmpp_reference.h + xmpp-im/xmpp_pubsubitem.h + xmpp-im/xmpp_pubsubretraction.h + xmpp-im/xmpp_receipts.h + xmpp-im/xmpp_resource.h + xmpp-im/xmpp_resourcelist.h + xmpp-im/xmpp_roster.h + xmpp-im/xmpp_rosteritem.h + xmpp-im/xmpp_rosterx.h + xmpp-im/xmpp_status.h + xmpp-im/xmpp_subsets.h + xmpp-im/xmpp_url.h + xmpp-im/xmpp_vcard.h + xmpp-im/xmpp_xdata.h + xmpp-im/xmpp_xmlcommon.h + xmpp-im/xmpp_encryption.h + xmpp-im/xmpp_externalservicediscovery.h + xmpp-im/stundisco.h + xmpp-im/im.h + xmpp-im/xmpp_caps.h + xmpp-im/filetransfer.h + xmpp-im/httpfileupload.h + xmpp-im/s5b.h + xmpp-im/xmpp_bitsofbinary.h + xmpp-im/xmpp_bytestream.h + xmpp-im/xmpp_client.h + xmpp-im/xmpp_discoinfotask.h + xmpp-im/xmpp_ibb.h + xmpp-im/xmpp_serverinfomanager.h + xmpp-im/xmpp_task.h + xmpp-im/xmpp_tasks.h + xmpp-im/jingle.h + xmpp-im/jingle-connection.h + xmpp-im/jingle-transport.h + xmpp-im/jingle-nstransportslist.h + xmpp-im/jingle-application.h + xmpp-im/jingle-session.h + xmpp-im/jingle-ft.h + xmpp-im/jingle-ice.h + xmpp-im/jingle-s5b.h + xmpp-im/jingle-ibb.h + xmpp-im/jingle-file.h + xmpp-im/jingle-sctp.h +) + +set(XMPP_HEADERS_PRIVATE + sasl/digestmd5proplist.h + sasl/digestmd5response.h + sasl/plainmessage.h + sasl/scramsha1message.h + sasl/scramsha1response.h + sasl/scramsha1signature.h + zlib/zlibcompressor.h + zlib/zlibdecompressor.h + blake2/blake2qt.h + + base/randomnumbergenerator.h + base/randrandomnumbergenerator.h + base/timezone.h +) + target_sources(iris PRIVATE + ${XMPP_JID_HEADERS} + ${XMPP_CORE_HEADERS} + ${XMPP_IM_HEADERS} + ${XMPP_HEADERS_PRIVATE} xmpp-core/compressionhandler.cpp xmpp-core/connector.cpp xmpp-core/parser.cpp @@ -79,7 +177,9 @@ if(IRIS_ENABLE_JINGLE_SCTP) target_sources(iris PRIVATE xmpp-im/jingle-sctp.cpp xmpp-im/jingle-sctp-association_p.cpp + xmpp-im/jingle-sctp-association_p.h xmpp-im/jingle-webrtc-datachannel_p.cpp + xmpp-im/jingle-webrtc-datachannel_p.h ) endif() @@ -118,11 +218,35 @@ endif() target_compile_definitions(iris PUBLIC IRISNET_STATIC) -target_include_directories(iris - PRIVATE - ${CMAKE_SOURCE_DIR}/include/iris - ${CMAKE_SOURCE_DIR}/src - ${Qca_INCLUDE_DIR} - PUBLIC - $ -) +if(IS_SUBPROJECT) + target_include_directories(iris + PUBLIC + ${iris_SOURCE_DIR}/include + ${iris_SOURCE_DIR}/src + ${Qca_INCLUDE_DIR} + ) + target_include_directories(iris + PRIVATE + ${iris_SOURCE_DIR}/include/iris + ) +else() + target_include_directories(iris + PRIVATE + ${iris_SOURCE_DIR}/include + ${iris_SOURCE_DIR}/src + ${Qca_INCLUDE_DIR} + ) +endif() +target_include_directories(iris PUBLIC $) + +if (IRIS_ENABLE_INSTALL) + install(FILES ${XMPP_JID_HEADERS} + DESTINATION ${IRIS_INSTALL_INCLUDEDIR}/xmpp/jid + ) + install(FILES ${XMPP_CORE_HEADERS} + DESTINATION ${IRIS_INSTALL_INCLUDEDIR}/xmpp/xmpp-core + ) + install(FILES ${XMPP_IM_HEADERS} + DESTINATION ${IRIS_INSTALL_INCLUDEDIR}/xmpp/xmpp-im + ) +endif() diff --git a/src/xmpp/base/randomnumbergenerator.h b/src/xmpp/base/randomnumbergenerator.h index 458fc138..a6e5f537 100644 --- a/src/xmpp/base/randomnumbergenerator.h +++ b/src/xmpp/base/randomnumbergenerator.h @@ -20,7 +20,8 @@ #define RANDOMNUMBERGENERATOR_H namespace XMPP { -class RandomNumberGenerator { + +class [[deprecated]] RandomNumberGenerator { public: virtual ~RandomNumberGenerator(); diff --git a/src/xmpp/base/randrandomnumbergenerator.h b/src/xmpp/base/randrandomnumbergenerator.h index 069db228..224bc277 100644 --- a/src/xmpp/base/randrandomnumbergenerator.h +++ b/src/xmpp/base/randrandomnumbergenerator.h @@ -24,7 +24,7 @@ #include namespace XMPP { -class RandRandomNumberGenerator : public RandomNumberGenerator { +class [[deprecated]] RandRandomNumberGenerator : public RandomNumberGenerator { public: RandRandomNumberGenerator() { } diff --git a/src/xmpp/base/timezone.cpp b/src/xmpp/base/timezone.cpp index e31aef61..c1b937c5 100644 --- a/src/xmpp/base/timezone.cpp +++ b/src/xmpp/base/timezone.cpp @@ -18,90 +18,19 @@ #include "timezone.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 2, 0) -#include -#include -#ifdef Q_OS_UNIX -#include -#endif -#ifdef Q_OS_WIN -#include -#endif -#else + #include -#endif #include -#if QT_VERSION < QT_VERSION_CHECK(5, 2, 0) -static bool inited = false; -static int timezone_offset_; -static QString timezone_str_; - -static void init() -{ -#if defined(Q_OS_UNIX) - time_t x; - time(&x); - char str[256]; - char fmt[32]; - int size; - strcpy(fmt, "%z"); - size = strftime(str, 256, fmt, localtime(&x)); - if (size && strncmp(fmt, str, size)) { - timezone_offset_ - = QByteArray::fromRawData(str + 1, 2).toInt() * 60 + QByteArray::fromRawData(str + 3, 2).toInt(); - if (str[0] == '-') - timezone_offset_ = -timezone_offset_; - } - strcpy(fmt, "%Z"); - strftime(str, 256, fmt, localtime(&x)); - if (strcmp(fmt, str)) - timezone_str_ = str; - -#elif defined(Q_OS_WIN) - TIME_ZONE_INFORMATION i; - memset(&i, 0, sizeof(i)); - bool inDST = (GetTimeZoneInformation(&i) == TIME_ZONE_ID_DAYLIGHT); - int bias = i.Bias; - if (inDST) - bias += i.DaylightBias; - timezone_offset_ = -bias; - timezone_str_ = ""; - for (int n = 0; n < 32; ++n) { - int w = inDST ? i.DaylightName[n] : i.StandardName[n]; - if (w == 0) - break; - timezone_str_ += QChar(w); - } - -#else - qWarning("Failed to properly init timezone data. Use UTC offset instead"); - inited = true; - timezone_offset_ = 0; - timezone_str_ = QLatin1String("N/A"); -#endif -} -#endif int TimeZone::offsetFromUtc() { -#if QT_VERSION < QT_VERSION_CHECK(5, 2, 0) - if (!inited) { - init(); - } - return timezone_offset_; -#else return QTimeZone::systemTimeZone().offsetFromUtc(QDateTime::currentDateTime()) / 60; -#endif } QString TimeZone::abbreviation() { -#if QT_VERSION < QT_VERSION_CHECK(5, 2, 0) - return timezone_str_; -#else return QTimeZone::systemTimeZone().abbreviation(QDateTime::currentDateTime()); -#endif } int TimeZone::tzdToInt(const QString &tzd) diff --git a/src/xmpp/base/timezone.h b/src/xmpp/base/timezone.h index 2a091c5a..6a20d9a8 100644 --- a/src/xmpp/base/timezone.h +++ b/src/xmpp/base/timezone.h @@ -19,6 +19,8 @@ #ifndef IRIS_TIMEZONE_H #define IRIS_TIMEZONE_H +// TODO <5.2.0 code was stripped away. remaining has to be put to some common utils + #include class TimeZone { diff --git a/src/xmpp/xmpp-core/connector.cpp b/src/xmpp/xmpp-core/connector.cpp index 2f4fc5e2..9fe4b7ff 100644 --- a/src/xmpp/xmpp-core/connector.cpp +++ b/src/xmpp/xmpp-core/connector.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include //#define XMPP_DEBUG diff --git a/src/xmpp/xmpp-core/xmpp.h b/src/xmpp/xmpp-core/xmpp.h index 8293ba99..70e058fb 100644 --- a/src/xmpp/xmpp-core/xmpp.h +++ b/src/xmpp/xmpp-core/xmpp.h @@ -20,11 +20,8 @@ #ifndef XMPP_H #define XMPP_H -#include "addressresolver.h" -#include "xmpp/jid/jid.h" +#include "iris/addressresolver.h" #include "xmpp_clientstream.h" -#include "xmpp_stanza.h" -#include "xmpp_stream.h" #include #include diff --git a/src/xmpp/xmpp-im/im.h b/src/xmpp/xmpp-im/im.h index 48438d13..e0f20d1b 100644 --- a/src/xmpp/xmpp-im/im.h +++ b/src/xmpp/xmpp-im/im.h @@ -20,33 +20,33 @@ #ifndef XMPP_IM_H #define XMPP_IM_H -#include "xmpp.h" -#include "xmpp/jid/jid.h" -#include "xmpp_address.h" -#include "xmpp_agentitem.h" -#include "xmpp_chatstate.h" -#include "xmpp_client.h" -#include "xmpp_discoitem.h" -#include "xmpp_features.h" -#include "xmpp_form.h" -#include "xmpp_hash.h" -#include "xmpp_htmlelement.h" -#include "xmpp_httpauthrequest.h" -#include "xmpp_liveroster.h" -#include "xmpp_liverosteritem.h" -#include "xmpp_message.h" -#include "xmpp_muc.h" -#include "xmpp_pubsubitem.h" -#include "xmpp_pubsubretraction.h" -#include "xmpp_resource.h" -#include "xmpp_resourcelist.h" -#include "xmpp_roster.h" -#include "xmpp_rosteritem.h" -#include "xmpp_rosterx.h" -#include "xmpp_status.h" -#include "xmpp_task.h" -#include "xmpp_thumbs.h" -#include "xmpp_url.h" -#include "xmpp_xdata.h" +#include "iris/xmpp.h" +#include "iris/xmpp_jid.h" +#include "iris/xmpp_address.h" +#include "iris/xmpp_agentitem.h" +#include "iris/xmpp_chatstate.h" +#include "iris/xmpp_client.h" +#include "iris/xmpp_discoitem.h" +#include "iris/xmpp_features.h" +#include "iris/xmpp_form.h" +#include "iris/xmpp_hash.h" +#include "iris/xmpp_htmlelement.h" +#include "iris/xmpp_httpauthrequest.h" +#include "iris/xmpp_liveroster.h" +#include "iris/xmpp_liverosteritem.h" +#include "iris/xmpp_message.h" +#include "iris/xmpp_muc.h" +#include "iris/xmpp_pubsubitem.h" +#include "iris/xmpp_pubsubretraction.h" +#include "iris/xmpp_resource.h" +#include "iris/xmpp_resourcelist.h" +#include "iris/xmpp_roster.h" +#include "iris/xmpp_rosteritem.h" +#include "iris/xmpp_rosterx.h" +#include "iris/xmpp_status.h" +#include "iris/xmpp_task.h" +#include "iris/xmpp_thumbs.h" +#include "iris/xmpp_url.h" +#include "iris/xmpp_xdata.h" #endif // XMPP_IM_H diff --git a/src/xmpp/xmpp-im/jingle-connection.h b/src/xmpp/xmpp-im/jingle-connection.h index 1fcbc0c9..ff6b9e44 100644 --- a/src/xmpp/xmpp-im/jingle-connection.h +++ b/src/xmpp/xmpp-im/jingle-connection.h @@ -25,7 +25,7 @@ * For example an ICE transport may have up to 65537 connections (65535 data/sctp-channels + 2 raw) */ -#include "bytestream.h" +#include "iris/bytestream.h" #include "jingle.h" #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) diff --git a/src/xmpp/xmpp-im/jingle-ice.h b/src/xmpp/xmpp-im/jingle-ice.h index e0752d60..65a3cab0 100644 --- a/src/xmpp/xmpp-im/jingle-ice.h +++ b/src/xmpp/xmpp-im/jingle-ice.h @@ -21,8 +21,8 @@ #define JINGLE_ICE_H #include "jingle-transport.h" -#include "tcpportreserver.h" -#include "xmpp.h" +#include "iris/tcpportreserver.h" +#include "iris/xmpp.h" class QHostAddress; diff --git a/src/xmpp/xmpp-im/jingle-s5b.h b/src/xmpp/xmpp-im/jingle-s5b.h index dad31f6f..dad9f65f 100644 --- a/src/xmpp/xmpp-im/jingle-s5b.h +++ b/src/xmpp/xmpp-im/jingle-s5b.h @@ -21,7 +21,7 @@ #define JINGLE_S5B_H #include "jingle-transport.h" -#include "tcpportreserver.h" +#include "iris/tcpportreserver.h" class QHostAddress; class SocksClient; diff --git a/src/xmpp/xmpp-im/jingle.h b/src/xmpp/xmpp-im/jingle.h index a5d79bf4..9cf66c21 100644 --- a/src/xmpp/xmpp-im/jingle.h +++ b/src/xmpp/xmpp-im/jingle.h @@ -20,7 +20,7 @@ #ifndef JINGLE_H #define JINGLE_H -#include "xmpp_stanza.h" +#include "iris/xmpp_stanza.h" #include #include diff --git a/src/xmpp/xmpp-im/s5b.h b/src/xmpp/xmpp-im/s5b.h index 18e875d8..2dd3fed1 100644 --- a/src/xmpp/xmpp-im/s5b.h +++ b/src/xmpp/xmpp-im/s5b.h @@ -20,16 +20,16 @@ #ifndef XMPP_S5B_H #define XMPP_S5B_H -#include "bytestream.h" +#include "iris/bytestream.h" #include "xmpp/jid/jid.h" -#include "xmpp_bytestream.h" -#include "xmpp_stanza.h" -#include "xmpp_task.h" +#include "iris/xmpp_bytestream.h" +#include "iris/xmpp_stanza.h" +#include "iris/xmpp_task.h" +#include "iris/tcpportreserver.h" #include #include #include -#include class SocksClient; class SocksUDP; diff --git a/src/xmpp/xmpp-im/xmpp_address.h b/src/xmpp/xmpp-im/xmpp_address.h index 60ce564d..7fd04ae2 100644 --- a/src/xmpp/xmpp-im/xmpp_address.h +++ b/src/xmpp/xmpp-im/xmpp_address.h @@ -20,7 +20,7 @@ #define XMPP_ADDRESS_H #include "xmpp/jid/jid.h" -#include "xmpp_stanza.h" +#include "iris/xmpp_stanza.h" #include diff --git a/src/xmpp/xmpp-im/xmpp_bytestream.h b/src/xmpp/xmpp-im/xmpp_bytestream.h index c805c8f4..d5c824a6 100644 --- a/src/xmpp/xmpp-im/xmpp_bytestream.h +++ b/src/xmpp/xmpp-im/xmpp_bytestream.h @@ -20,7 +20,7 @@ #ifndef BYTESTREAM_MANAGER_H #define BYTESTREAM_MANAGER_H -#include "bytestream.h" +#include "iris/bytestream.h" #include "xmpp/jid/jid.h" #include diff --git a/src/xmpp/xmpp-im/xmpp_httpauthrequest.h b/src/xmpp/xmpp-im/xmpp_httpauthrequest.h index 7756d9e5..882f7809 100644 --- a/src/xmpp/xmpp-im/xmpp_httpauthrequest.h +++ b/src/xmpp/xmpp-im/xmpp_httpauthrequest.h @@ -21,7 +21,7 @@ #include -#include "xmpp_stanza.h" +#include "iris/xmpp_stanza.h" class QDomDocument; class QDomElement; diff --git a/src/xmpp/xmpp-im/xmpp_message.h b/src/xmpp/xmpp-im/xmpp_message.h index da7b8ebb..52b058cd 100644 --- a/src/xmpp/xmpp-im/xmpp_message.h +++ b/src/xmpp/xmpp-im/xmpp_message.h @@ -25,7 +25,7 @@ #include "xmpp_receipts.h" #include "xmpp_reference.h" #include "xmpp_rosterx.h" -#include "xmpp_stanza.h" +#include "iris/xmpp_stanza.h" #include "xmpp_url.h" #include diff --git a/src/xmpp/xmpp-im/xmpp_task.h b/src/xmpp/xmpp-im/xmpp_task.h index 1fa60559..84f9f8d3 100644 --- a/src/xmpp/xmpp-im/xmpp_task.h +++ b/src/xmpp/xmpp-im/xmpp_task.h @@ -20,7 +20,7 @@ #ifndef XMPP_TASK_H #define XMPP_TASK_H -#include "xmpp_stanza.h" +#include "iris/xmpp_stanza.h" #include #include