From 0438b1318878d7f376a7ecaac6482131e1b051b6 Mon Sep 17 00:00:00 2001 From: Sergei Ilinykh Date: Thu, 14 Mar 2024 17:28:02 +0300 Subject: [PATCH] reformat code --- .pre-commit-config.yaml | 2 +- TODO | 1 - cmake/modules/FindQJDns.cmake | 6 +- cmake/modules/policyRules.cmake | 1 - conf_win.pri.example | 6 +- confapp_win.pri.example | 6 +- qcm/extra.qcm | 2 +- qcm/universal.qcm | 2 +- src/irisnet/appledns/appledns.cpp | 14 ++--- src/irisnet/appledns/qdnssd.cpp | 16 ++--- src/irisnet/appledns/sdtest.cpp | 2 +- src/irisnet/corelib/addressresolver.cpp | 4 +- src/irisnet/corelib/irisnetglobal.cpp | 2 +- src/irisnet/corelib/netinterface.cpp | 8 +-- src/irisnet/corelib/netinterface_unix.cpp | 4 +- src/irisnet/corelib/netnames.cpp | 9 ++- src/irisnet/corelib/netnames_jdns.cpp | 30 +++++----- src/irisnet/corelib/objectsession.cpp | 4 +- src/irisnet/noncore/cutestuff/bsocket.cpp | 2 +- src/irisnet/noncore/cutestuff/httpconnect.cpp | 4 +- src/irisnet/noncore/cutestuff/httppoll.cpp | 10 ++-- src/irisnet/noncore/cutestuff/socks.cpp | 12 ++-- src/irisnet/noncore/dtls.cpp | 6 +- src/irisnet/noncore/ice176.cpp | 12 ++-- src/irisnet/noncore/iceagent.h | 2 +- src/irisnet/noncore/icecomponent.cpp | 8 +-- src/irisnet/noncore/icelocaltransport.cpp | 12 ++-- src/irisnet/noncore/sctp/DepUsrSCTP.cpp | 6 +- src/irisnet/noncore/sctp/DepUsrSCTP.hpp | 8 +-- src/irisnet/noncore/sctp/SctpAssociation.cpp | 7 +-- src/irisnet/noncore/sctp/SctpAssociation.hpp | 4 +- src/irisnet/noncore/stunallocate.cpp | 14 ++--- src/irisnet/noncore/stunbinding.cpp | 2 +- src/irisnet/noncore/stunmessage.cpp | 2 +- src/irisnet/noncore/stunmessage.h | 4 +- src/irisnet/noncore/stuntransaction.cpp | 2 +- src/irisnet/noncore/tcpportreserver.h | 6 +- src/irisnet/noncore/turnclient.cpp | 8 +-- src/irisnet/noncore/udpportreserver.cpp | 2 +- src/jdns.cmake | 2 +- src/xmpp/base/timezone.cpp | 12 +--- src/xmpp/blake2/blake2-impl.h | 2 +- src/xmpp/blake2/blake2b-ref.c | 2 +- src/xmpp/blake2/blake2s-ref.c | 2 +- src/xmpp/jid/jid.h | 2 +- src/xmpp/qa/README | 6 +- src/xmpp/sasl/digestmd5response.cpp | 3 +- src/xmpp/sasl/scramsha1message.cpp | 3 +- src/xmpp/sasl/scramsha1response.cpp | 6 +- src/xmpp/sasl/scramsha1signature.cpp | 8 +-- .../sasl/unittest/digestmd5responsetest.cpp | 22 +++---- src/xmpp/xmpp-core/compressionhandler.h | 2 +- src/xmpp/xmpp-core/connector.cpp | 4 +- src/xmpp/xmpp-core/parser.cpp | 2 +- src/xmpp/xmpp-core/parser.h | 8 +-- src/xmpp/xmpp-core/protocol.cpp | 4 +- src/xmpp/xmpp-core/securestream.cpp | 8 +-- src/xmpp/xmpp-core/sm.h | 4 +- src/xmpp/xmpp-core/stream.cpp | 13 ++--- src/xmpp/xmpp-core/tlshandler.cpp | 4 +- src/xmpp/xmpp-core/xmpp_stanza.cpp | 2 +- src/xmpp/xmpp-im/client.cpp | 36 ++++++------ src/xmpp/xmpp-im/filetransfer.cpp | 8 +-- src/xmpp/xmpp-im/filetransfer.h | 2 +- src/xmpp/xmpp-im/httpfileupload.cpp | 9 ++- src/xmpp/xmpp-im/im.h | 2 +- src/xmpp/xmpp-im/jingle-application.cpp | 3 +- src/xmpp/xmpp-im/jingle-application.h | 2 +- src/xmpp/xmpp-im/jingle-connection.h | 4 +- src/xmpp/xmpp-im/jingle-file.h | 4 +- src/xmpp/xmpp-im/jingle-ft.cpp | 3 +- src/xmpp/xmpp-im/jingle-ft.h | 2 +- src/xmpp/xmpp-im/jingle-ibb.cpp | 8 +-- src/xmpp/xmpp-im/jingle-ibb.h | 4 +- src/xmpp/xmpp-im/jingle-ice.cpp | 6 +- src/xmpp/xmpp-im/jingle-ice.h | 10 ++-- src/xmpp/xmpp-im/jingle-nstransportslist.h | 2 +- src/xmpp/xmpp-im/jingle-s5b.cpp | 11 ++-- src/xmpp/xmpp-im/jingle-s5b.h | 14 ++--- src/xmpp/xmpp-im/jingle-sctp-association_p.h | 2 +- src/xmpp/xmpp-im/jingle-session.cpp | 6 +- src/xmpp/xmpp-im/jingle-session.h | 2 +- src/xmpp/xmpp-im/jingle-transport.h | 2 +- .../xmpp-im/jingle-webrtc-datachannel_p.cpp | 9 ++- .../xmpp-im/jingle-webrtc-datachannel_p.h | 2 +- src/xmpp/xmpp-im/jingle.cpp | 6 +- src/xmpp/xmpp-im/jingle.h | 23 ++++---- src/xmpp/xmpp-im/s5b.cpp | 58 +++++++++---------- src/xmpp/xmpp-im/s5b.h | 22 +++---- src/xmpp/xmpp-im/stundisco.cpp | 2 +- src/xmpp/xmpp-im/stundisco.h | 2 +- src/xmpp/xmpp-im/types.cpp | 9 ++- src/xmpp/xmpp-im/xmpp_address.h | 4 +- src/xmpp/xmpp-im/xmpp_agentitem.h | 8 +-- src/xmpp/xmpp-im/xmpp_bitsofbinary.cpp | 2 +- src/xmpp/xmpp-im/xmpp_bitsofbinary.h | 4 +- src/xmpp/xmpp-im/xmpp_caps.cpp | 2 +- src/xmpp/xmpp-im/xmpp_caps.h | 6 +- src/xmpp/xmpp-im/xmpp_captcha.h | 6 +- src/xmpp/xmpp-im/xmpp_client.h | 34 +++++------ src/xmpp/xmpp-im/xmpp_discoinfotask.h | 4 +- src/xmpp/xmpp-im/xmpp_discoitem.h | 8 +-- src/xmpp/xmpp-im/xmpp_encryption.h | 1 - .../xmpp-im/xmpp_externalservicediscovery.h | 4 +- src/xmpp/xmpp-im/xmpp_features.cpp | 2 +- src/xmpp/xmpp-im/xmpp_features.h | 4 +- src/xmpp/xmpp-im/xmpp_form.h | 2 +- src/xmpp/xmpp-im/xmpp_hash.cpp | 2 +- src/xmpp/xmpp-im/xmpp_ibb.cpp | 6 +- src/xmpp/xmpp-im/xmpp_ibb.h | 6 +- src/xmpp/xmpp-im/xmpp_liverosteritem.h | 4 +- src/xmpp/xmpp-im/xmpp_message.h | 2 +- src/xmpp/xmpp-im/xmpp_muc.h | 14 ++--- src/xmpp/xmpp-im/xmpp_pubsubitem.h | 2 +- src/xmpp/xmpp-im/xmpp_resource.h | 2 +- src/xmpp/xmpp-im/xmpp_rosteritem.h | 8 +-- src/xmpp/xmpp-im/xmpp_rosterx.h | 4 +- src/xmpp/xmpp-im/xmpp_serverinfomanager.h | 11 ++-- src/xmpp/xmpp-im/xmpp_status.h | 16 ++--- src/xmpp/xmpp-im/xmpp_task.cpp | 2 +- src/xmpp/xmpp-im/xmpp_task.h | 6 +- src/xmpp/xmpp-im/xmpp_tasks.h | 8 +-- src/xmpp/xmpp-im/xmpp_thumbs.h | 4 +- src/xmpp/xmpp-im/xmpp_vcard.cpp | 3 +- src/xmpp/xmpp-im/xmpp_vcard.h | 8 +-- src/xmpp/xmpp-im/xmpp_xdata.cpp | 6 +- src/xmpp/xmpp-im/xmpp_xdata.h | 4 +- src/xmpp/xmpp-im/xmpp_xmlcommon.cpp | 12 ++-- src/xmpp/zlib/zlibcompressor.h | 2 +- src/xmpp/zlib/zlibdecompressor.h | 2 +- tools/icetunnel/main.cpp | 8 +-- tools/nettool/main.cpp | 14 ++--- tools/xmpptest/xmpptest.cpp | 6 +- 133 files changed, 437 insertions(+), 464 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b454d589..57837bde 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks -exclude: '^3rdparty' +exclude: '^3rdparty|COPYING.*|src/jdns' repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v2.5.0 diff --git a/TODO b/TODO index 49de0c4d..6d522fd9 100644 --- a/TODO +++ b/TODO @@ -43,4 +43,3 @@ questions: goal: support xmpp-core for tcp/httpbind xmpp-core should be "just another protocol" - diff --git a/cmake/modules/FindQJDns.cmake b/cmake/modules/FindQJDns.cmake index 77568649..941e9ece 100644 --- a/cmake/modules/FindQJDns.cmake +++ b/cmake/modules/FindQJDns.cmake @@ -36,13 +36,13 @@ endif () if ( UNIX AND NOT( APPLE OR CYGWIN ) ) find_package( PkgConfig QUIET ) pkg_check_modules( PC_QJDns QUIET jdns ) - set ( QJDns_DEFINITIONS + set ( QJDns_DEFINITIONS ${PC_QJDns_CFLAGS} ${PC_QJDns_CFLAGS_OTHER} ) endif ( UNIX AND NOT( APPLE OR CYGWIN ) ) -set ( LIBINCS +set ( LIBINCS qjdns.h ) @@ -69,7 +69,7 @@ set(QJDns_NAMES find_library( QJDns_LIBRARY NAMES ${QJDns_NAMES} - HINTS + HINTS ${PC_QJDns_LIBDIR} ${PC_QJDns_LIBRARY_DIRS} ${QJDNS_DIR}/lib diff --git a/cmake/modules/policyRules.cmake b/cmake/modules/policyRules.cmake index df9d386c..081ab755 100644 --- a/cmake/modules/policyRules.cmake +++ b/cmake/modules/policyRules.cmake @@ -11,4 +11,3 @@ if(NOT POLICY_SET) endif() set(POLICY_SET ON) endif() - diff --git a/conf_win.pri.example b/conf_win.pri.example index e80c1b35..c8ad428b 100644 --- a/conf_win.pri.example +++ b/conf_win.pri.example @@ -9,9 +9,9 @@ LIBS += -L$$WINLOCAL_PREFIX/lib # zlib may have a different lib name depending on how it was compiled win32-g++ { - LIBS += -lz + LIBS += -lz } else { - LIBS += -lzlib # static - #LIBS += -lzdll # dll + LIBS += -lzlib # static + #LIBS += -lzdll # dll } diff --git a/confapp_win.pri.example b/confapp_win.pri.example index e80c1b35..c8ad428b 100644 --- a/confapp_win.pri.example +++ b/confapp_win.pri.example @@ -9,9 +9,9 @@ LIBS += -L$$WINLOCAL_PREFIX/lib # zlib may have a different lib name depending on how it was compiled win32-g++ { - LIBS += -lz + LIBS += -lz } else { - LIBS += -lzlib # static - #LIBS += -lzdll # dll + LIBS += -lzlib # static + #LIBS += -lzdll # dll } diff --git a/qcm/extra.qcm b/qcm/extra.qcm index 0ad08253..bf73ff86 100644 --- a/qcm/extra.qcm +++ b/qcm/extra.qcm @@ -58,7 +58,7 @@ public: } if (universal) { str += "contains(QT_CONFIG,x86):contains(QT_CONFIG,ppc) {\n" - " CONFIG += x86 ppc\n" + " CONFIG += x86 ppc\n" "}\n"; if (!sdk.isEmpty()) diff --git a/qcm/universal.qcm b/qcm/universal.qcm index 5a97c987..dcfa9b62 100644 --- a/qcm/universal.qcm +++ b/qcm/universal.qcm @@ -28,7 +28,7 @@ public: qc_universal_enabled = true; QString str = "contains(QT_CONFIG,x86):contains(QT_CONFIG,ppc) {\n" - " CONFIG += x86 ppc\n" + " CONFIG += x86 ppc\n" "}\n"; QString sdk = qc_getenv("QC_MAC_SDK"); diff --git a/src/irisnet/appledns/appledns.cpp b/src/irisnet/appledns/appledns.cpp index a84af2dd..80c3cbc0 100644 --- a/src/irisnet/appledns/appledns.cpp +++ b/src/irisnet/appledns/appledns.cpp @@ -223,8 +223,8 @@ class AppleProvider : public XMPP::IrisNetProvider { connect(&dns, SIGNAL(regResult(int, QDnsSd::RegResult)), SLOT(dns_regResult(int, QDnsSd::RegResult))); } - virtual XMPP::NameProvider * createNameProviderInternet(); - virtual XMPP::NameProvider * createNameProviderLocal(); + virtual XMPP::NameProvider *createNameProviderInternet(); + virtual XMPP::NameProvider *createNameProviderLocal(); virtual XMPP::ServiceProvider *createServiceProvider(); int query(QDnsSdDelegate *p, const QByteArray &name, int qType) @@ -300,7 +300,7 @@ private slots: class AppleBrowse : public QObject, public QDnsSdDelegate { Q_OBJECT public: - AppleProvider * global; + AppleProvider *global; int browse_id; QList instances; QHash pendingByQueryId; // waiting for TXT @@ -421,7 +421,7 @@ class AppleBrowse : public QObject, public QDnsSdDelegate { class AppleBrowseLookup : public QObject, public QDnsSdDelegate { Q_OBJECT public: - AppleProvider * global; + AppleProvider *global; int resolve_id; XMPP::NameResolver nameResolverAaaa; XMPP::NameResolver nameResolverA; @@ -614,7 +614,7 @@ class AppleServiceProvider : public XMPP::ServiceProvider, public QDnsSdDelegate public: AppleServiceProvider *parent; int id; - AppleBrowse * browse; + AppleBrowse *browse; Browse(AppleServiceProvider *_parent) : parent(_parent), id(-1), browse(0) { } @@ -629,7 +629,7 @@ class AppleServiceProvider : public XMPP::ServiceProvider, public QDnsSdDelegate public: AppleServiceProvider *parent; int id; - AppleBrowseLookup * resolve; + AppleBrowseLookup *resolve; Resolve(AppleServiceProvider *_parent) : parent(_parent), id(-1), resolve(0) { } @@ -640,7 +640,7 @@ class AppleServiceProvider : public XMPP::ServiceProvider, public QDnsSdDelegate } }; - AppleProvider * global; + AppleProvider *global; QList browseList; QList resolveList; IdManager idManager; diff --git a/src/irisnet/appledns/qdnssd.cpp b/src/irisnet/appledns/qdnssd.cpp index 7c2816e8..abbb4e28 100644 --- a/src/irisnet/appledns/qdnssd.cpp +++ b/src/irisnet/appledns/qdnssd.cpp @@ -176,12 +176,12 @@ class IdManager { class QDnsSd::Private : public QObject { Q_OBJECT public: - QDnsSd * q; + QDnsSd *q; IdManager idManager; class SubRecord { public: - Private * _self; + Private *_self; int _id; RecordRef *_sdref; @@ -198,13 +198,13 @@ class QDnsSd::Private : public QObject { public: enum Type { Query, Browse, Resolve, Reg }; - Private * _self; + Private *_self; int _type; int _id; - ServiceRef * _sdref; + ServiceRef *_sdref; int _sockfd; SafeSocketNotifier *_sn_read; - SafeTimer * _errorTrigger; + SafeTimer *_errorTrigger; bool _doSignal; LowLevelError _lowLevelError; @@ -522,7 +522,7 @@ private slots: void sn_activated() { SafeSocketNotifier *sn_read = static_cast(sender()); - Request * req = _requestsBySocket.value(sn_read); + Request *req = _requestsBySocket.value(sn_read); if (!req) return; @@ -627,7 +627,7 @@ private slots: void doError() { SafeTimer *t = static_cast(sender()); - Request * req = _requestsByTimer.value(t); + Request *req = _requestsByTimer.value(t); if (!req) return; @@ -886,7 +886,7 @@ QList QDnsSd::parseTxtRecord(const QByteArray &txtRecord) for (int n = 0; n < count; ++n) { QByteArray keyBuf(256, 0); uint8_t valueLen; - const void * value; + const void *value; DNSServiceErrorType err = TXTRecordGetItemAtIndex(txtRecord.size(), txtRecord.data(), n, keyBuf.size(), keyBuf.data(), &valueLen, &value); if (err != kDNSServiceErr_NoError) diff --git a/src/irisnet/appledns/sdtest.cpp b/src/irisnet/appledns/sdtest.cpp index a9363aca..058c49f9 100644 --- a/src/irisnet/appledns/sdtest.cpp +++ b/src/irisnet/appledns/sdtest.cpp @@ -105,7 +105,7 @@ class App : public QObject { Q_OBJECT public: QList commands; - QDnsSd * dns; + QDnsSd *dns; App() { diff --git a/src/irisnet/corelib/addressresolver.cpp b/src/irisnet/corelib/addressresolver.cpp index ac4e9d37..98c4e961 100644 --- a/src/irisnet/corelib/addressresolver.cpp +++ b/src/irisnet/corelib/addressresolver.cpp @@ -28,7 +28,7 @@ class AddressResolver::Private : public QObject { public: enum State { AddressWait, AddressFirstCome }; - AddressResolver * q; + AddressResolver *q; ObjectSession sess; State state; NameResolver req6; @@ -37,7 +37,7 @@ class AddressResolver::Private : public QObject { bool done4; QList addrs6; QList addrs4; - QTimer * opTimer; + QTimer *opTimer; Private(AddressResolver *_q) : QObject(_q), q(_q), sess(this), req6(this), req4(this) { diff --git a/src/irisnet/corelib/irisnetglobal.cpp b/src/irisnet/corelib/irisnetglobal.cpp index 433a40df..91ebf346 100644 --- a/src/irisnet/corelib/irisnetglobal.cpp +++ b/src/irisnet/corelib/irisnetglobal.cpp @@ -42,7 +42,7 @@ extern IrisNetProvider *irisnet_createAppleProvider(); class PluginInstance { private: QPluginLoader *_loader = nullptr; - QObject * _instance = nullptr; + QObject *_instance = nullptr; bool _ownInstance = false; PluginInstance() { } diff --git a/src/irisnet/corelib/netinterface.cpp b/src/irisnet/corelib/netinterface.cpp index 860e6d6b..0ceea7ed 100644 --- a/src/irisnet/corelib/netinterface.cpp +++ b/src/irisnet/corelib/netinterface.cpp @@ -88,7 +88,7 @@ private slots: private: // this are all protected by m - NetInterfaceProvider * c; + NetInterfaceProvider *c; QMutex m; QList info; }; @@ -172,11 +172,11 @@ class NetTrackerThread : public QThread { private: QWaitCondition startCond; - QMutex * startMutex = nullptr; + QMutex *startMutex = nullptr; // these are all protected by global nettracker_mutex. int refs = 0; static NetTrackerThread *self; - NetTracker * nettracker = nullptr; + NetTracker *nettracker = nullptr; }; NetTrackerThread *NetTrackerThread::self = nullptr; @@ -250,7 +250,7 @@ class NetInterfaceManagerPrivate : public QObject { QList info; QList listeners; - NetTrackerThread * tracker; + NetTrackerThread *tracker; bool pending; diff --git a/src/irisnet/corelib/netinterface_unix.cpp b/src/irisnet/corelib/netinterface_unix.cpp index 8f55aa92..7d5b4d99 100644 --- a/src/irisnet/corelib/netinterface_unix.cpp +++ b/src/irisnet/corelib/netinterface_unix.cpp @@ -74,7 +74,7 @@ static QHostAddress linux_ipv6_to_qaddr(const QString &in) quint8 raw[16]; for (int n = 0; n < 16; ++n) { bool ok; - int x = QStringView{in}.mid(n * 2, 2).toInt(&ok, 16); + int x = QStringView { in }.mid(n * 2, 2).toInt(&ok, 16); if (!ok) return out; raw[n] = (quint8)x; @@ -92,7 +92,7 @@ static QHostAddress linux_ipv4_to_qaddr(const QString &in) unsigned char *rawp = (unsigned char *)&raw; for (int n = 0; n < 4; ++n) { bool ok; - int x = QStringView{in}.mid(n * 2, 2).toInt(&ok, 16); + int x = QStringView { in }.mid(n * 2, 2).toInt(&ok, 16); if (!ok) return out; rawp[n] = (unsigned char)x; diff --git a/src/irisnet/corelib/netnames.cpp b/src/irisnet/corelib/netnames.cpp index dc0bfc67..ed6b23b1 100644 --- a/src/irisnet/corelib/netnames.cpp +++ b/src/irisnet/corelib/netnames.cpp @@ -28,7 +28,7 @@ #endif #include -//#define NETNAMES_DEBUG +// #define NETNAMES_DEBUG #ifdef NETNAMES_DEBUG #define NNDEBUG (qDebug() << this << "#" << __FUNCTION__ << ":") #endif @@ -308,8 +308,8 @@ QDebug operator<<(QDebug dbg, XMPP::NameRecord::Type type) QDebug operator<<(QDebug dbg, const XMPP::NameRecord &record) { - dbg.nospace() << "XMPP::NameRecord(" - << "owner=" << record.owner() << ", ttl=" << record.ttl() << ", type=" << record.type(); + dbg.nospace() << "XMPP::NameRecord(" << "owner=" << record.owner() << ", ttl=" << record.ttl() + << ", type=" << record.type(); switch (record.type()) { case XMPP::NameRecord::A: @@ -362,8 +362,7 @@ class ServiceInstance::Private : public QSharedData { ServiceInstance::ServiceInstance() : d(new Private) { } ServiceInstance::ServiceInstance(const QString &instance, const QString &type, const QString &domain, - const QMap &attribs) : - d(new Private) + const QMap &attribs) : d(new Private) { d->instance = instance; d->type = type; diff --git a/src/irisnet/corelib/netnames_jdns.cpp b/src/irisnet/corelib/netnames_jdns.cpp index b5ce899a..e1d27cdf 100644 --- a/src/irisnet/corelib/netnames_jdns.cpp +++ b/src/irisnet/corelib/netnames_jdns.cpp @@ -21,7 +21,7 @@ #include "objectsession.h" #include "qjdnsshared.h" -//#define JDNS_DEBUG +// #define JDNS_DEBUG Q_DECLARE_METATYPE(XMPP::NameRecord) // Q_DECLARE_METATYPE(XMPP::NameResolver::Error) @@ -237,11 +237,11 @@ class JDnsGlobal : public QObject { public: QJDnsSharedDebug db; - QJDnsShared * uni_net, *uni_local, *mul; + QJDnsShared *uni_net, *uni_local, *mul; QHostAddress mul_addr4, mul_addr6; NetInterfaceManager netman; QList ifaces; - QTimer * updateTimer; + QTimer *updateTimer; JDnsGlobal() { @@ -424,7 +424,7 @@ class JDnsNameProvider : public NameProvider { public: enum Mode { Internet, Local }; - JDnsGlobal * global; + JDnsGlobal *global; Mode mode; IdManager idman; ObjectSession sess; @@ -637,7 +637,7 @@ private slots: void req_resultsReady() { QJDnsSharedRequest *req = static_cast(sender()); - Item * i = getItemByReq(req); + Item *i = getItemByReq(req); Q_ASSERT(i); int id = i->id; @@ -834,7 +834,7 @@ class JDnsServiceResolve : public QObject { QJDnsSharedRequest req6; // for AAAA bool haveTxt; SrvState srvState; - QTimer * opTimer; + QTimer *opTimer; // out QList attribs; @@ -1344,7 +1344,7 @@ class JDnsPublishExtra : public QObject { private: friend class JDnsPublish; - JDnsPublish * jdnsPub; + JDnsPublish *jdnsPub; bool started; QJDnsSharedRequest pub; QJDns::Record rec; @@ -1369,7 +1369,7 @@ class JDnsPublish : public QObject { Q_OBJECT public: - QJDnsShared * jdns; + QJDnsShared *jdns; QJDnsSharedRequest pub_srv; QJDnsSharedRequest pub_txt; QJDnsSharedRequest pub_ptr; @@ -1652,7 +1652,7 @@ private slots: void pub_extra_ready() { QJDnsSharedRequest *req = static_cast(sender()); - JDnsPublishExtra * extra = 0; + JDnsPublishExtra *extra = 0; for (JDnsPublishExtra *e : extraList) { if (&e->pub == req) { extra = e; @@ -1711,7 +1711,7 @@ class BrowseItem { public: const int id; JDnsBrowse *const browse; - ObjectSession * sess; + ObjectSession *sess; BrowseItem(int _id, JDnsBrowse *_browse) : id(_id), browse(_browse), sess(0) { } @@ -1760,7 +1760,7 @@ class ResolveItem { public: const int id; JDnsServiceResolve *const resolve; - ObjectSession * sess; + ObjectSession *sess; ResolveItem(int _id, JDnsServiceResolve *_resolve) : id(_id), resolve(_resolve), sess(0) { } @@ -1809,7 +1809,7 @@ class PublishItem { public: const int id; JDnsPublish *const publish; - ObjectSession * sess; + ObjectSession *sess; PublishItem(int _id, JDnsPublish *_publish) : id(_id), publish(_publish), sess(0) { } @@ -1860,7 +1860,7 @@ class PublishExtraItem { public: const int id; JDnsPublishExtra *const publish; - ObjectSession * sess; + ObjectSession *sess; PublishExtraItem(int _id, JDnsPublishExtra *_publish) : id(_id), publish(_publish), sess(0) { } @@ -2240,7 +2240,7 @@ private slots: void jr_finished() { JDnsServiceResolve *jr = static_cast(sender()); - ResolveItem * i = resolveItemList.itemByResolve(jr); + ResolveItem *i = resolveItemList.itemByResolve(jr); Q_ASSERT(i); // parse TXT list into attribute map @@ -2289,7 +2289,7 @@ private slots: void jr_error(QJDnsSharedRequest::Error e) { JDnsServiceResolve *jr = static_cast(sender()); - ResolveItem * i = resolveItemList.itemByResolve(jr); + ResolveItem *i = resolveItemList.itemByResolve(jr); Q_ASSERT(i); ServiceResolver::Error err; diff --git a/src/irisnet/corelib/objectsession.cpp b/src/irisnet/corelib/objectsession.cpp index e328ff80..b3ee2d30 100644 --- a/src/irisnet/corelib/objectsession.cpp +++ b/src/irisnet/corelib/objectsession.cpp @@ -39,7 +39,7 @@ class ObjectSessionPrivate : public QObject { class MethodCall { public: - QObject * obj; + QObject *obj; QByteArray method; class Argument { public: @@ -93,7 +93,7 @@ class ObjectSessionPrivate : public QObject { }; QList pendingCalls; - QTimer * callTrigger; + QTimer *callTrigger; bool paused; QList watchers; diff --git a/src/irisnet/noncore/cutestuff/bsocket.cpp b/src/irisnet/noncore/cutestuff/bsocket.cpp index a24ad6ec..2c487c28 100644 --- a/src/irisnet/noncore/cutestuff/bsocket.cpp +++ b/src/irisnet/noncore/cutestuff/bsocket.cpp @@ -29,7 +29,7 @@ #include -//#define BS_DEBUG +// #define BS_DEBUG #ifdef BS_DEBUG #define BSDEBUG (qDebug() << this << "#" << __FUNCTION__ << ":") #endif diff --git a/src/irisnet/noncore/cutestuff/httpconnect.cpp b/src/irisnet/noncore/cutestuff/httpconnect.cpp index ea1f064b..dbf8c3c8 100644 --- a/src/irisnet/noncore/cutestuff/httpconnect.cpp +++ b/src/irisnet/noncore/cutestuff/httpconnect.cpp @@ -25,7 +25,7 @@ #include #include -//#define PROX_DEBUG +// #define PROX_DEBUG #ifdef PROX_DEBUG #include #endif @@ -80,7 +80,7 @@ static bool extractMainHeader(const QString &line, QString *proto, int *code, QS if (n2 == -1) return false; if (code) - *code = QStringView{line}.mid(n, n2 - n).toInt(); + *code = QStringView { line }.mid(n, n2 - n).toInt(); n = n2 + 1; if (msg) *msg = line.mid(n); diff --git a/src/irisnet/noncore/cutestuff/httppoll.cpp b/src/irisnet/noncore/cutestuff/httppoll.cpp index ab3a2c3c..54ecffff 100644 --- a/src/irisnet/noncore/cutestuff/httppoll.cpp +++ b/src/irisnet/noncore/cutestuff/httppoll.cpp @@ -22,12 +22,12 @@ #include "bsocket.h" #include -#include -#include -#include #include +#include #include #include +#include +#include #ifdef PROX_DEBUG #include @@ -408,7 +408,7 @@ static bool extractMainHeader(const QString &line, QString *proto, int *code, QS if (n2 == -1) return false; if (code) - *code = QStringView{line}.mid(n, n2 - n).toInt(); + *code = QStringView { line }.mid(n, n2 - n).toInt(); n = n2 + 1; if (msg) *msg = line.mid(n); @@ -431,7 +431,7 @@ class HttpProxyPost::Private { bool asProxy; bool useSsl; QString host; - QCA::TLS * tls; + QCA::TLS *tls; }; HttpProxyPost::HttpProxyPost(QObject *parent) : QObject(parent) diff --git a/src/irisnet/noncore/cutestuff/socks.cpp b/src/irisnet/noncore/cutestuff/socks.cpp index 6ccc625f..0dec764a 100644 --- a/src/irisnet/noncore/cutestuff/socks.cpp +++ b/src/irisnet/noncore/cutestuff/socks.cpp @@ -26,12 +26,12 @@ #include #include #include +#include +#include #include #include -#include -#include -//#define PROX_DEBUG +// #define PROX_DEBUG #ifdef PROX_DEBUG #include #endif @@ -58,7 +58,7 @@ class SocksUDP::Private { public: - QUdpSocket * sd; + QUdpSocket *sd; SocksClient *sc; QHostAddress routeAddr; quint16 routePort; @@ -963,9 +963,9 @@ SocksUDP *SocksClient::createUDP(const QString &host, int port, const QHostAddre //---------------------------------------------------------------------------- class SocksServer::Private { public: - QTcpServer * serv = nullptr; + QTcpServer *serv = nullptr; QList incomingConns; - QUdpSocket * sd = nullptr; + QUdpSocket *sd = nullptr; }; SocksServer::SocksServer(QObject *parent) : QObject(parent) { d = new Private; } diff --git a/src/irisnet/noncore/dtls.cpp b/src/irisnet/noncore/dtls.cpp index 0efc16d5..5816dd12 100644 --- a/src/irisnet/noncore/dtls.cpp +++ b/src/irisnet/noncore/dtls.cpp @@ -62,7 +62,7 @@ bool Dtls::FingerPrint::parse(const QDomElement &el) qPrintable(ns())); } auto ht = el.attribute(QLatin1String("hash")); - hash = QStringView{ht}; + hash = QStringView { ht }; hash.setData(QByteArray::fromHex(el.text().toLatin1())); auto setupIt = std::find(fpRoles.begin(), fpRoles.end(), el.attribute(QLatin1String("setup")).toLatin1()); setup = Setup(setupIt == fpRoles.end() ? NotSet : std::distance(fpRoles.begin(), setupIt) + 1); @@ -94,8 +94,8 @@ QDomElement Dtls::FingerPrint::toXml(QDomDocument *doc) const class Dtls::Private : public QObject { Q_OBJECT public: - Dtls * q; - QCA::TLS * tls = nullptr; + Dtls *q; + QCA::TLS *tls = nullptr; QCA::PrivateKey pkey; QCA::Certificate cert; diff --git a/src/irisnet/noncore/ice176.cpp b/src/irisnet/noncore/ice176.cpp index a1fb2a3f..387aa3b1 100644 --- a/src/irisnet/noncore/ice176.cpp +++ b/src/irisnet/noncore/ice176.cpp @@ -189,7 +189,7 @@ class Ice176::Private : public QObject { class Component { public: int id = 0; - IceComponent * ic = nullptr; + IceComponent *ic = nullptr; std::unique_ptr nominationTimer = std::unique_ptr(); CandidatePair::Ptr selectedPair; // final selected pair. won't be changed CandidatePair::Ptr highestPair; // current highest priority pair to send data @@ -203,12 +203,12 @@ class Ice176::Private : public QObject { bool nominating = false; // with aggressive nomination it's always false }; - Ice176 * q; + Ice176 *q; Ice176::Mode mode; State state = Stopped; QTimer checkTimer; TurnClient::Proxy proxy; - UdpPortReserver * portReserver = nullptr; + UdpPortReserver *portReserver = nullptr; std::unique_ptr pacTimer; int nominationTimeout = 3000; // 3s int pacTimeout = 30000; // 30s todo: compute from rto. see draft-ietf-ice-pac-06 @@ -663,7 +663,7 @@ class Ice176::Private : public QObject { pair->binding->start(); } - void doPairing(const QList & localCandidates, + void doPairing(const QList &localCandidates, const QList &remoteCandidates) { QList> pairs; @@ -918,7 +918,7 @@ class Ice176::Private : public QObject { [&](auto const &p) { return *(p->local) == locCand.info && *(p->remote) == remCand; }); CandidatePair::Ptr pair = (it == checkList.pairs.end()) ? CandidatePair::Ptr() : *it; - Component & component = *findComponent(locCand.info->componentId); + Component &component = *findComponent(locCand.info->componentId); qint64 minPriority = component.highestPair ? component.highestPair->priority : 0; if (pair) { if (pair->priority < minPriority) { @@ -1494,7 +1494,7 @@ private slots: StunMessage::ConvertResult result; StunMessage msg = StunMessage::fromBinary(buf, &result, - StunMessage::MessageIntegrity | StunMessage::Fingerprint, reqkey); + StunMessage::MessageIntegrity | StunMessage::Fingerprint, reqkey); if (!msg.isNull() && (msg.mclass() == StunMessage::Request || msg.mclass() == StunMessage::Indication)) { iceDebug("received validated request or indication from %s", qPrintable(fromAddr)); QString user = QString::fromUtf8(msg.attribute(StunTypes::USERNAME)); diff --git a/src/irisnet/noncore/iceagent.h b/src/irisnet/noncore/iceagent.h index bd2566d8..4042d594 100644 --- a/src/irisnet/noncore/iceagent.h +++ b/src/irisnet/noncore/iceagent.h @@ -15,7 +15,7 @@ class IceAgent : public QObject { ~IceAgent(); QString foundation(IceComponent::CandidateType type, const QHostAddress baseAddr, - const QHostAddress & stunServAddr = QHostAddress(), + const QHostAddress &stunServAddr = QHostAddress(), QAbstractSocket::SocketType stunRequestProto = QAbstractSocket::UnknownSocketType); static QString randomCredential(int len); diff --git a/src/irisnet/noncore/icecomponent.cpp b/src/irisnet/noncore/icecomponent.cpp index 563f8da9..5f2cedd3 100644 --- a/src/irisnet/noncore/icecomponent.cpp +++ b/src/irisnet/noncore/icecomponent.cpp @@ -69,7 +69,7 @@ class IceComponent::Private : public QObject { class LocalTransport { public: - QUdpSocket * qsock; + QUdpSocket *qsock; QHostAddress addr; QSharedPointer sock; int network; @@ -88,12 +88,12 @@ class IceComponent::Private : public QObject { } }; - IceComponent * q; + IceComponent *q; ObjectSession sess; int id; QString clientSoftware; TurnClient::Proxy proxy; - UdpPortReserver * portReserver = nullptr; + UdpPortReserver *portReserver = nullptr; Config pending; Config config; bool stopping = false; @@ -726,7 +726,7 @@ private slots: ci->base = ci->addr; ci->network = 0; // not relevant ci->foundation = IceAgent::instance()->foundation(RelayedType, ci->base.addr, config.stunRelayTcpAddr.addr, - QAbstractSocket::TcpSocket); + QAbstractSocket::TcpSocket); Candidate c; c.id = getId(); diff --git a/src/irisnet/noncore/icelocaltransport.cpp b/src/irisnet/noncore/icelocaltransport.cpp index fdb27543..b0eb4870 100644 --- a/src/irisnet/noncore/icelocaltransport.cpp +++ b/src/irisnet/noncore/icelocaltransport.cpp @@ -44,7 +44,7 @@ class SafeUdpSocket : public QObject { private: ObjectSession sess; - QUdpSocket * sock; + QUdpSocket *sock; int writtenCount; public: @@ -149,13 +149,13 @@ class IceLocalTransport::Private : public QObject { QByteArray buf; }; - IceLocalTransport * q; + IceLocalTransport *q; ObjectSession sess; - QUdpSocket * extSock = nullptr; - SafeUdpSocket * sock = nullptr; + QUdpSocket *extSock = nullptr; + SafeUdpSocket *sock = nullptr; StunTransactionPool::Ptr pool; - StunBinding * stunBinding = nullptr; - TurnClient * turn = nullptr; + StunBinding *stunBinding = nullptr; + TurnClient *turn = nullptr; bool turnActivated = false; TransportAddress addr; TransportAddress refAddr; diff --git a/src/irisnet/noncore/sctp/DepUsrSCTP.cpp b/src/irisnet/noncore/sctp/DepUsrSCTP.cpp index 60a76eff..68be85e5 100644 --- a/src/irisnet/noncore/sctp/DepUsrSCTP.cpp +++ b/src/irisnet/noncore/sctp/DepUsrSCTP.cpp @@ -2,8 +2,8 @@ // #define MS_LOG_DEV_LEVEL 3 #include "DepUsrSCTP.hpp" -//#include "DepLibUV.hpp" -//#include "Logger.hpp" +// #include "DepLibUV.hpp" +// #include "Logger.hpp" #include #include @@ -58,7 +58,7 @@ inline static void sctpDebug(const char *format, ...) /* Static variables. */ -DepUsrSCTP::Checker * DepUsrSCTP::checker { nullptr }; +DepUsrSCTP::Checker *DepUsrSCTP::checker { nullptr }; uint64_t DepUsrSCTP::numSctpAssociations { 0u }; uintptr_t DepUsrSCTP::nextSctpAssociationId { 0u }; std::unordered_map DepUsrSCTP::mapIdSctpAssociation; diff --git a/src/irisnet/noncore/sctp/DepUsrSCTP.hpp b/src/irisnet/noncore/sctp/DepUsrSCTP.hpp index 55a0bdd1..09432dca 100644 --- a/src/irisnet/noncore/sctp/DepUsrSCTP.hpp +++ b/src/irisnet/noncore/sctp/DepUsrSCTP.hpp @@ -1,9 +1,9 @@ #ifndef MS_DEP_USRSCTP_HPP #define MS_DEP_USRSCTP_HPP -//#include "common.hpp" +// #include "common.hpp" #include "SctpAssociation.hpp" -//#include "handles/Timer.hpp" +// #include "handles/Timer.hpp" #include #include @@ -26,7 +26,7 @@ class DepUsrSCTP { void OnTimer(); private: - QTimer * timer { nullptr }; + QTimer *timer { nullptr }; QElapsedTimer elapsedTimer; }; @@ -39,7 +39,7 @@ class DepUsrSCTP { static RTC::SctpAssociation *RetrieveSctpAssociation(uintptr_t id); private: - static Checker * checker; + static Checker *checker; static uint64_t numSctpAssociations; static uintptr_t nextSctpAssociationId; static std::unordered_map mapIdSctpAssociation; diff --git a/src/irisnet/noncore/sctp/SctpAssociation.cpp b/src/irisnet/noncore/sctp/SctpAssociation.cpp index 816c00af..eade02d3 100644 --- a/src/irisnet/noncore/sctp/SctpAssociation.cpp +++ b/src/irisnet/noncore/sctp/SctpAssociation.cpp @@ -5,7 +5,7 @@ #include "DepUsrSCTP.hpp" #include "Logger.hpp" #include "MediaSoupErrors.hpp" -//#include "Channel/Notifier.hpp" +// #include "Channel/Notifier.hpp" #include // std::malloc(), std::free() #include // std::memset(), std::memcpy() #include @@ -89,9 +89,8 @@ static constexpr uint16_t MaxSctpStreams { 65535 }; SctpAssociation::SctpAssociation(Listener *listener, uint16_t os, uint16_t mis, size_t maxSctpMessageSize, size_t sctpSendBufferSize, bool isDataChannel) : - listener(listener), - os(os), mis(mis), maxSctpMessageSize(maxSctpMessageSize), sctpSendBufferSize(sctpSendBufferSize), - isDataChannel(isDataChannel) + listener(listener), os(os), mis(mis), maxSctpMessageSize(maxSctpMessageSize), + sctpSendBufferSize(sctpSendBufferSize), isDataChannel(isDataChannel) { MS_TRACE(); diff --git a/src/irisnet/noncore/sctp/SctpAssociation.hpp b/src/irisnet/noncore/sctp/SctpAssociation.hpp index af93d6f0..1e371f6a 100644 --- a/src/irisnet/noncore/sctp/SctpAssociation.hpp +++ b/src/irisnet/noncore/sctp/SctpAssociation.hpp @@ -1,8 +1,8 @@ #ifndef MS_RTC_SCTP_ASSOCIATION_HPP #define MS_RTC_SCTP_ASSOCIATION_HPP -//#include "common.hpp" -//#include "Utils.hpp" +// #include "common.hpp" +// #include "Utils.hpp" #include "RTC/DataConsumer.hpp" #include "RTC/DataProducer.hpp" #include "usrsctp.h" diff --git a/src/irisnet/noncore/stunallocate.cpp b/src/irisnet/noncore/stunallocate.cpp index 4107e4c2..f61f0779 100644 --- a/src/irisnet/noncore/stunallocate.cpp +++ b/src/irisnet/noncore/stunallocate.cpp @@ -74,9 +74,9 @@ class StunAllocatePermission : public QObject { Q_OBJECT public: - QTimer * timer; + QTimer *timer; StunTransactionPool::Ptr pool; - StunTransaction * trans; + StunTransaction *trans; TransportAddress stunAddr; QHostAddress addr; bool active; @@ -233,9 +233,9 @@ class StunAllocateChannel : public QObject { Q_OBJECT public: - QTimer * timer; + QTimer *timer; StunTransactionPool::Ptr pool; - StunTransaction * trans = nullptr; + StunTransaction *trans = nullptr; TransportAddress stunAddr; int channelId; TransportAddress addr; @@ -408,10 +408,10 @@ class StunAllocate::Private : public QObject { Erroring // like stopping, but emits error when finished }; - StunAllocate * q; + StunAllocate *q; ObjectSession sess; StunTransactionPool::Ptr pool; - StunTransaction * trans; + StunTransaction *trans; TransportAddress stunAddr; State state; QString errorString; @@ -420,7 +420,7 @@ class StunAllocate::Private : public QObject { TransportAddress reflexiveAddress, relayedAddress; StunMessage msg; int allocateLifetime; - QTimer * allocateRefreshTimer; + QTimer *allocateRefreshTimer; QList perms; QList channels; QList permQueue; diff --git a/src/irisnet/noncore/stunbinding.cpp b/src/irisnet/noncore/stunbinding.cpp index 2c22a6b2..15bda2ea 100644 --- a/src/irisnet/noncore/stunbinding.cpp +++ b/src/irisnet/noncore/stunbinding.cpp @@ -28,7 +28,7 @@ class StunBinding::Private : public QObject { Q_OBJECT public: - StunBinding * q; + StunBinding *q; StunTransactionPool::Ptr pool; QScopedPointer trans; TransportAddress stunAddr; diff --git a/src/irisnet/noncore/stunmessage.cpp b/src/irisnet/noncore/stunmessage.cpp index 1ce21ab4..24e3f225 100644 --- a/src/irisnet/noncore/stunmessage.cpp +++ b/src/irisnet/noncore/stunmessage.cpp @@ -431,7 +431,7 @@ QByteArray StunMessage::toBinary(int validationFlags, const QByteArray &key) con // header QByteArray buf(20, 0); - quint8 * p = (quint8 *)buf.data(); + quint8 *p = (quint8 *)buf.data(); quint8 classbits = 0; if (d->mclass == Request) diff --git a/src/irisnet/noncore/stunmessage.h b/src/irisnet/noncore/stunmessage.h index 59df9fd2..dd2ba937 100644 --- a/src/irisnet/noncore/stunmessage.h +++ b/src/irisnet/noncore/stunmessage.h @@ -51,8 +51,8 @@ class StunMessage { bool isNull() const; Class mclass() const; quint16 method() const; - const quint8 * magic() const; // 4 bytes - const quint8 * id() const; // 12 bytes + const quint8 *magic() const; // 4 bytes + const quint8 *id() const; // 12 bytes QList attributes() const; // returns the first instance or null diff --git a/src/irisnet/noncore/stuntransaction.cpp b/src/irisnet/noncore/stuntransaction.cpp index e9142673..24bcc43c 100644 --- a/src/irisnet/noncore/stuntransaction.cpp +++ b/src/irisnet/noncore/stuntransaction.cpp @@ -90,7 +90,7 @@ class StunTransactionPoolPrivate : public QObject { Q_OBJECT public: - StunTransactionPool * q; + StunTransactionPool *q; StunTransaction::Mode mode; QSet transactions; QHash transToId; diff --git a/src/irisnet/noncore/tcpportreserver.h b/src/irisnet/noncore/tcpportreserver.h index 19e25a11..16275203 100644 --- a/src/irisnet/noncore/tcpportreserver.h +++ b/src/irisnet/noncore/tcpportreserver.h @@ -45,7 +45,7 @@ class TcpPortServer : public QObject { inline void setPortInfo(const Port &port) { this->port = port; } inline QHostAddress serverAddress() const { return serverSocket->serverAddress(); } inline quint16 serverPort() const { return serverSocket->serverPort(); } - inline const QString & publishHost() const { return port.publishHost; } + inline const QString &publishHost() const { return port.publishHost; } inline quint16 publishPort() const { return port.publishPort; } inline PortType portType() const { return port.portType; } inline const QVariant &meta() const { return port.meta; } @@ -94,7 +94,7 @@ public slots: bool started = false; TcpPortServer::PortTypes typeMask = TcpPortServer::PortTypes(TcpPortServer::Direct | TcpPortServer::NatAssited | TcpPortServer::Tunneled); - TcpPortScope * scope = nullptr; + TcpPortScope *scope = nullptr; QList servers; }; @@ -110,7 +110,7 @@ class TcpPortScope : public QObject { public: TcpPortScope(); ~TcpPortScope(); - TcpPortDiscoverer * disco(); + TcpPortDiscoverer *disco(); QList allServers() const; protected: diff --git a/src/irisnet/noncore/turnclient.cpp b/src/irisnet/noncore/turnclient.cpp index 09f38608..e0a0bfe2 100644 --- a/src/irisnet/noncore/turnclient.cpp +++ b/src/irisnet/noncore/turnclient.cpp @@ -75,19 +75,19 @@ class TurnClient::Private : public QObject { Q_OBJECT public: - TurnClient * q; + TurnClient *q; Proxy proxy; QString clientSoftware; TurnClient::Mode mode = PlainMode; TransportAddress serverAddr; ObjectSession sess; - ByteStream * bs = nullptr; - QCA::TLS * tls = nullptr; + ByteStream *bs = nullptr; + QCA::TLS *tls = nullptr; bool tlsHandshaken = false; QByteArray inStream; bool udp = false; StunTransactionPool::Ptr pool; - StunAllocate * allocate = nullptr; + StunAllocate *allocate = nullptr; bool allocateStarted = false; QString user; QCA::SecureArray pass; diff --git a/src/irisnet/noncore/udpportreserver.cpp b/src/irisnet/noncore/udpportreserver.cpp index 12b05d40..e1d45f96 100644 --- a/src/irisnet/noncore/udpportreserver.cpp +++ b/src/irisnet/noncore/udpportreserver.cpp @@ -53,7 +53,7 @@ class UdpPortReserver::Private : public QObject { } }; - UdpPortReserver * q; + UdpPortReserver *q; QList addrs; QList ports; // sorted. diff --git a/src/jdns.cmake b/src/jdns.cmake index 64d98145..a9fb359c 100644 --- a/src/jdns.cmake +++ b/src/jdns.cmake @@ -49,4 +49,4 @@ set(qjdns_HEADERS add_library(${QJDns_LIBRARY} STATIC ${qjdns_SRCS} ${qjdns_MOC_SRCS} ${qjdns_MOC_HDRS} ${qjdns_PUBLIC_HEADERS}) target_link_libraries(${QJDns_LIBRARY} Qt5::Core Qt5::Network) -target_link_libraries(${QJDns_LIBRARY} jdns) +target_link_libraries(${QJDns_LIBRARY} jdns) diff --git a/src/xmpp/base/timezone.cpp b/src/xmpp/base/timezone.cpp index c1b937c5..bf647592 100644 --- a/src/xmpp/base/timezone.cpp +++ b/src/xmpp/base/timezone.cpp @@ -18,20 +18,12 @@ #include "timezone.h" - #include #include +int TimeZone::offsetFromUtc() { return QTimeZone::systemTimeZone().offsetFromUtc(QDateTime::currentDateTime()) / 60; } -int TimeZone::offsetFromUtc() -{ - return QTimeZone::systemTimeZone().offsetFromUtc(QDateTime::currentDateTime()) / 60; -} - -QString TimeZone::abbreviation() -{ - return QTimeZone::systemTimeZone().abbreviation(QDateTime::currentDateTime()); -} +QString TimeZone::abbreviation() { return QTimeZone::systemTimeZone().abbreviation(QDateTime::currentDateTime()); } int TimeZone::tzdToInt(const QString &tzd) { diff --git a/src/xmpp/blake2/blake2-impl.h b/src/xmpp/blake2/blake2-impl.h index 1197c651..29d07fa6 100644 --- a/src/xmpp/blake2/blake2-impl.h +++ b/src/xmpp/blake2/blake2-impl.h @@ -75,7 +75,7 @@ static BLAKE2_INLINE void store16(void *dst, uint16_t w) uint8_t *p = (uint8_t *)dst; *p++ = (uint8_t)w; w >>= 8; - *p++ = (uint8_t)w; + *p++ = (uint8_t)w; #endif } diff --git a/src/xmpp/blake2/blake2b-ref.c b/src/xmpp/blake2/blake2b-ref.c index e5273a8f..a3a512e4 100644 --- a/src/xmpp/blake2/blake2b-ref.c +++ b/src/xmpp/blake2/blake2b-ref.c @@ -329,7 +329,7 @@ int main(void) for (i = 0; i < BLAKE2_KAT_LENGTH; ++i) { uint8_t hash[BLAKE2B_OUTBYTES]; blake2b_state S; - uint8_t * p = buf; + uint8_t *p = buf; size_t mlen = i; int err = 0; diff --git a/src/xmpp/blake2/blake2s-ref.c b/src/xmpp/blake2/blake2s-ref.c index 170f87f8..33f3d875 100644 --- a/src/xmpp/blake2/blake2s-ref.c +++ b/src/xmpp/blake2/blake2s-ref.c @@ -321,7 +321,7 @@ int main(void) for (i = 0; i < BLAKE2_KAT_LENGTH; ++i) { uint8_t hash[BLAKE2S_OUTBYTES]; blake2s_state S; - uint8_t * p = buf; + uint8_t *p = buf; size_t mlen = i; int err = 0; diff --git a/src/xmpp/jid/jid.h b/src/xmpp/jid/jid.h index 85a36ad6..e7c1a3a8 100644 --- a/src/xmpp/jid/jid.h +++ b/src/xmpp/jid/jid.h @@ -42,7 +42,7 @@ class StringPrepCache { QHash saslprep_table; static QScopedPointer _instance; - static StringPrepCache * instance(); + static StringPrepCache *instance(); StringPrepCache(); }; diff --git a/src/xmpp/qa/README b/src/xmpp/qa/README index 05425a06..d2f3b124 100644 --- a/src/xmpp/qa/README +++ b/src/xmpp/qa/README @@ -3,11 +3,11 @@ How to add unit tests to a module - Copy the qa/unittest.template module to the module dir, and rename it to 'unittest'. Be careful not to copy '.svn'. - Create a file test.cpp for every class, and implement the tests - for each method.. See 'myclasstest.cpp' for a template. + for each method.. See 'myclasstest.cpp' for a template. - Add every test.cpp file to 'unittest.pri' -- In 'unittest.pro', replace '$$MYMODULE' with the name of the module that you +- In 'unittest.pro', replace '$$MYMODULE' with the name of the module that you are unit testing. Also include all the modules that are required to compile - a standalone checker for the module under test. + a standalone checker for the module under test. - Add an 'include' line to the list of unit tests in qa/unittests.pri. This is used to compile the full unit test suite of all modules. - Make sure 'qa/unittests.pro' contains the module under test, and make diff --git a/src/xmpp/sasl/digestmd5response.cpp b/src/xmpp/sasl/digestmd5response.cpp index 4f0094b5..4a89476d 100644 --- a/src/xmpp/sasl/digestmd5response.cpp +++ b/src/xmpp/sasl/digestmd5response.cpp @@ -28,8 +28,7 @@ namespace XMPP { DIGESTMD5Response::DIGESTMD5Response(const QByteArray &challenge, const QString &service, const QString &host, const QString &arealm, const QString &user, const QString &authz, - const QByteArray &password, const RandomNumberGenerator &rand) : - isValid_(true) + const QByteArray &password, const RandomNumberGenerator &rand) : isValid_(true) { QString realm = arealm; diff --git a/src/xmpp/sasl/scramsha1message.cpp b/src/xmpp/sasl/scramsha1message.cpp index 74e3543a..60f51220 100644 --- a/src/xmpp/sasl/scramsha1message.cpp +++ b/src/xmpp/sasl/scramsha1message.cpp @@ -41,8 +41,7 @@ bool Normalize(const QString &username_in, QString &username_out) } SCRAMSHA1Message::SCRAMSHA1Message(const QString &authzid, const QString &authcid, const QByteArray &cnonce, - const RandomNumberGenerator &rand) : - isValid_(true) + const RandomNumberGenerator &rand) : isValid_(true) { QString result; QByteArray clientnonce; diff --git a/src/xmpp/sasl/scramsha1response.cpp b/src/xmpp/sasl/scramsha1response.cpp index 9d568edc..62b2ee13 100644 --- a/src/xmpp/sasl/scramsha1response.cpp +++ b/src/xmpp/sasl/scramsha1response.cpp @@ -44,8 +44,8 @@ SCRAMSHA1Response::SCRAMSHA1Response(const QByteArray &server_first_message, con QString pass_out; QRegularExpression pattern("r=(.*),s=(.+),i=(\\d+)"); - auto match = pattern.match(QString(server_first_message)); - isValid_ = match.hasMatch(); + auto match = pattern.match(QString(server_first_message)); + isValid_ = match.hasMatch(); if (!isValid_) { qWarning("SASL/SCRAM-SHA-1: Failed to match pattern for server-final-message."); return; @@ -107,7 +107,7 @@ SCRAMSHA1Response::SCRAMSHA1Response(const QByteArray &server_first_message, con // AuthMessage := client-first-message-bare + "," + server-first-message + "," + // client-final-message-without-proof QRegularExpression extract_cfmb_pattern("(n=.+)"); - match = extract_cfmb_pattern.match(QString(client_first_message)); + match = extract_cfmb_pattern.match(QString(client_first_message)); isValid_ = match.hasMatch(); if (!isValid_) { return; diff --git a/src/xmpp/sasl/scramsha1signature.cpp b/src/xmpp/sasl/scramsha1signature.cpp index f0785d1f..1c9c71c5 100644 --- a/src/xmpp/sasl/scramsha1signature.cpp +++ b/src/xmpp/sasl/scramsha1signature.cpp @@ -19,19 +19,19 @@ #include "xmpp/sasl/scramsha1signature.h" #include +#include #include #include #include -#include #include namespace XMPP { -SCRAMSHA1Signature::SCRAMSHA1Signature(const QByteArray & server_final_message, +SCRAMSHA1Signature::SCRAMSHA1Signature(const QByteArray &server_final_message, const QCA::SecureArray &server_signature_should) { QRegularExpression pattern("v=([^,]*)"); - auto match = pattern.match(QString(server_final_message)); - isValid_ = match.hasMatch(); + auto match = pattern.match(QString(server_final_message)); + isValid_ = match.hasMatch(); if (isValid_) { QString server_signature = match.captured(1); QCA::SecureArray server_sig(QCA::Base64().stringToArray(server_signature)); diff --git a/src/xmpp/sasl/unittest/digestmd5responsetest.cpp b/src/xmpp/sasl/unittest/digestmd5responsetest.cpp index 25c948bc..0224263d 100644 --- a/src/xmpp/sasl/unittest/digestmd5responsetest.cpp +++ b/src/xmpp/sasl/unittest/digestmd5responsetest.cpp @@ -38,12 +38,12 @@ private slots: "xmpp", "jabber.example.com", "example.com", "myuser", "myuser_authz", "mypass", IncrementingRandomNumberGenerator(255)); QByteArray expectedValue("username=\"myuser\",realm=\"example.com\"," - "nonce=\"O6skKPuaCZEny3hteI19qXMBXSadoWs840MchORo\"," - "cnonce=\"AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8=\"," - "nc=00000001," - "digest-uri=\"xmpp/jabber.example.com\"," - "qop=auth,response=8fe15bc2aa31956b62d9de831b21a5d4," - "charset=utf-8,authzid=\"myuser_authz\""); + "nonce=\"O6skKPuaCZEny3hteI19qXMBXSadoWs840MchORo\"," + "cnonce=\"AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8=\"," + "nc=00000001," + "digest-uri=\"xmpp/jabber.example.com\"," + "qop=auth,response=8fe15bc2aa31956b62d9de831b21a5d4," + "charset=utf-8,authzid=\"myuser_authz\""); QVERIFY(response.isValid()); QCOMPARE(response.getValue(), expectedValue); @@ -57,11 +57,11 @@ private slots: "xmpp", "jabber.example.com", "example.com", "myuser", "", "mypass", IncrementingRandomNumberGenerator(255)); QByteArray expectedValue("username=\"myuser\",realm=\"example.com\"," - "nonce=\"O6skKPuaCZEny3hteI19qXMBXSadoWs840MchORo\"," - "cnonce=\"AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8=\"," - "nc=00000001," - "digest-uri=\"xmpp/jabber.example.com\"," - "qop=auth,response=564b1c1cc16d97b019f18b14c979964b,charset=utf-8"); + "nonce=\"O6skKPuaCZEny3hteI19qXMBXSadoWs840MchORo\"," + "cnonce=\"AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8=\"," + "nc=00000001," + "digest-uri=\"xmpp/jabber.example.com\"," + "qop=auth,response=564b1c1cc16d97b019f18b14c979964b,charset=utf-8"); QVERIFY(response.isValid()); QCOMPARE(response.getValue(), expectedValue); diff --git a/src/xmpp/xmpp-core/compressionhandler.h b/src/xmpp/xmpp-core/compressionhandler.h index 740f32ca..3f3479fd 100644 --- a/src/xmpp/xmpp-core/compressionhandler.h +++ b/src/xmpp/xmpp-core/compressionhandler.h @@ -25,7 +25,7 @@ class CompressionHandler : public QObject { void error(); private: - ZLibCompressor * compressor_; + ZLibCompressor *compressor_; ZLibDecompressor *decompressor_; QBuffer outgoing_buffer_, incoming_buffer_; int errorCode_; diff --git a/src/xmpp/xmpp-core/connector.cpp b/src/xmpp/xmpp-core/connector.cpp index 9fe4b7ff..f73e8bd5 100644 --- a/src/xmpp/xmpp-core/connector.cpp +++ b/src/xmpp/xmpp-core/connector.cpp @@ -35,13 +35,13 @@ #include "xmpp.h" #include +#include #include #include #include -#include #include -//#define XMPP_DEBUG +// #define XMPP_DEBUG #ifdef XMPP_DEBUG #define XDEBUG (qDebug() << this << "#" << __FUNCTION__ << ":") #endif diff --git a/src/xmpp/xmpp-core/parser.cpp b/src/xmpp/xmpp-core/parser.cpp index df931c27..5f00c3bf 100644 --- a/src/xmpp/xmpp-core/parser.cpp +++ b/src/xmpp/xmpp-core/parser.cpp @@ -160,7 +160,7 @@ class Parser::Private { QDomElement element; // root part std::list in; QXmlStreamReader reader; - const char * completeTag = nullptr; // this is basically a workaround for bugs like QTBUG-14661 + const char *completeTag = nullptr; // this is basically a workaround for bugs like QTBUG-14661 int completeOffset = 0; bool streamOpened = false; bool readerStarted = false; diff --git a/src/xmpp/xmpp-core/parser.h b/src/xmpp/xmpp-core/parser.h index 0ea6a087..811bd4fe 100644 --- a/src/xmpp/xmpp-core/parser.h +++ b/src/xmpp/xmpp-core/parser.h @@ -78,10 +78,10 @@ class Parser { Parser(); ~Parser(); - void reset(); - void appendData(const QByteArray &a); - Event readNext(); - QByteArray unprocessed() const; + void reset(); + void appendData(const QByteArray &a); + Event readNext(); + QByteArray unprocessed() const; QStringView encoding() const; private: diff --git a/src/xmpp/xmpp-core/protocol.cpp b/src/xmpp/xmpp-core/protocol.cpp index 2f70e81e..9cb3aca3 100644 --- a/src/xmpp/xmpp-core/protocol.cpp +++ b/src/xmpp/xmpp-core/protocol.cpp @@ -1700,8 +1700,8 @@ bool CoreProtocol::normalStep(const QDomElement &e) if (!location.isEmpty()) { int port_off = 0; QStringView sm_host; - int sm_port = 0; - auto location_view = QStringView{location}; + int sm_port = 0; + auto location_view = QStringView { location }; if (location.startsWith('[')) { // ipv6 port_off = location.indexOf(']'); if (port_off != -1) { // looks valid diff --git a/src/xmpp/xmpp-core/securestream.cpp b/src/xmpp/xmpp-core/securestream.cpp index d6a6f0da..94c2d0d2 100644 --- a/src/xmpp/xmpp-core/securestream.cpp +++ b/src/xmpp/xmpp-core/securestream.cpp @@ -107,7 +107,7 @@ class SecureLayer : public QObject { enum { TLS, SASL, TLSH, Compression }; int type; union { - QCA::TLS * tls; + QCA::TLS *tls; QCA::SASL *sasl; #ifdef USE_TLSHANDLER XMPP::TLSHandler *tlsHandler; @@ -339,7 +339,7 @@ private slots: class SecureStream::Private { public: - ByteStream * bs; + ByteStream *bs; QList layers; int pending; int errorCode; @@ -571,7 +571,7 @@ void SecureStream::layer_tlsClosed(const QByteArray &) void SecureStream::layer_readyRead(const QByteArray &a) { - SecureLayer * s = static_cast(sender()); + SecureLayer *s = static_cast(sender()); QList::Iterator it(d->layers.begin()); while ((*it) != s) { Q_ASSERT(it != d->layers.end()); @@ -591,7 +591,7 @@ void SecureStream::layer_readyRead(const QByteArray &a) void SecureStream::layer_needWrite(const QByteArray &a) { - SecureLayer * s = static_cast(sender()); + SecureLayer *s = static_cast(sender()); QList::Iterator it(d->layers.begin()); while ((*it) != s) { Q_ASSERT(it != d->layers.end()); diff --git a/src/xmpp/xmpp-core/sm.h b/src/xmpp/xmpp-core/sm.h index 26fb5ac3..e85c85ec 100644 --- a/src/xmpp/xmpp-core/sm.h +++ b/src/xmpp/xmpp-core/sm.h @@ -28,7 +28,7 @@ #define NS_STREAM_MANAGEMENT "urn:xmpp:sm:3" #define SM_TIMER_INTERVAL_SECS 40 -//#define IRIS_SM_DEBUG +// #define IRIS_SM_DEBUG namespace XMPP { class SMState { @@ -55,7 +55,7 @@ class SMState { class StreamManagement : QObject { public: StreamManagement(QObject *parent = nullptr); - XMPP::SMState & state() { return state_; } + XMPP::SMState &state() { return state_; } const XMPP::SMState &state() const { return state_; } bool isActive() const { return sm_started || sm_resumed; } bool isResumed() const { return sm_resumed; } diff --git a/src/xmpp/xmpp-core/stream.cpp b/src/xmpp/xmpp-core/stream.cpp index aaedfdb7..0384166c 100644 --- a/src/xmpp/xmpp-core/stream.cpp +++ b/src/xmpp/xmpp-core/stream.cpp @@ -59,10 +59,10 @@ #include #include #include -//#include +// #include #include -//#define XMPP_DEBUG +// #define XMPP_DEBUG using namespace XMPP; @@ -209,8 +209,7 @@ ClientStream::ClientStream(Connector *conn, TLSHandler *tlsHandler, QObject *par } ClientStream::ClientStream(const QString &host, const QString &defRealm, ByteStream *bs, QCA::TLS *tls, - QObject *parent) : - Stream(parent) + QObject *parent) : Stream(parent) { d = new Private; d->mode = Server; @@ -704,9 +703,9 @@ void ClientStream::sasl_needParams(const QCA::SASL::Params &p) void ClientStream::sasl_authCheck(const QString &user, const QString &) { - //#ifdef XMPP_DEBUG - // qDebug("authcheck: [%s], [%s]\n", user.latin1(), authzid.latin1()); - //#endif + // #ifdef XMPP_DEBUG + // qDebug("authcheck: [%s], [%s]\n", user.latin1(), authzid.latin1()); + // #endif QString u = user; int n = u.indexOf('@'); if (n != -1) diff --git a/src/xmpp/xmpp-core/tlshandler.cpp b/src/xmpp/xmpp-core/tlshandler.cpp index 9c348aaf..366f9023 100644 --- a/src/xmpp/xmpp-core/tlshandler.cpp +++ b/src/xmpp/xmpp-core/tlshandler.cpp @@ -195,7 +195,9 @@ static bool cert_match_domain(const QString &certname, const QString &acedomain) #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) if (!QRegExp(p1, Qt::CaseSensitive, QRegExp::Wildcard).exactMatch(p2)) #else - if (!QRegularExpression::fromWildcard(QLatin1Char('^') + p1 + QLatin1Char('$'), Qt::CaseSensitive).match(p2).hasMatch()) + if (!QRegularExpression::fromWildcard(QLatin1Char('^') + p1 + QLatin1Char('$'), Qt::CaseSensitive) + .match(p2) + .hasMatch()) #endif return false; } diff --git a/src/xmpp/xmpp-core/xmpp_stanza.cpp b/src/xmpp/xmpp-core/xmpp_stanza.cpp index 5aeb983f..b3779539 100644 --- a/src/xmpp/xmpp-core/xmpp_stanza.cpp +++ b/src/xmpp/xmpp-core/xmpp_stanza.cpp @@ -473,7 +473,7 @@ class Stanza::Private { return QLatin1String("iq"); } - Stream * s; + Stream *s; QDomElement e; QSharedPointer sharedDoc; }; diff --git a/src/xmpp/xmpp-im/client.cpp b/src/xmpp/xmpp-im/client.cpp index f3cfe9d9..8b9b1792 100644 --- a/src/xmpp/xmpp-im/client.cpp +++ b/src/xmpp/xmpp-im/client.cpp @@ -118,8 +118,8 @@ class Client::ClientPrivate { QPointer stream; QDomDocument doc; - Task * root = nullptr; - QNetworkAccessManager * qnam = nullptr; + Task *root = nullptr; + QNetworkAccessManager *qnam = nullptr; QString host, user, pass, resource; QString osName, osVersion, tzname, clientName, clientVersion; CapsSpec caps, serverCaps; @@ -133,22 +133,22 @@ class Client::ClientPrivate { LiveRoster roster; ResourceList resourceList; - CapsManager * capsman = nullptr; - TcpPortReserver * tcpPortReserver = nullptr; - S5BManager * s5bman = nullptr; - Jingle::S5B::Manager * jingleS5BManager = nullptr; - Jingle::IBB::Manager * jingleIBBManager = nullptr; - Jingle::ICE::Manager * jingleICEManager = nullptr; - IBBManager * ibbman = nullptr; - BoBManager * bobman = nullptr; - FileTransferManager * ftman = nullptr; - ServerInfoManager * serverInfoManager = nullptr; + CapsManager *capsman = nullptr; + TcpPortReserver *tcpPortReserver = nullptr; + S5BManager *s5bman = nullptr; + Jingle::S5B::Manager *jingleS5BManager = nullptr; + Jingle::IBB::Manager *jingleIBBManager = nullptr; + Jingle::ICE::Manager *jingleICEManager = nullptr; + IBBManager *ibbman = nullptr; + BoBManager *bobman = nullptr; + FileTransferManager *ftman = nullptr; + ServerInfoManager *serverInfoManager = nullptr; ExternalServiceDiscovery *externalServiceDiscovery = nullptr; - StunDiscoManager * stunDiscoManager = nullptr; - HttpFileUploadManager * httpFileUploadManager = nullptr; - Jingle::Manager * jingleManager = nullptr; + StunDiscoManager *stunDiscoManager = nullptr; + HttpFileUploadManager *httpFileUploadManager = nullptr; + Jingle::Manager *jingleManager = nullptr; QList groupChatList; - EncryptionHandler * encryptionHandler = nullptr; + EncryptionHandler *encryptionHandler = nullptr; }; Client::Client(QObject *par) : QObject(par) @@ -563,7 +563,7 @@ void Client::debug(const QString &str) { emit debugText(str); } QString Client::genUniqueId() { -#if QT_VERSION >= QT_VERSION_CHECK(5,11,0) +#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) return QUuid::createUuid().toString(QUuid::WithoutBraces); #else auto s = QUuid::createUuid().toString(); @@ -1294,7 +1294,7 @@ LiveRoster::~LiveRoster() { delete d; } LiveRoster &LiveRoster::operator=(const LiveRoster &other) { QList::operator=(other); - d->groupsDelimiter = other.d->groupsDelimiter; + d->groupsDelimiter = other.d->groupsDelimiter; return *this; } void LiveRoster::flagAllForDelete() diff --git a/src/xmpp/xmpp-im/filetransfer.cpp b/src/xmpp/xmpp-im/filetransfer.cpp index 8d63c956..714d6e22 100644 --- a/src/xmpp/xmpp-im/filetransfer.cpp +++ b/src/xmpp/xmpp-im/filetransfer.cpp @@ -56,7 +56,7 @@ static QDomElement firstChildElement(const QDomElement &e) class FileTransfer::Private { public: FileTransferManager *m; - JT_FT * ft; + JT_FT *ft; Jid peer; QString fname; qlonglong size; @@ -68,7 +68,7 @@ class FileTransfer::Private { Thumbnail thumbnail; bool needStream; QString id, iq_id; - BSConnection * c; + BSConnection *c; Jid proxy; int state; bool sender; @@ -332,12 +332,12 @@ void FileTransfer::doAccept() { d->c->accept(); } //---------------------------------------------------------------------------- class FileTransferManager::Private { public: - Client * client; + Client *client; QList list, incoming; QStringList streamPriority; QHash streamMap; QSet disabledStreamTypes; - JT_PushFT * pft; + JT_PushFT *pft; }; FileTransferManager::FileTransferManager(Client *client) : QObject(client) diff --git a/src/xmpp/xmpp-im/filetransfer.h b/src/xmpp/xmpp-im/filetransfer.h index cbf77dd9..6c8b57c5 100644 --- a/src/xmpp/xmpp-im/filetransfer.h +++ b/src/xmpp/xmpp-im/filetransfer.h @@ -113,7 +113,7 @@ class FileTransferManager : public QObject { bool isActive(const FileTransfer *ft) const; void setDisabled(const QString &ns, bool state = true); - Client * client() const; + Client *client() const; FileTransfer *createTransfer(); FileTransfer *takeIncoming(); diff --git a/src/xmpp/xmpp-im/httpfileupload.cpp b/src/xmpp/xmpp-im/httpfileupload.cpp index 314a76be..efbdc696 100644 --- a/src/xmpp/xmpp-im/httpfileupload.cpp +++ b/src/xmpp/xmpp-im/httpfileupload.cpp @@ -59,9 +59,7 @@ class HttpFileUpload::Private { }; HttpFileUpload::HttpFileUpload(XMPP::Client *client, QIODevice *source, size_t fsize, const QString &dstFilename, - const QString &mType) : - QObject(client), - d(new Private) + const QString &mType) : QObject(client), d(new Private) { d->client = client; d->sourceDevice = source; @@ -102,8 +100,9 @@ void HttpFileUpload::start() featureOptions << (QSet() << xmlns_v0_2_5) << (QSet() << xmlns_v0_3_1); } d->client->serverInfoManager()->queryServiceInfo( - QLatin1String("store"), QLatin1String("file"), featureOptions, QRegularExpression("^(upload|http|stor|file|dis|drive).*"), - ServerInfoManager::SQ_CheckAllOnNoMatch, [this](const QList &items) { + QLatin1String("store"), QLatin1String("file"), featureOptions, + QRegularExpression("^(upload|http|stor|file|dis|drive).*"), ServerInfoManager::SQ_CheckAllOnNoMatch, + [this](const QList &items) { d->httpHosts.clear(); for (const auto &item : items) { const QStringList &l = item.features().list(); diff --git a/src/xmpp/xmpp-im/im.h b/src/xmpp/xmpp-im/im.h index e0f20d1b..d1175d56 100644 --- a/src/xmpp/xmpp-im/im.h +++ b/src/xmpp/xmpp-im/im.h @@ -21,7 +21,6 @@ #define XMPP_IM_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" @@ -32,6 +31,7 @@ #include "iris/xmpp_hash.h" #include "iris/xmpp_htmlelement.h" #include "iris/xmpp_httpauthrequest.h" +#include "iris/xmpp_jid.h" #include "iris/xmpp_liveroster.h" #include "iris/xmpp_liverosteritem.h" #include "iris/xmpp_message.h" diff --git a/src/xmpp/xmpp-im/jingle-application.cpp b/src/xmpp/xmpp-im/jingle-application.cpp index 06813810..2c91bca4 100644 --- a/src/xmpp/xmpp-im/jingle-application.cpp +++ b/src/xmpp/xmpp-im/jingle-application.cpp @@ -66,8 +66,7 @@ namespace XMPP { namespace Jingle { public: ConnectionWaiter(TransportFeatures features, std::function &&ready, std::function &&failed, Application *app) : - QObject(app), - ready(std::move(ready)), failed(std::move(failed)) + QObject(app), ready(std::move(ready)), failed(std::move(failed)) { auto tr = app->transport(); transport = tr; diff --git a/src/xmpp/xmpp-im/jingle-application.h b/src/xmpp/xmpp-im/jingle-application.h index f19da243..cd3b06cb 100644 --- a/src/xmpp/xmpp-im/jingle-application.h +++ b/src/xmpp/xmpp-im/jingle-application.h @@ -79,7 +79,7 @@ namespace XMPP { namespace Jingle { inline Origin senders() const { return _senders; } inline QString contentName() const { return _contentName; } inline QSharedPointer transport() const { return _transport; } - inline TransportSelector * transportSelector() const { return _transportSelector.data(); } + inline TransportSelector *transportSelector() const { return _transportSelector.data(); } bool isRemote() const; inline bool isLocal() const { return !isRemote(); } inline ApplicationFlags flags() const { return _flags; } diff --git a/src/xmpp/xmpp-im/jingle-connection.h b/src/xmpp/xmpp-im/jingle-connection.h index ff6b9e44..486026d1 100644 --- a/src/xmpp/xmpp-im/jingle-connection.h +++ b/src/xmpp/xmpp-im/jingle-connection.h @@ -42,9 +42,7 @@ namespace XMPP { namespace Jingle { bool _valid = false; QByteArray _data; inline NetworkDatagram(const QByteArray &data, const QHostAddress &destinationAddress = QHostAddress(), - quint16 port = 0) : - _valid(true), - _data(data) + quint16 port = 0) : _valid(true), _data(data) { Q_UNUSED(destinationAddress); Q_UNUSED(port) diff --git a/src/xmpp/xmpp-im/jingle-file.h b/src/xmpp/xmpp-im/jingle-file.h index 2dc3cd1b..9bcb0dfd 100644 --- a/src/xmpp/xmpp-im/jingle-file.h +++ b/src/xmpp/xmpp-im/jingle-file.h @@ -45,7 +45,7 @@ class File { File(const File &other); File(const QDomElement &file); ~File(); - File & operator=(const File &other); + File &operator=(const File &other); inline bool isValid() const { return d != nullptr; } QDomElement toXml(QDomDocument *doc) const; bool merge(const File &other); @@ -77,7 +77,7 @@ class File { private: class Private; - Private * ensureD(); + Private *ensureD(); QSharedDataPointer d; }; diff --git a/src/xmpp/xmpp-im/jingle-ft.cpp b/src/xmpp/xmpp-im/jingle-ft.cpp index 43d8dc2f..b63a60b7 100644 --- a/src/xmpp/xmpp-im/jingle-ft.cpp +++ b/src/xmpp/xmpp-im/jingle-ft.cpp @@ -411,8 +411,7 @@ namespace XMPP { namespace Jingle { namespace FileTransfer { }; Application::Application(const QSharedPointer &pad, const QString &contentName, Origin creator, - Origin senders) : - d(new Private) + Origin senders) : d(new Private) { d->q = this; _pad = pad; diff --git a/src/xmpp/xmpp-im/jingle-ft.h b/src/xmpp/xmpp-im/jingle-ft.h index 7d4a7969..bc9ab6f0 100644 --- a/src/xmpp/xmpp-im/jingle-ft.h +++ b/src/xmpp/xmpp-im/jingle-ft.h @@ -58,7 +58,7 @@ namespace XMPP { namespace Jingle { namespace FileTransfer { Pad(Manager *manager, Session *session); QDomElement takeOutgoingSessionInfoUpdate() override; QString ns() const override; - Session * session() const override; + Session *session() const override; ApplicationManager *manager() const override; QString generateContentName(Origin senders) override; bool incomingSessionInfo(const QDomElement &el) override; diff --git a/src/xmpp/xmpp-im/jingle-ibb.cpp b/src/xmpp/xmpp-im/jingle-ibb.cpp index dcb6732c..3b9b5661 100644 --- a/src/xmpp/xmpp-im/jingle-ibb.cpp +++ b/src/xmpp/xmpp-im/jingle-ibb.cpp @@ -38,7 +38,7 @@ namespace XMPP { namespace Jingle { namespace IBB { Q_OBJECT public: - Client * client; + Client *client; Jid peer; QString sid; size_t _blockSize; @@ -138,7 +138,7 @@ namespace XMPP { namespace Jingle { namespace IBB { }; struct Transport::Private { - Transport * q = nullptr; + Transport *q = nullptr; QMap> connections; size_t defaultBlockSize = 4096; bool started = false; @@ -314,7 +314,7 @@ namespace XMPP { namespace Jingle { namespace IBB { auto doc = _pad->session()->manager()->client()->doc(); auto it = std::find_if(d->connections.begin(), d->connections.end(), - [](auto &c) { return c->state == State::ApprovedToSend; }); + [](auto &c) { return c->state == State::ApprovedToSend; }); if (it == d->connections.end()) { if (ensureTransportElement) { @@ -413,7 +413,7 @@ namespace XMPP { namespace Jingle { namespace IBB { struct Manager::Private { QHash, QSharedPointer> connections; - XMPP::Jingle::Manager * jingleManager = nullptr; + XMPP::Jingle::Manager *jingleManager = nullptr; }; Manager::Manager(QObject *parent) : TransportManager(parent), d(new Private) { } diff --git a/src/xmpp/xmpp-im/jingle-ibb.h b/src/xmpp/xmpp-im/jingle-ibb.h index 96773228..7020a519 100644 --- a/src/xmpp/xmpp-im/jingle-ibb.h +++ b/src/xmpp/xmpp-im/jingle-ibb.h @@ -62,7 +62,7 @@ namespace Jingle { namespace IBB { Pad(Manager *manager, Session *session); QString ns() const override; - Session * session() const override; + Session *session() const override; TransportManager *manager() const override; Connection::Ptr makeConnection(const QString &sid, size_t blockSize); @@ -82,7 +82,7 @@ namespace Jingle { namespace IBB { void setJingleManager(XMPP::Jingle::Manager *jm) override; QSharedPointer newTransport(const TransportManagerPad::Ptr &pad, Origin creator) override; - TransportManagerPad * pad(Session *session) override; + TransportManagerPad *pad(Session *session) override; QStringList discoFeatures() const override; diff --git a/src/xmpp/xmpp-im/jingle-ice.cpp b/src/xmpp/xmpp-im/jingle-ice.cpp index 02d49a9a..fc63726a 100644 --- a/src/xmpp/xmpp-im/jingle-ice.cpp +++ b/src/xmpp/xmpp-im/jingle-ice.cpp @@ -443,7 +443,7 @@ namespace XMPP { namespace Jingle { namespace ICE { NewSctpAssociation = 16 }; - Transport * q = nullptr; + Transport *q = nullptr; bool offerSent = false; bool aborted = false; bool initialOfferReady = false; @@ -461,9 +461,9 @@ namespace XMPP { namespace Jingle { namespace ICE { // QElapsedTimer lastConnectionStart; // size_t blockSize = 8192; TcpPortDiscoverer *disco = nullptr; - UdpPortReserver * portReserver = nullptr; + UdpPortReserver *portReserver = nullptr; Resolver resolver; - XMPP::Ice176 * ice = nullptr; + XMPP::Ice176 *ice = nullptr; Dtls::Setup localDtlsRole = Dtls::ActPass; Dtls::Setup remoteDtlsRole = Dtls::ActPass; diff --git a/src/xmpp/xmpp-im/jingle-ice.h b/src/xmpp/xmpp-im/jingle-ice.h index 65a3cab0..58f858a4 100644 --- a/src/xmpp/xmpp-im/jingle-ice.h +++ b/src/xmpp/xmpp-im/jingle-ice.h @@ -20,9 +20,9 @@ #ifndef JINGLE_ICE_H #define JINGLE_ICE_H -#include "jingle-transport.h" #include "iris/tcpportreserver.h" #include "iris/xmpp.h" +#include "jingle-transport.h" class QHostAddress; @@ -71,15 +71,15 @@ namespace Jingle { namespace ICE { Pad(Manager *manager, Session *session); QString ns() const override; - Session * session() const override; + Session *session() const override; TransportManager *manager() const override; void onLocalAccepted() override; inline TcpPortScope *discoScope() const { return _discoScope; } private: - Manager * _manager; - Session * _session; + Manager *_manager; + Session *_session; TcpPortScope *_discoScope; bool _allowGrouping = false; }; @@ -94,7 +94,7 @@ namespace Jingle { namespace ICE { void setJingleManager(XMPP::Jingle::Manager *jm) override; QSharedPointer newTransport(const TransportManagerPad::Ptr &pad, Origin creator) override; - TransportManagerPad * pad(Session *session) override; + TransportManagerPad *pad(Session *session) override; QStringList ns() const override; QStringList discoFeatures() const override; diff --git a/src/xmpp/xmpp-im/jingle-nstransportslist.h b/src/xmpp/xmpp-im/jingle-nstransportslist.h index 6ed27d02..cc7c5363 100644 --- a/src/xmpp/xmpp-im/jingle-nstransportslist.h +++ b/src/xmpp/xmpp-im/jingle-nstransportslist.h @@ -44,7 +44,7 @@ namespace XMPP { namespace Jingle { bool replace(QSharedPointer old, QSharedPointer newer) override; private: - Session * _session = nullptr; + Session *_session = nullptr; QStringList _transports; }; diff --git a/src/xmpp/xmpp-im/jingle-s5b.cpp b/src/xmpp/xmpp-im/jingle-s5b.cpp index 29bbdcd1..929041bf 100644 --- a/src/xmpp/xmpp-im/jingle-s5b.cpp +++ b/src/xmpp/xmpp-im/jingle-s5b.cpp @@ -51,7 +51,7 @@ namespace XMPP { namespace Jingle { namespace S5B { Q_OBJECT QList datagrams; - SocksClient * client = nullptr; + SocksClient *client = nullptr; Transport::Mode mode = Transport::Tcp; public: @@ -137,7 +137,7 @@ namespace XMPP { namespace Jingle { namespace S5B { Q_OBJECT QMap clients; - SocksClient * client = nullptr; + SocksClient *client = nullptr; public: using QObject::QObject; @@ -236,7 +236,7 @@ namespace XMPP { namespace Jingle { namespace S5B { Candidate::State state = Candidate::New; QSharedPointer server; - SocksClient * socksClient = nullptr; + SocksClient *socksClient = nullptr; QString toString() const { @@ -389,8 +389,7 @@ namespace XMPP { namespace Jingle { namespace S5B { } Candidate::Candidate(Transport *transport, const TcpPortServer::Ptr &server, const QString &cid, - quint16 localPreference) : - d(new Private) + quint16 localPreference) : d(new Private) { Type type = None; switch (server->portType()) { @@ -582,7 +581,7 @@ namespace XMPP { namespace Jingle { namespace S5B { public: enum PendingActions { NewCandidate = 1, CandidateUsed = 2, CandidateError = 4, Activated = 8, ProxyError = 16 }; - Transport * q = nullptr; + Transport *q = nullptr; bool p2pAllowed = true; bool offerSent = false; bool waitingAck = true; diff --git a/src/xmpp/xmpp-im/jingle-s5b.h b/src/xmpp/xmpp-im/jingle-s5b.h index dad9f65f..91376179 100644 --- a/src/xmpp/xmpp-im/jingle-s5b.h +++ b/src/xmpp/xmpp-im/jingle-s5b.h @@ -20,8 +20,8 @@ #ifndef JINGLE_S5B_H #define JINGLE_S5B_H -#include "jingle-transport.h" #include "iris/tcpportreserver.h" +#include "jingle-transport.h" class QHostAddress; class SocksClient; @@ -85,7 +85,7 @@ namespace Jingle { namespace S5B { Candidate(Transport *transport, const TcpPortServer::Ptr &server, const QString &cid, quint16 localPreference = 0); ~Candidate(); - Candidate & operator=(const Candidate &other) = default; + Candidate &operator=(const Candidate &other) = default; inline bool isValid() const { return d != nullptr; } inline operator bool() const { return isValid(); } Type type() const; @@ -110,7 +110,7 @@ namespace Jingle { namespace S5B { void connectToHost(const QString &key, State successState, QObject *callbackContext, std::function callback, bool isUdp = false); bool incomingConnection(SocksClient *sc); - SocksClient * takeSocksClient(); + SocksClient *takeSocksClient(); void deleteSocksClient(); TcpPortServer::Ptr server() const; bool isConnected() const; @@ -163,7 +163,7 @@ namespace Jingle { namespace S5B { Pad(Manager *manager, Session *session); QString ns() const override; - Session * session() const override; + Session *session() const override; TransportManager *manager() const override; QString generateSid() const; @@ -172,8 +172,8 @@ namespace Jingle { namespace S5B { inline TcpPortScope *discoScope() const { return _discoScope; } private: - Manager * _manager; - Session * _session; + Manager *_manager; + Session *_session; TcpPortScope *_discoScope; }; @@ -187,7 +187,7 @@ namespace Jingle { namespace S5B { void setJingleManager(XMPP::Jingle::Manager *jm) override; QSharedPointer newTransport(const TransportManagerPad::Ptr &pad, Origin creator) override; - TransportManagerPad * pad(Session *session) override; + TransportManagerPad *pad(Session *session) override; QStringList discoFeatures() const override; diff --git a/src/xmpp/xmpp-im/jingle-sctp-association_p.h b/src/xmpp/xmpp-im/jingle-sctp-association_p.h index d13c183f..312e715c 100644 --- a/src/xmpp/xmpp-im/jingle-sctp-association_p.h +++ b/src/xmpp/xmpp-im/jingle-sctp-association_p.h @@ -48,7 +48,7 @@ namespace XMPP { namespace Jingle { namespace SCTP { public: using QualifiedOutgoingMessage = std::pair; - Association * q; + Association *q; Keeper::Ptr keeper; QQueue outgoingPacketsQueue; // ready to be sent over dtls QQueue outgoingMessageQueue; // ready to be processed by sctp stack diff --git a/src/xmpp/xmpp-im/jingle-session.cpp b/src/xmpp/xmpp-im/jingle-session.cpp index 034f0eec..f0323406 100644 --- a/src/xmpp/xmpp-im/jingle-session.cpp +++ b/src/xmpp/xmpp-im/jingle-session.cpp @@ -542,7 +542,7 @@ namespace XMPP { namespace Jingle { Private::AddContentError err; Reason::Condition cond; - Application * app; + Application *app; std::tie(err, cond, app) = parseContentAdd(ce); if (err == Private::AddContentError::Unparsed) { @@ -640,7 +640,7 @@ namespace XMPP { namespace Jingle { Private::AddContentError err; Reason::Condition cond; - Application * app; + Application *app; std::tie(err, cond, app) = parseContentAccept(ce); if (err == Private::AddContentError::Unparsed || err == Private::AddContentError::Unexpected) { @@ -885,7 +885,7 @@ namespace XMPP { namespace Jingle { } for (auto &v : passed) { - Application * app; + Application *app; QSharedPointer transport; QDomElement ce; std::tie(app, transport, ce) = v; diff --git a/src/xmpp/xmpp-im/jingle-session.h b/src/xmpp/xmpp-im/jingle-session.h index a3df3ce1..07425323 100644 --- a/src/xmpp/xmpp-im/jingle-session.h +++ b/src/xmpp/xmpp-im/jingle-session.h @@ -59,7 +59,7 @@ namespace XMPP { namespace Jingle { // make new local content but do not add it to session yet Application *newContent(const QString &ns, Origin senders = Origin::Both); // get registered content if any - Application * content(const QString &contentName, Origin creator); + Application *content(const QString &contentName, Origin creator); void addContent(Application *content); const QMap &contentList() const; void setGrouping(const QString &groupType, const QStringList &group); diff --git a/src/xmpp/xmpp-im/jingle-transport.h b/src/xmpp/xmpp-im/jingle-transport.h index 3b2c2e1f..84c8b19f 100644 --- a/src/xmpp/xmpp-im/jingle-transport.h +++ b/src/xmpp/xmpp-im/jingle-transport.h @@ -244,7 +244,7 @@ namespace XMPP { namespace Jingle { // FIXME rename methods virtual QSharedPointer newTransport(const TransportManagerPad::Ptr &pad, Origin creator) = 0; - virtual TransportManagerPad * pad(Session *session) = 0; + virtual TransportManagerPad *pad(Session *session) = 0; // this method is supposed to gracefully close all related sessions as a preparation for plugin unload for // example diff --git a/src/xmpp/xmpp-im/jingle-webrtc-datachannel_p.cpp b/src/xmpp/xmpp-im/jingle-webrtc-datachannel_p.cpp index 5aa3053a..501d641e 100644 --- a/src/xmpp/xmpp-im/jingle-webrtc-datachannel_p.cpp +++ b/src/xmpp/xmpp-im/jingle-webrtc-datachannel_p.cpp @@ -27,14 +27,13 @@ namespace XMPP { namespace Jingle { namespace SCTP { WebRTCDataChannel::WebRTCDataChannel(AssociationPrivate *association, quint8 channelType, quint32 reliability, quint16 priority, const QString &label, const QString &protocol, DcepState state) : - association(association), - channelType(channelType), reliability(reliability), priority(priority), label(label), protocol(protocol), - dcepState(state) + association(association), channelType(channelType), reliability(reliability), priority(priority), label(label), + protocol(protocol), dcepState(state) { } QSharedPointer WebRTCDataChannel::fromChannelOpen(AssociationPrivate *assoc, - const QByteArray & data) + const QByteArray &data) { /* 0 1 2 3 @@ -75,7 +74,7 @@ namespace XMPP { namespace Jingle { namespace SCTP { QString protocol = QString::fromUtf8(data.data() + protoOff, protocolLength); // start with DcepNegotiated since caller will ack asap auto channel = QSharedPointer::create(assoc, channelType, priority, reliability, label, - protocol, DcepNegotiated); + protocol, DcepNegotiated); channel->_isRemote = true; channel->setOpenMode(QIODevice::ReadWrite); return channel; diff --git a/src/xmpp/xmpp-im/jingle-webrtc-datachannel_p.h b/src/xmpp/xmpp-im/jingle-webrtc-datachannel_p.h index d1eb09ec..031d30c7 100644 --- a/src/xmpp/xmpp-im/jingle-webrtc-datachannel_p.h +++ b/src/xmpp/xmpp-im/jingle-webrtc-datachannel_p.h @@ -49,7 +49,7 @@ namespace XMPP { namespace Jingle { namespace SCTP { using OutgoingCallback = std::function; - AssociationPrivate * association; + AssociationPrivate *association; QList datagrams; DisconnectReason disconnectReason = ChannelClosed; std::size_t outgoingBufSize = 0; diff --git a/src/xmpp/xmpp-im/jingle.cpp b/src/xmpp/xmpp-im/jingle.cpp index 887f279a..4819c866 100644 --- a/src/xmpp/xmpp-im/jingle.cpp +++ b/src/xmpp/xmpp-im/jingle.cpp @@ -486,7 +486,7 @@ namespace XMPP { namespace Jingle { const QString &text = QString(), const QDomElement &jingleErr = QDomElement()) { auto resp = createIQ(client()->doc(), "error", iq.attribute(QStringLiteral("from")), - iq.attribute(QStringLiteral("id"))); + iq.attribute(QStringLiteral("id"))); Stanza::Error error(errType, errCond, text); auto errEl = error.toXml(*client()->doc(), client()->stream().baseNS()); if (!jingleErr.isNull()) { @@ -533,8 +533,8 @@ namespace XMPP { namespace Jingle { //---------------------------------------------------------------------------- class Manager::Private { public: - XMPP::Client * client; - Manager * manager; + XMPP::Client *client; + Manager *manager; QScopedPointer pushTask; // ns -> application std::map> applicationManagers; diff --git a/src/xmpp/xmpp-im/jingle.h b/src/xmpp/xmpp-im/jingle.h index 014c5e6f..9763926d 100644 --- a/src/xmpp/xmpp-im/jingle.h +++ b/src/xmpp/xmpp-im/jingle.h @@ -22,9 +22,9 @@ #include "iris/xmpp_stanza.h" +#include #include #include -#include #include @@ -208,15 +208,15 @@ namespace Jingle { inline bool isValid() const { return d != nullptr; } Action action() const; const QString &sid() const; - const Jid & initiator() const; + const Jid &initiator() const; void setInitiator(const Jid &jid); - const Jid & responder() const; + const Jid &responder() const; void setResponder(const Jid &jid); private: class Private; QSharedDataPointer d; - Jingle::Private * ensureD(); + Jingle::Private *ensureD(); }; class Reason { @@ -249,7 +249,7 @@ namespace Jingle { Reason(Condition cond, const QString &text = QString()); Reason(const QDomElement &el); Reason(const Reason &other); - Reason & operator=(const Reason &); + Reason &operator=(const Reason &); inline bool isValid() const { return d != nullptr; } Condition condition() const; void setCondition(Condition cond); @@ -286,8 +286,7 @@ namespace Jingle { QString disposition; // default "session" }; - class Security { - }; + class Security { }; /** * @brief The SessionManagerPad class - TransportManager/AppManager PAD @@ -310,7 +309,7 @@ namespace Jingle { public: virtual QDomElement takeOutgoingSessionInfoUpdate(); virtual QString ns() const = 0; - virtual Session * session() const = 0; + virtual Session *session() const = 0; virtual void onLocalAccepted(); // changing to prepare state virtual void onSend(); // local stuff is prepared we are going to send it to remote @@ -344,13 +343,13 @@ namespace Jingle { void registerApplication(ApplicationManager *app); void unregisterApp(const QString &ns); bool isRegisteredApplication(const QString &ns); - ApplicationManagerPad *applicationPad(Session * session, + ApplicationManagerPad *applicationPad(Session *session, const QString &ns); // allocates new pad on application manager void registerTransport(TransportManager *transport); void unregisterTransport(const QString &ns); bool isRegisteredTransport(const QString &ns); - TransportManagerPad *transportPad(Session * session, + TransportManagerPad *transportPad(Session *session, const QString &ns); // allocates new pad on transport manager QStringList availableTransports(const TransportFeatures &features = TransportFeatures()) const; @@ -364,8 +363,8 @@ namespace Jingle { bool isAllowedParty(const Jid &jid) const; void setRemoteJidChecker(std::function checker); - Session * session(const Jid &remoteJid, const QString &sid); - Session * newSession(const Jid &j); + Session *session(const Jid &remoteJid, const QString &sid); + Session *newSession(const Jid &j); QString registerSession(Session *session); XMPP::Stanza::Error lastError() const; diff --git a/src/xmpp/xmpp-im/s5b.cpp b/src/xmpp/xmpp-im/s5b.cpp index 24300804..c0b9b18a 100644 --- a/src/xmpp/xmpp-im/s5b.cpp +++ b/src/xmpp/xmpp-im/s5b.cpp @@ -40,7 +40,7 @@ #endif #define MAXSTREAMHOSTS 5 -//#define S5B_DEBUG +// #define S5B_DEBUG static const char *S5B_NS = "http://jabber.org/protocol/bytestreams"; @@ -73,20 +73,20 @@ class S5BManager::Item : public QObject { enum { ErrRefused, ErrConnect, ErrWrongHost, ErrProxy }; enum { Unknown, Fast, NotFast }; - S5BManager * m = nullptr; + S5BManager *m = nullptr; int state = 0; QString sid, key, out_key, out_id, in_id; Jid self, peer; StreamHostList in_hosts; - JT_S5B * task = nullptr; - JT_S5B * proxy_task = nullptr; + JT_S5B *task = nullptr; + JT_S5B *proxy_task = nullptr; QList> relatedServers; - SocksClient * client = nullptr; - SocksClient * client_out = nullptr; - SocksUDP * client_udp = nullptr; - SocksUDP * client_out_udp = nullptr; - S5BConnector * conn = nullptr; - S5BConnector * proxy_conn = nullptr; + SocksClient *client = nullptr; + SocksClient *client_out = nullptr; + SocksUDP *client_udp = nullptr; + SocksUDP *client_out_udp = nullptr; + S5BConnector *conn = nullptr; + S5BConnector *proxy_conn = nullptr; // S5BServersManager::S5BLocalServers *localServ = nullptr; bool wantFast = false; StreamHost proxy; @@ -158,9 +158,9 @@ QByteArray S5BDatagram::data() const { return _buf; } //---------------------------------------------------------------------------- class S5BConnection::Private { public: - S5BManager * m; - SocksClient * sc; - SocksUDP * su; + S5BManager *m; + SocksClient *sc; + SocksUDP *su; int state; Jid peer; QString sid; @@ -503,9 +503,9 @@ class S5BManager::Entry { ~Entry() { delete query; } S5BConnection *c = nullptr; - Item * i = nullptr; + Item *i = nullptr; QString sid; - JT_S5B * query = nullptr; + JT_S5B *query = nullptr; StreamHost proxyInfo; bool udp_init = false; @@ -515,10 +515,10 @@ class S5BManager::Entry { class S5BManager::Private { public: - Client * client; + Client *client; QList activeList; S5BConnectionList incomingConns; - JT_PushS5B * ps; + JT_PushS5B *ps; }; S5BManager::S5BManager(Client *parent) : BytestreamManager(parent) @@ -832,7 +832,7 @@ void S5BManager::con_sendUDP(S5BConnection *c, const QByteArray &buf) void S5BManager::item_accepted() { - Item * i = static_cast(sender()); + Item *i = static_cast(sender()); Entry *e = findEntry(i); emit e->c->accepted(); // signal @@ -840,7 +840,7 @@ void S5BManager::item_accepted() void S5BManager::item_tryingHosts(const StreamHostList &list) { - Item * i = static_cast(sender()); + Item *i = static_cast(sender()); Entry *e = findEntry(i); emit e->c->tryingHosts(list); // signal @@ -848,7 +848,7 @@ void S5BManager::item_tryingHosts(const StreamHostList &list) void S5BManager::item_proxyConnect() { - Item * i = static_cast(sender()); + Item *i = static_cast(sender()); Entry *e = findEntry(i); emit e->c->proxyConnect(); // signal @@ -856,7 +856,7 @@ void S5BManager::item_proxyConnect() void S5BManager::item_waitingForActivation() { - Item * i = static_cast(sender()); + Item *i = static_cast(sender()); Entry *e = findEntry(i); emit e->c->waitingForActivation(); // signal @@ -864,7 +864,7 @@ void S5BManager::item_waitingForActivation() void S5BManager::item_connected() { - Item * i = static_cast(sender()); + Item *i = static_cast(sender()); Entry *e = findEntry(i); // grab the client @@ -879,7 +879,7 @@ void S5BManager::item_connected() void S5BManager::item_error(int x) { - Item * i = static_cast(sender()); + Item *i = static_cast(sender()); Entry *e = findEntry(i); e->c->man_failed(x); @@ -925,7 +925,7 @@ void S5BManager::queryProxy(Entry *e) void S5BManager::query_finished() { JT_S5B *query = static_cast(sender()); - Entry * e = nullptr; + Entry *e = nullptr; for (Entry *i : std::as_const(d->activeList)) { if (i->query == query) { e = i; @@ -1310,7 +1310,7 @@ void S5BManager::Item::conn_result(bool b) { if (b) { SocksClient *sc = conn->takeClient(); - SocksUDP * sc_udp = conn->takeUDP(); + SocksUDP *sc_udp = conn->takeUDP(); StreamHost h = conn->streamHostUsed(); delete conn; conn = nullptr; @@ -1364,7 +1364,7 @@ void S5BManager::Item::proxy_result(bool b) #endif if (b) { SocksClient *sc = proxy_conn->takeClient(); - SocksUDP * sc_udp = proxy_conn->takeUDP(); + SocksUDP *sc_udp = proxy_conn->takeUDP(); delete proxy_conn; proxy_conn = nullptr; @@ -1614,7 +1614,7 @@ class S5BConnector::Item : public QObject { Q_OBJECT public: SocksClient *client; - SocksUDP * client_udp; + SocksUDP *client_udp; StreamHost host; QString key; bool udp; @@ -1706,8 +1706,8 @@ private slots: class S5BConnector::Private { public: - SocksClient * active; - SocksUDP * active_udp; + SocksClient *active; + SocksUDP *active_udp; QList itemList; QString key; StreamHost activeHost; diff --git a/src/xmpp/xmpp-im/s5b.h b/src/xmpp/xmpp-im/s5b.h index 2dd3fed1..5343d3e7 100644 --- a/src/xmpp/xmpp-im/s5b.h +++ b/src/xmpp/xmpp-im/s5b.h @@ -21,11 +21,11 @@ #define XMPP_S5B_H #include "iris/bytestream.h" -#include "xmpp/jid/jid.h" +#include "iris/tcpportreserver.h" #include "iris/xmpp_bytestream.h" #include "iris/xmpp_stanza.h" #include "iris/xmpp_task.h" -#include "iris/tcpportreserver.h" +#include "xmpp/jid/jid.h" #include #include @@ -143,12 +143,12 @@ class S5BManager : public BytestreamManager { ~S5BManager(); static const char *ns(); - Client * client() const; - JT_PushS5B * jtPush() const; + Client *client() const; + JT_PushS5B *jtPush() const; bool isAcceptableSID(const Jid &peer, const QString &sid) const; - BSConnection * createConnection(); + BSConnection *createConnection(); S5BConnection *takeIncoming(); class Item; @@ -174,10 +174,10 @@ private slots: Private *d; S5BConnection *findIncoming(const Jid &from, const QString &sid) const; - Entry * findEntry(S5BConnection *) const; - Entry * findEntry(Item *) const; - Entry * findEntryByHash(const QString &key) const; - Entry * findEntryBySID(const Jid &peer, const QString &sid) const; + Entry *findEntry(S5BConnection *) const; + Entry *findEntry(Item *) const; + Entry *findEntryByHash(const QString &key) const; + Entry *findEntryBySID(const Jid &peer, const QString &sid) const; void entryContinue(Entry *e); void queryProxy(Entry *e); @@ -210,7 +210,7 @@ class S5BConnector : public QObject { void resetConnection(); void start(const Jid &self, const StreamHostList &hosts, const QString &key, bool udp, int timeout); SocksClient *takeClient(); - SocksUDP * takeUDP(); + SocksUDP *takeUDP(); StreamHost streamHostUsed() const; class Item; @@ -315,7 +315,7 @@ class StreamHost { public: StreamHost(); - const Jid & jid() const; + const Jid &jid() const; const QString &host() const; int port() const; bool isProxy() const; diff --git a/src/xmpp/xmpp-im/stundisco.cpp b/src/xmpp/xmpp-im/stundisco.cpp index 4d29b587..0ef2405c 100644 --- a/src/xmpp/xmpp-im/stundisco.cpp +++ b/src/xmpp/xmpp-im/stundisco.cpp @@ -217,7 +217,7 @@ class StunDiscoMonitor : public AbstractStunDisco { } } - StunDiscoManager * manager_; + StunDiscoManager *manager_; bool inProgress_ = false; // initial disco QList pendingWork_; }; diff --git a/src/xmpp/xmpp-im/stundisco.h b/src/xmpp/xmpp-im/stundisco.h index 3560cf7d..17d645da 100644 --- a/src/xmpp/xmpp-im/stundisco.h +++ b/src/xmpp/xmpp-im/stundisco.h @@ -36,7 +36,7 @@ class StunDiscoManager : public QObject { ~StunDiscoManager(); AbstractStunDisco *createMonitor(); - inline Client * client() const { return client_; } + inline Client *client() const { return client_; } private: Client *client_; diff --git a/src/xmpp/xmpp-im/types.cpp b/src/xmpp/xmpp-im/types.cpp index b0e89223..509109a2 100644 --- a/src/xmpp/xmpp-im/types.cpp +++ b/src/xmpp/xmpp-im/types.cpp @@ -664,9 +664,8 @@ void HTMLElement::filterOutUnwantedRecursive(QDomElement &el, bool strict) { Q_UNUSED(strict) // TODO filter out not xhtml-im elements - static QSet unwanted = QSet() << "script" - << "iframe"; - QDomNode child = el.firstChild(); + static QSet unwanted = QSet() << "script" << "iframe"; + QDomNode child = el.firstChild(); while (!child.isNull()) { QDomNode sibling = child.nextSibling(); if (child.isElement()) { @@ -870,7 +869,7 @@ void Message::setFrom(const Jid &j) void Message::setId(const QString &s) { - MessageD()->id = s; + MessageD()->id = s; MessageD()->originId = s; } @@ -2513,7 +2512,7 @@ Roster::Roster(const Roster &other) : QList(other), d(new Roster::Pr Roster &Roster::operator=(const Roster &other) { QList::operator=(other); - d->groupsDelimiter = other.d->groupsDelimiter; + d->groupsDelimiter = other.d->groupsDelimiter; return *this; } diff --git a/src/xmpp/xmpp-im/xmpp_address.h b/src/xmpp/xmpp-im/xmpp_address.h index 7fd04ae2..24115fda 100644 --- a/src/xmpp/xmpp-im/xmpp_address.h +++ b/src/xmpp/xmpp-im/xmpp_address.h @@ -19,8 +19,8 @@ #ifndef XMPP_ADDRESS_H #define XMPP_ADDRESS_H -#include "xmpp/jid/jid.h" #include "iris/xmpp_stanza.h" +#include "xmpp/jid/jid.h" #include @@ -34,7 +34,7 @@ class Address { Address(Type type = Unknown, const Jid &jid = Jid()); Address(const QDomElement &); - const Jid & jid() const; + const Jid &jid() const; const QString &uri() const; const QString &node() const; const QString &desc() const; diff --git a/src/xmpp/xmpp-im/xmpp_agentitem.h b/src/xmpp/xmpp-im/xmpp_agentitem.h index adb958d3..fb5e4a4f 100644 --- a/src/xmpp/xmpp-im/xmpp_agentitem.h +++ b/src/xmpp/xmpp-im/xmpp_agentitem.h @@ -30,10 +30,10 @@ class AgentItem { public: AgentItem() { } - const Jid & jid() const { return v_jid; } - const QString & name() const { return v_name; } - const QString & category() const { return v_category; } - const QString & type() const { return v_type; } + const Jid &jid() const { return v_jid; } + const QString &name() const { return v_name; } + const QString &category() const { return v_category; } + const QString &type() const { return v_type; } const Features &features() const { return v_features; } void setJid(const Jid &j) { v_jid = j; } diff --git a/src/xmpp/xmpp-im/xmpp_bitsofbinary.cpp b/src/xmpp/xmpp-im/xmpp_bitsofbinary.cpp index 9f9f8e69..9cf164f7 100644 --- a/src/xmpp/xmpp-im/xmpp_bitsofbinary.cpp +++ b/src/xmpp/xmpp-im/xmpp_bitsofbinary.cpp @@ -59,7 +59,7 @@ Hash BoBData::cidToHash(const QString &cid) { if (!cid.endsWith(QLatin1String("@bob.xmpp.org"))) return Hash(); - return Hash::from(QStringView{cid}.left(cid.size() - sizeof("@bob.xmpp.org") + 1)); + return Hash::from(QStringView { cid }.left(cid.size() - sizeof("@bob.xmpp.org") + 1)); } QString BoBData::cid() const diff --git a/src/xmpp/xmpp-im/xmpp_bitsofbinary.h b/src/xmpp/xmpp-im/xmpp_bitsofbinary.h index e871d635..9c9f45f0 100644 --- a/src/xmpp/xmpp-im/xmpp_bitsofbinary.h +++ b/src/xmpp/xmpp-im/xmpp_bitsofbinary.h @@ -87,12 +87,12 @@ class BoBManager : public QObject { BoBData bobData(const QString &); // file data, mime type, max age in seconds BoBData append(const QByteArray &data, const QString &type, unsigned int maxAge = 0); - Hash append(QFile & file, + Hash append(QFile &file, const QString &type = "application/octet-stream"); // this method adds just to runtime cache void append(const BoBData &); private: - BoBCache * _cache; + BoBCache *_cache; QHash> _localFiles; // cid => (filename, mime) }; } // namespace XMPP diff --git a/src/xmpp/xmpp-im/xmpp_caps.cpp b/src/xmpp/xmpp-im/xmpp_caps.cpp index 8100f125..5b53725b 100644 --- a/src/xmpp/xmpp-im/xmpp_caps.cpp +++ b/src/xmpp/xmpp-im/xmpp_caps.cpp @@ -390,7 +390,7 @@ QString CapsManager::clientName(const Jid &jid) const ds = 5; } - name = QStringView{node}.mid(startPos, node.size() - startPos - ds).toString(); + name = QStringView { node }.mid(startPos, node.size() - startPos - ds).toString(); } return name; diff --git a/src/xmpp/xmpp-im/xmpp_caps.h b/src/xmpp/xmpp-im/xmpp_caps.h index 06038dfa..c528af9a 100644 --- a/src/xmpp/xmpp-im/xmpp_caps.h +++ b/src/xmpp/xmpp-im/xmpp_caps.h @@ -34,7 +34,7 @@ class CapsInfo { { } inline bool isValid() const { return _lastSeen.isValid(); } - inline const QDateTime & lastSeen() const { return _lastSeen; } + inline const QDateTime &lastSeen() const { return _lastSeen; } inline const XMPP::DiscoItem &disco() const { return _disco; } QDomElement toXml(QDomDocument *doc) const; static CapsInfo fromXml(const QDomElement &ci); @@ -69,7 +69,7 @@ public slots: virtual QByteArray loadData(); // to have permanent cache private: - static CapsRegistry * instance_; + static CapsRegistry *instance_; QHash capsInfo_; }; @@ -107,7 +107,7 @@ protected slots: void capsRegistered(const CapsSpec &); private: - Client * client_; + Client *client_; bool isEnabled_; QMap capsSpecs_; QMap> capsJids_; diff --git a/src/xmpp/xmpp-im/xmpp_captcha.h b/src/xmpp/xmpp-im/xmpp_captcha.h index 23af0d31..9f94eb47 100644 --- a/src/xmpp/xmpp-im/xmpp_captcha.h +++ b/src/xmpp/xmpp-im/xmpp_captcha.h @@ -45,9 +45,9 @@ class CaptchaChallenge { CaptchaChallenge &operator=(const CaptchaChallenge &); bool isValid() const; - const Jid & offendedJid() const; - const Jid & arbiter() const; - const XData & form() const; + const Jid &offendedJid() const; + const Jid &arbiter() const; + const XData &form() const; QString explanation() const; const UrlList &urls() const; State state() const; diff --git a/src/xmpp/xmpp-im/xmpp_client.h b/src/xmpp/xmpp-im/xmpp_client.h index 03c5af8c..58e5f918 100644 --- a/src/xmpp/xmpp-im/xmpp_client.h +++ b/src/xmpp/xmpp-im/xmpp_client.h @@ -86,9 +86,9 @@ class Client : public QObject { void close(bool fast = false); bool hasStream() const; - Stream & stream(); + Stream &stream(); QString streamBaseNS() const; - const LiveRoster & roster() const; + const LiveRoster &roster() const; const ResourceList &resourceList() const; bool isSessionRequired() const; @@ -112,7 +112,7 @@ class Client : public QObject { void debug(const QString &); QString genUniqueId(); - Task * rootTask(); + Task *rootTask(); QDomDocument *doc() const; QString OSName() const; @@ -144,20 +144,20 @@ class Client : public QObject { bool capsOptimizationAllowed() const; void setTcpPortReserver(TcpPortReserver *portReserver); - TcpPortReserver * tcpPortReserver() const; - S5BManager * s5bManager() const; - IBBManager * ibbManager() const; - BoBManager * bobManager() const; - JidLinkManager * jidLinkManager() const; - CapsManager * capsManager() const; - ServerInfoManager * serverInfoManager() const; + TcpPortReserver *tcpPortReserver() const; + S5BManager *s5bManager() const; + IBBManager *ibbManager() const; + BoBManager *bobManager() const; + JidLinkManager *jidLinkManager() const; + CapsManager *capsManager() const; + ServerInfoManager *serverInfoManager() const; ExternalServiceDiscovery *externalServiceDiscovery() const; - StunDiscoManager * stunDiscoManager() const; - HttpFileUploadManager * httpFileUploadManager() const; - Jingle::Manager * jingleManager() const; - Jingle::S5B::Manager * jingleS5BManager() const; - Jingle::IBB::Manager * jingleIBBManager() const; - Jingle::ICE::Manager * jingleICEManager() const; + StunDiscoManager *stunDiscoManager() const; + HttpFileUploadManager *httpFileUploadManager() const; + Jingle::Manager *jingleManager() const; + Jingle::S5B::Manager *jingleS5BManager() const; + Jingle::IBB::Manager *jingleIBBManager() const; + Jingle::ICE::Manager *jingleICEManager() const; void setFileTransferEnabled(bool b); FileTransferManager *fileTransferManager() const; @@ -165,7 +165,7 @@ class Client : public QObject { QString groupChatPassword(const QString &host, const QString &room) const; bool groupChatJoin(const QString &host, const QString &room, const QString &nick, const QString &password = QString(), int maxchars = -1, int maxstanzas = -1, int seconds = -1, - const QDateTime &since = QDateTime(), const Status & = Status()); + const QDateTime &since = QDateTime(), const Status & = Status()); void groupChatSetStatus(const QString &host, const QString &room, const Status &); void groupChatChangeNick(const QString &host, const QString &room, const QString &nick, const Status &); void groupChatLeave(const QString &host, const QString &room, const QString &statusStr = QString()); diff --git a/src/xmpp/xmpp-im/xmpp_discoinfotask.h b/src/xmpp/xmpp-im/xmpp_discoinfotask.h index a5f4da11..81023223 100644 --- a/src/xmpp/xmpp-im/xmpp_discoinfotask.h +++ b/src/xmpp/xmpp-im/xmpp_discoinfotask.h @@ -41,8 +41,8 @@ class DiscoInfoTask : public Task { void get(const DiscoItem &); const DiscoItem &item() const; - const Jid & jid() const; - const QString & node() const; + const Jid &jid() const; + const QString &node() const; void onGo(); bool take(const QDomElement &); diff --git a/src/xmpp/xmpp-im/xmpp_discoitem.h b/src/xmpp/xmpp-im/xmpp_discoitem.h index 281c33d1..f1022617 100644 --- a/src/xmpp/xmpp-im/xmpp_discoitem.h +++ b/src/xmpp/xmpp-im/xmpp_discoitem.h @@ -36,7 +36,7 @@ class DiscoItem { DiscoItem(); ~DiscoItem(); - const Jid & jid() const; + const Jid &jid() const; const QString &node() const; const QString &name() const; @@ -60,9 +60,7 @@ class DiscoItem { inline Identity() { } inline Identity(const QString &categoty, const QString &type, const QString &lang = QString(), - const QString &name = QString()) : - category(categoty), - type(type), lang(lang), name(name) + const QString &name = QString()) : category(categoty), type(type), lang(lang), name(name) { } bool operator==(const Identity &other) const; @@ -86,7 +84,7 @@ class DiscoItem { DiscoItem &operator=(const DiscoItem &); DiscoItem(const DiscoItem &); - operator AgentItem() const { return toAgentItem(); } + operator AgentItem() const { return toAgentItem(); } AgentItem toAgentItem() const; void fromAgentItem(const AgentItem &); diff --git a/src/xmpp/xmpp-im/xmpp_encryption.h b/src/xmpp/xmpp-im/xmpp_encryption.h index a76b0c16..489d4fe3 100644 --- a/src/xmpp/xmpp-im/xmpp_encryption.h +++ b/src/xmpp/xmpp-im/xmpp_encryption.h @@ -23,7 +23,6 @@ #include #include - class QDomElement; namespace XMPP { diff --git a/src/xmpp/xmpp-im/xmpp_externalservicediscovery.h b/src/xmpp/xmpp-im/xmpp_externalservicediscovery.h index 11520dd2..ec6f0d14 100644 --- a/src/xmpp/xmpp-im/xmpp_externalservicediscovery.h +++ b/src/xmpp/xmpp-im/xmpp_externalservicediscovery.h @@ -52,7 +52,7 @@ struct ExternalService { QString username; // optional bool parse(QDomElement &el); - operator QString() const; + operator QString() const; }; struct ExternalServiceId { @@ -133,7 +133,7 @@ class ExternalServiceDiscovery : public QObject { void serviceModified(ExternalServiceList &); private: - Client * client_; + Client *client_; QPointer currentTask = nullptr; // for all services (no type) ExternalServiceList services_; }; diff --git a/src/xmpp/xmpp-im/xmpp_features.cpp b/src/xmpp/xmpp-im/xmpp_features.cpp index a165ffac..8aa1f5be 100644 --- a/src/xmpp/xmpp-im/xmpp_features.cpp +++ b/src/xmpp/xmpp-im/xmpp_features.cpp @@ -59,7 +59,7 @@ void Features::setList(const QStringList &l) #if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) _list = QSet(l.begin(), l.end()); #else - _list = QSet::fromList(l); + _list = QSet::fromList(l); #endif } diff --git a/src/xmpp/xmpp-im/xmpp_features.h b/src/xmpp/xmpp-im/xmpp_features.h index 6849ded1..00c0b2b4 100644 --- a/src/xmpp/xmpp-im/xmpp_features.h +++ b/src/xmpp/xmpp-im/xmpp_features.h @@ -103,9 +103,9 @@ class Features { static long id(const QString &feature); static QString feature(long id); - Features & operator<<(const QString &feature); + Features &operator<<(const QString &feature); inline bool operator==(const Features &other) { return _list == other._list; } - Features & operator+=(const Features &other) + Features &operator+=(const Features &other) { _list += other._list; return *this; diff --git a/src/xmpp/xmpp-im/xmpp_form.h b/src/xmpp/xmpp-im/xmpp_form.h index e0bd99af..d45624bd 100644 --- a/src/xmpp/xmpp-im/xmpp_form.h +++ b/src/xmpp/xmpp-im/xmpp_form.h @@ -77,7 +77,7 @@ class SearchResult { SearchResult(const Jid &jid = ""); ~SearchResult(); - const Jid & jid() const; + const Jid &jid() const; const QString &nick() const; const QString &first() const; const QString &last() const; diff --git a/src/xmpp/xmpp-im/xmpp_hash.cpp b/src/xmpp/xmpp-im/xmpp_hash.cpp index 1d5ab458..558e0bcf 100644 --- a/src/xmpp/xmpp-im/xmpp_hash.cpp +++ b/src/xmpp/xmpp-im/xmpp_hash.cpp @@ -111,7 +111,7 @@ HashVariant findHasher(Hash::Type hashType) Hash::Hash(const QDomElement &el) { QString algo = el.attribute(QLatin1String("algo")); - v_type = parseType(QStringView{algo}); + v_type = parseType(QStringView { algo }); if (v_type != Unknown && el.tagName() == QLatin1String("hash")) { v_data = QByteArray::fromBase64(el.text().toLatin1()); if (v_data.isEmpty()) { diff --git a/src/xmpp/xmpp-im/xmpp_ibb.cpp b/src/xmpp/xmpp-im/xmpp_ibb.cpp index 85745506..10873357 100644 --- a/src/xmpp/xmpp-im/xmpp_ibb.cpp +++ b/src/xmpp/xmpp-im/xmpp_ibb.cpp @@ -47,7 +47,7 @@ class IBBConnection::Private { Jid peer; QString sid; IBBManager *m = nullptr; - JT_IBB * j = nullptr; + JT_IBB *j = nullptr; QString iq_id; QString stanza; @@ -325,10 +325,10 @@ class IBBManager::Private { public: Private() = default; - Client * client = nullptr; + Client *client = nullptr; IBBConnectionList activeConns; IBBConnectionList incomingConns; - JT_IBB * ibb = nullptr; + JT_IBB *ibb = nullptr; }; IBBManager::IBBManager(Client *parent) : BytestreamManager(parent) diff --git a/src/xmpp/xmpp-im/xmpp_ibb.h b/src/xmpp/xmpp-im/xmpp_ibb.h index 0ceb5916..530ac757 100644 --- a/src/xmpp/xmpp-im/xmpp_ibb.h +++ b/src/xmpp/xmpp-im/xmpp_ibb.h @@ -37,7 +37,7 @@ class IBBData { IBBData() : seq(0) { } IBBData(const QString &sid, quint16 seq, const QByteArray &data) : sid(sid), seq(seq), data(data) { } - IBBData & fromXml(const QDomElement &e); + IBBData &fromXml(const QDomElement &e); QDomElement toXml(QDomDocument *) const; QString sid; @@ -98,10 +98,10 @@ class IBBManager : public BytestreamManager { ~IBBManager(); static const char *ns(); - Client * client() const; + Client *client() const; bool isAcceptableSID(const Jid &peer, const QString &sid) const; - BSConnection * createConnection(); + BSConnection *createConnection(); IBBConnection *takeIncoming(); public slots: diff --git a/src/xmpp/xmpp-im/xmpp_liverosteritem.h b/src/xmpp/xmpp-im/xmpp_liverosteritem.h index 9ff16adf..b4c18397 100644 --- a/src/xmpp/xmpp-im/xmpp_liverosteritem.h +++ b/src/xmpp/xmpp-im/xmpp_liverosteritem.h @@ -33,10 +33,10 @@ class LiveRosterItem : public RosterItem { void setRosterItem(const RosterItem &); - ResourceList & resourceList(); + ResourceList &resourceList(); ResourceList::Iterator priority(); - const ResourceList & resourceList() const; + const ResourceList &resourceList() const; ResourceList::ConstIterator priority() const; bool isAvailable() const; diff --git a/src/xmpp/xmpp-im/xmpp_message.h b/src/xmpp/xmpp-im/xmpp_message.h index 52b058cd..79b15bcb 100644 --- a/src/xmpp/xmpp-im/xmpp_message.h +++ b/src/xmpp/xmpp-im/xmpp_message.h @@ -19,13 +19,13 @@ #ifndef XMPP_MESSAGE_H #define XMPP_MESSAGE_H +#include "iris/xmpp_stanza.h" #include "xmpp_address.h" #include "xmpp_chatstate.h" #include "xmpp_muc.h" #include "xmpp_receipts.h" #include "xmpp_reference.h" #include "xmpp_rosterx.h" -#include "iris/xmpp_stanza.h" #include "xmpp_url.h" #include diff --git a/src/xmpp/xmpp-im/xmpp_muc.h b/src/xmpp/xmpp-im/xmpp_muc.h index 770f5ff3..8ef80658 100644 --- a/src/xmpp/xmpp-im/xmpp_muc.h +++ b/src/xmpp/xmpp-im/xmpp_muc.h @@ -42,10 +42,10 @@ class MUCItem { void setReason(const QString &); const QString &nick() const; - const Jid & jid() const; // real jid of muc participant + const Jid &jid() const; // real jid of muc participant Affiliation affiliation() const; Role role() const; - const Jid & actor() const; + const Jid &actor() const; const QString &reason() const; void fromXml(const QDomElement &); @@ -67,9 +67,9 @@ class MUCInvite { MUCInvite(const QDomElement &); MUCInvite(const Jid &to, const QString &reason = QString()); - const Jid & to() const; + const Jid &to() const; void setTo(const Jid &); - const Jid & from() const; + const Jid &from() const; void setFrom(const Jid &); const QString &reason() const; void setReason(const QString &); @@ -92,9 +92,9 @@ class MUCDecline { MUCDecline(const Jid &to, const QString &reason); MUCDecline(const QDomElement &); - const Jid & to() const; + const Jid &to() const; void setTo(const Jid &); - const Jid & from() const; + const Jid &from() const; void setFrom(const Jid &); const QString &reason() const; void setReason(const QString &); @@ -113,7 +113,7 @@ class MUCDestroy { MUCDestroy(); MUCDestroy(const QDomElement &); - const Jid & jid() const; + const Jid &jid() const; void setJid(const Jid &); const QString &reason() const; void setReason(const QString &); diff --git a/src/xmpp/xmpp-im/xmpp_pubsubitem.h b/src/xmpp/xmpp-im/xmpp_pubsubitem.h index ca6d6de6..0c0b283e 100644 --- a/src/xmpp/xmpp-im/xmpp_pubsubitem.h +++ b/src/xmpp/xmpp-im/xmpp_pubsubitem.h @@ -27,7 +27,7 @@ class PubSubItem { public: PubSubItem(); PubSubItem(const QString &id, const QDomElement &payload); - const QString & id() const; + const QString &id() const; const QDomElement &payload() const; private: diff --git a/src/xmpp/xmpp-im/xmpp_resource.h b/src/xmpp/xmpp-im/xmpp_resource.h index 10a045f4..cdbe105f 100644 --- a/src/xmpp/xmpp-im/xmpp_resource.h +++ b/src/xmpp/xmpp-im/xmpp_resource.h @@ -30,7 +30,7 @@ class Resource { const QString &name() const; int priority() const; - const Status & status() const; + const Status &status() const; void setName(const QString &); void setStatus(const Status &); diff --git a/src/xmpp/xmpp-im/xmpp_rosteritem.h b/src/xmpp/xmpp-im/xmpp_rosteritem.h index e773ce33..13c7f11f 100644 --- a/src/xmpp/xmpp-im/xmpp_rosteritem.h +++ b/src/xmpp/xmpp-im/xmpp_rosteritem.h @@ -47,11 +47,11 @@ class RosterItem { virtual ~RosterItem(); RosterItem &operator=(const RosterItem &other) = default; - const Jid & jid() const; - const QString & name() const; - const QStringList & groups() const; + const Jid &jid() const; + const QString &name() const; + const QStringList &groups() const; const Subscription &subscription() const; - const QString & ask() const; + const QString &ask() const; bool isPush() const; bool inGroup(const QString &) const; diff --git a/src/xmpp/xmpp-im/xmpp_rosterx.h b/src/xmpp/xmpp-im/xmpp_rosterx.h index 98669d65..41bbfc9f 100644 --- a/src/xmpp/xmpp-im/xmpp_rosterx.h +++ b/src/xmpp/xmpp-im/xmpp_rosterx.h @@ -38,9 +38,9 @@ class RosterExchangeItem { Action = Add); RosterExchangeItem(const QDomElement &); - const Jid & jid() const; + const Jid &jid() const; Action action() const; - const QString & name() const; + const QString &name() const; const QStringList &groups() const; bool isNull() const; diff --git a/src/xmpp/xmpp-im/xmpp_serverinfomanager.h b/src/xmpp/xmpp-im/xmpp_serverinfomanager.h index 93a0518d..8a6a795a 100644 --- a/src/xmpp/xmpp-im/xmpp_serverinfomanager.h +++ b/src/xmpp/xmpp-im/xmpp_serverinfomanager.h @@ -24,9 +24,9 @@ #include "xmpp_status.h" #include +#include #include #include -#include #include #include @@ -62,8 +62,7 @@ class ServerInfoManager : public QObject { ServiceQuery(const QString &type, const QString &category, const QList> &features, const QRegularExpression &nameHint, const SQOptions &options, const std::function &item)> &&callback) : - type(type), - category(category), features(features), nameHint(nameHint), options(options), callback(callback) + type(type), category(category), features(features), nameHint(nameHint), options(options), callback(callback) { } }; @@ -79,9 +78,9 @@ class ServerInfoManager : public QObject { public: ServerInfoManager(XMPP::Client *client); - const QString & multicastService() const; + const QString &multicastService() const; bool hasPEP() const; - inline const Features & features() const { return _features; } + inline const Features &features() const { return _features; } bool canMessageCarbons() const; inline const QMap &extraServerInfo() const { return _extraServerInfo; } @@ -124,7 +123,7 @@ private slots: void appendQuery(const ServiceQuery &q); private: - XMPP::Client * _client = nullptr; + XMPP::Client *_client = nullptr; CapsSpec _caps; Features _features; QString _multicastService; diff --git a/src/xmpp/xmpp-im/xmpp_status.h b/src/xmpp/xmpp-im/xmpp_status.h index 2cc8ada3..17c649cb 100644 --- a/src/xmpp/xmpp-im/xmpp_status.h +++ b/src/xmpp/xmpp-im/xmpp_status.h @@ -43,10 +43,10 @@ class CapsSpec { CapsSpec(const DiscoItem &disco, QCryptographicHash::Algorithm hashAlgo = QCryptographicHash::Sha1); bool isValid() const; - const QString & node() const; - const QString & version() const; + const QString &node() const; + const QString &version() const; QCryptographicHash::Algorithm hashAlgorithm() const; - inline const QStringList & ext() const { return ext_; } + inline const QStringList &ext() const { return ext_; } QString flatten() const; void resetVersion(); @@ -90,22 +90,22 @@ class Status { int errorCode() const; const QString &errorString() const; - const QString & xsigned() const; - const QString & songTitle() const; + const QString &xsigned() const; + const QString &songTitle() const; const CapsSpec &caps() const; bool isMUC() const; bool hasMUCItem() const; - const MUCItem & mucItem() const; + const MUCItem &mucItem() const; bool hasMUCDestroy() const; const MUCDestroy &mucDestroy() const; const QList &getMUCStatuses() const; - const QString & mucPassword() const; + const QString &mucPassword() const; bool hasMUCHistory() const; int mucHistoryMaxChars() const; int mucHistoryMaxStanzas() const; int mucHistorySeconds() const; - const QDateTime & mucHistorySince() const; + const QDateTime &mucHistorySince() const; static Type txt2type(const QString &stat); diff --git a/src/xmpp/xmpp-im/xmpp_task.cpp b/src/xmpp/xmpp-im/xmpp_task.cpp index d3a1f4c6..bdd7c2db 100644 --- a/src/xmpp/xmpp-im/xmpp_task.cpp +++ b/src/xmpp/xmpp-im/xmpp_task.cpp @@ -37,7 +37,7 @@ class Task::TaskPrivate { int statusCode = 0; QString statusString; XMPP::Stanza::Error error; - Client * client = nullptr; + Client *client = nullptr; bool insig = false; bool deleteme = false; bool autoDelete = false; diff --git a/src/xmpp/xmpp-im/xmpp_task.h b/src/xmpp/xmpp-im/xmpp_task.h index 84f9f8d3..15e2d260 100644 --- a/src/xmpp/xmpp-im/xmpp_task.h +++ b/src/xmpp/xmpp-im/xmpp_task.h @@ -40,14 +40,14 @@ class Task : public QObject { Task(Client *, bool isRoot); virtual ~Task(); - Task * parent() const; - Client * client() const; + Task *parent() const; + Client *client() const; QDomDocument *doc() const; QString id() const; bool success() const; int statusCode() const; - const QString & statusString() const; + const QString &statusString() const; const Stanza::Error &error() const; void setTimeout(int seconds) const; diff --git a/src/xmpp/xmpp-im/xmpp_tasks.h b/src/xmpp/xmpp-im/xmpp_tasks.h index dcd06a00..d500d3a1 100644 --- a/src/xmpp/xmpp-im/xmpp_tasks.h +++ b/src/xmpp/xmpp-im/xmpp_tasks.h @@ -49,7 +49,7 @@ class JT_Register : public Task { void changepw(const QString &pass); void unreg(const Jid &j = ""); - const Form & form() const; + const Form &form() const; bool hasXData() const; const XData &xdata() const; bool isRegistered() const; @@ -223,7 +223,7 @@ class JT_VCard : public Task { void set(const VCard &); void set(const Jid &, const VCard &, bool isTarget = false); - const Jid & jid() const; + const Jid &jid() const; const VCard &vcard() const; void onGo(); @@ -242,7 +242,7 @@ class JT_Search : public Task { JT_Search(Task *parent); ~JT_Search(); - const Form & form() const; + const Form &form() const; const QList &results() const; bool hasXData() const; @@ -272,7 +272,7 @@ class JT_ClientVersion : public Task { void onGo(); bool take(const QDomElement &); - const Jid & jid() const; + const Jid &jid() const; const QString &name() const; const QString &version() const; const QString &os() const; diff --git a/src/xmpp/xmpp-im/xmpp_thumbs.h b/src/xmpp/xmpp-im/xmpp_thumbs.h index 48bf3ddb..0fe02585 100644 --- a/src/xmpp/xmpp-im/xmpp_thumbs.h +++ b/src/xmpp/xmpp-im/xmpp_thumbs.h @@ -31,9 +31,7 @@ class Thumbnail { inline Thumbnail() : width(0), height(0) { } // data - for outgoing it's actual image data. for incoming - cid inline Thumbnail(const QByteArray &data, const QString &mimeType = QString(), quint32 width = 0, - quint32 height = 0) : - data(data), - mimeType(mimeType), width(width), height(height) + quint32 height = 0) : data(data), mimeType(mimeType), width(width), height(height) { } Thumbnail(const QDomElement &el); diff --git a/src/xmpp/xmpp-im/xmpp_vcard.cpp b/src/xmpp/xmpp-im/xmpp_vcard.cpp index be1c0647..3f3d509a 100644 --- a/src/xmpp/xmpp-im/xmpp_vcard.cpp +++ b/src/xmpp/xmpp-im/xmpp_vcard.cpp @@ -496,8 +496,7 @@ VCard VCard::fromXml(const QDomElement &q) v.d->nickName = i.text().trimmed(); else if (tag == "PHOTO") { static QRegularExpression newlines("[\r\n]+"); - v.d->photo - = QCA::Base64().stringToArray(subTagText(i, "BINVAL").replace(newlines, "")).toByteArray(); + v.d->photo = QCA::Base64().stringToArray(subTagText(i, "BINVAL").replace(newlines, "")).toByteArray(); v.d->photoURI = subTagText(i, "EXTVAL"); } else if (tag == "BDAY") v.d->bday = i.text().trimmed(); diff --git a/src/xmpp/xmpp-im/xmpp_vcard.h b/src/xmpp/xmpp-im/xmpp_vcard.h index 23300138..5e442ade 100644 --- a/src/xmpp/xmpp-im/xmpp_vcard.h +++ b/src/xmpp/xmpp-im/xmpp_vcard.h @@ -105,7 +105,7 @@ class VCard { QString country; }; typedef QList
AddressList; - const AddressList & addressList() const; + const AddressList &addressList() const; void setAddressList(const AddressList &); class Label { @@ -125,7 +125,7 @@ class VCard { QStringList lines; }; typedef QList