Skip to content

Commit

Permalink
Merge branch '1.5' into 1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
lnjX committed Jan 14, 2025
2 parents 56eaed2 + eac8bba commit 4c5bb51
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion src/omemo/QXmppOmemoManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,6 @@ QXmppTask<bool> Manager::load()
return;
} else {
d->signedPreKeyPairs = signedPreKeyPairs;
d->renewSignedPreKeyPairs();
}

const auto &preKeyPairs = omemoData.preKeyPairs;
Expand Down
2 changes: 1 addition & 1 deletion src/omemo/QXmppOmemoManager_p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -744,8 +744,8 @@ void ManagerPrivate::renewSignedPreKeyPairs()
// Remove signed pre key pairs older than
// SIGNED_PRE_KEY_RENEWAL_INTERVAL.
if (currentDate - creationDate > SIGNED_PRE_KEY_RENEWAL_INTERVAL) {
itr = signedPreKeyPairs.erase(itr);
omemoStorage->removeSignedPreKeyPair(itr.key());
itr = signedPreKeyPairs.erase(itr);
isSignedPreKeyPairRemoved = true;
} else {
++itr;
Expand Down

1 comment on commit 4c5bb51

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-format (v15.0.7) reports: 4 file(s) not formatted
  • tests/qxmppentitytimemanager/tst_qxmppentitytimemanager.cpp
  • tests/qxmppversionmanager/tst_qxmppversionmanager.cpp
  • src/client/QXmppBlockingManager.h
  • src/base/QXmppPubSubIq_p.h
clang-tidy (v15.0.7) reports: 4534 concern(s)
  • src/server/QXmppIncomingServer.cpp:22:53: warning: [readability-identifier-length]

    parameter name 'qq' is too short, expected at least 3 characters

        QXmppIncomingServerPrivate(QXmppIncomingServer *qq);
                                                        ^
  • src/server/QXmppIncomingServer.cpp:23:13: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

        QString origin() const;
                ^
  • src/server/QXmppIncomingServer.cpp:25:19: warning: [cppcoreguidelines-non-private-member-variables-in-classes]

    member variable 'authenticated' has public visibility

        QSet<QString> authenticated;
                      ^
  • src/server/QXmppIncomingServer.cpp:26:13: warning: [cppcoreguidelines-non-private-member-variables-in-classes]

    member variable 'domain' has public visibility

        QString domain;
                ^
  • src/server/QXmppIncomingServer.cpp:27:13: warning: [cppcoreguidelines-non-private-member-variables-in-classes]

    member variable 'localStreamId' has public visibility

        QString localStreamId;
                ^
  • src/server/QXmppIncomingServer.cpp:33:1: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: authenticated, domain, localStreamId, q

    QXmppIncomingServerPrivate::QXmppIncomingServerPrivate(QXmppIncomingServer *qq)
    ^
  • src/server/QXmppIncomingServer.cpp:33:77: warning: [readability-identifier-length]

    parameter name 'qq' is too short, expected at least 3 characters

    QXmppIncomingServerPrivate::QXmppIncomingServerPrivate(QXmppIncomingServer *qq)
                                                                                ^
  • src/server/QXmppIncomingServer.cpp:38:37: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    QString QXmppIncomingServerPrivate::origin() const
                                        ^
  • src/server/QXmppIncomingServer.cpp:40:17: warning: [cppcoreguidelines-init-variables]

    variable 'socket' is not initialized

        QSslSocket *socket = q->socket();
                    ^
                           = nullptr
  • src/server/QXmppOutgoingServer.cpp:21:7: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: dataQueue, dns, localDomain, localStreamKey, remoteDomain, verifyId, verifyKey, dialbackTimer, ready

    class QXmppOutgoingServerPrivate
          ^
  • src/server/QXmppIncomingClient.cpp:26:53: warning: [readability-identifier-length]

    parameter name 'qq' is too short, expected at least 3 characters

        QXmppIncomingClientPrivate(QXmppIncomingClient *qq);
                                                        ^
  • src/server/QXmppIncomingClient.cpp:27:13: warning: [cppcoreguidelines-non-private-member-variables-in-classes]

    member variable 'idleTimer' has public visibility

        QTimer *idleTimer;
                ^
  • src/server/QXmppIncomingClient.cpp:29:13: warning: [cppcoreguidelines-non-private-member-variables-in-classes]

    member variable 'domain' has public visibility

        QString domain;
                ^
  • src/server/QXmppIncomingClient.cpp:30:13: warning: [cppcoreguidelines-non-private-member-variables-in-classes]

    member variable 'jid' has public visibility

        QString jid;
                ^
  • src/server/QXmppIncomingClient.cpp:31:13: warning: [cppcoreguidelines-non-private-member-variables-in-classes]

    member variable 'resource' has public visibility

        QString resource;
                ^
  • src/server/QXmppIncomingClient.cpp:32:27: warning: [cppcoreguidelines-non-private-member-variables-in-classes]

    member variable 'passwordChecker' has public visibility

        QXmppPasswordChecker *passwordChecker;
                              ^
  • src/server/QXmppIncomingClient.cpp:33:22: warning: [cppcoreguidelines-non-private-member-variables-in-classes]

    member variable 'saslServer' has public visibility

        QXmppSaslServer *saslServer;
                         ^
  • src/server/QXmppIncomingClient.cpp:36:13: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

        QString origin() const;
                ^
  • src/server/QXmppIncomingClient.cpp:42:1: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: idleTimer, domain, jid, resource, saslServer, q

    QXmppIncomingClientPrivate::QXmppIncomingClientPrivate(QXmppIncomingClient *qq)
    ^
  • src/server/QXmppIncomingClient.cpp:42:77: warning: [readability-identifier-length]

    parameter name 'qq' is too short, expected at least 3 characters

    QXmppIncomingClientPrivate::QXmppIncomingClientPrivate(QXmppIncomingClient *qq)
                                                                                ^
  • src/server/QXmppIncomingClient.cpp:47:34: warning: [readability-convert-member-functions-to-static]

    method 'checkCredentials' can be made static

    void QXmppIncomingClientPrivate::checkCredentials(const QByteArray &response)
                                     ^
    static 
  • src/server/QXmppIncomingClient.cpp:53:45: warning: [bugprone-branch-clone]

    repeated branch in conditional chain

        if (saslServer->mechanism() == "PLAIN") {
                                                ^
    /home/runner/work/qxmpp/qxmpp/src/server/QXmppIncomingClient.cpp:61:6: note: end of the original
        } else if (saslServer->mechanism() == "DIGEST-MD5") {
         ^
    /home/runner/work/qxmpp/qxmpp/src/server/QXmppIncomingClient.cpp:61:57: note: clone 1 starts here
        } else if (saslServer->mechanism() == "DIGEST-MD5") {
                                                            ^
  • src/server/QXmppIncomingClient.cpp:70:37: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    QString QXmppIncomingClientPrivate::origin() const
                                        ^
  • src/server/QXmppIncomingClient.cpp:72:17: warning: [cppcoreguidelines-init-variables]

    variable 'socket' is not initialized

        QSslSocket *socket = q->socket();
                    ^
                           = nullptr
  • src/server/QXmppServer.cpp:32:13: warning: [cppcoreguidelines-init-variables]

    variable 'xmlns' is not initialized

        QString xmlns = element.namespaceURI();
                ^
                      = 0
  • src/server/QXmppServer.cpp:36:22: warning: [cppcoreguidelines-init-variables]

    variable 'attrs' is not initialized

        QDomNamedNodeMap attrs = element.attributes();
                         ^
                               = 0
  • src/server/QXmppServer.cpp:38:18: warning: [cppcoreguidelines-init-variables]

    variable 'attr' is not initialized

            QDomAttr attr = attrs.item(i).toAttr();
                     ^
                          = 0
  • src/server/QXmppServer.cpp:43:14: warning: [cppcoreguidelines-init-variables]

    variable 'childNode' is not initialized

        QDomNode childNode = element.firstChild();
                 ^
                           = 0
  • src/server/QXmppServer.cpp:58:37: warning: [readability-identifier-length]

    parameter name 'qq' is too short, expected at least 3 characters

        QXmppServerPrivate(QXmppServer *qq);
                                        ^
  • src/server/QXmppServer.cpp:60:10: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

        bool routeData(const QString &to, const QByteArray &data);
        ~~~~ ^
        auto                                                      -> bool
  • src/server/QXmppServer.cpp:60:35: warning: [readability-identifier-length]

    parameter name 'to' is too short, expected at least 3 characters

        bool routeData(const QString &to, const QByteArray &data);
                                      ^
  • src/server/QXmppServer.cpp:67:13: warning: [cppcoreguidelines-non-private-member-variables-in-classes]

    member variable 'domain' has public visibility

        QString domain;
                ^
  • src/server/QXmppServer.cpp:68:35: warning: [cppcoreguidelines-non-private-member-variables-in-classes]

    member variable 'extensions' has public visibility

        QList<QXmppServerExtension *> extensions;
                                      ^
  • src/server/QXmppServer.cpp:69:18: warning: [cppcoreguidelines-non-private-member-variables-in-classes]

    member variable 'logger' has public visibility

        QXmppLogger *logger;
                     ^
  • src/server/QXmppServer.cpp:70:27: warning: [cppcoreguidelines-non-private-member-variables-in-classes]

    member variable 'passwordChecker' has public visibility

        QXmppPasswordChecker *passwordChecker;
                              ^
  • src/server/QXmppServer.cpp:70:27: warning: [modernize-use-default-member-init]

    use default member initializer for 'passwordChecker'

        QXmppPasswordChecker *passwordChecker;
                              ^
                                             {nullptr}
  • src/server/QXmppServer.cpp:73:33: warning: [cppcoreguidelines-non-private-member-variables-in-classes]

    member variable 'incomingClients' has public visibility

        QSet<QXmppIncomingClient *> incomingClients;
                                    ^
  • src/server/QXmppServer.cpp:74:43: warning: [cppcoreguidelines-non-private-member-variables-in-classes]

    member variable 'incomingClientsByJid' has public visibility

        QHash<QString, QXmppIncomingClient *> incomingClientsByJid;
                                              ^
  • src/server/QXmppServer.cpp:76:28: warning: [cppcoreguidelines-non-private-member-variables-in-classes]

    member variable 'serversForClients' has public visibility

        QSet<QXmppSslServer *> serversForClients;
                               ^
  • src/server/QXmppServer.cpp:79:33: warning: [cppcoreguidelines-non-private-member-variables-in-classes]

    member variable 'incomingServers' has public visibility

        QSet<QXmppIncomingServer *> incomingServers;
                                    ^
  • src/server/QXmppServer.cpp:80:33: warning: [cppcoreguidelines-non-private-member-variables-in-classes]

    member variable 'outgoingServers' has public visibility

        QSet<QXmppOutgoingServer *> outgoingServers;
                                    ^
  • src/server/QXmppServer.cpp:81:28: warning: [cppcoreguidelines-non-private-member-variables-in-classes]

    member variable 'serversForServers' has public visibility

        QSet<QXmppSslServer *> serversForServers;
                               ^
  • src/server/QXmppServer.cpp:84:28: warning: [cppcoreguidelines-non-private-member-variables-in-classes]

    member variable 'caCertificates' has public visibility

        QList<QSslCertificate> caCertificates;
                               ^
  • src/server/QXmppServer.cpp:85:21: warning: [cppcoreguidelines-non-private-member-variables-in-classes]

    member variable 'localCertificate' has public visibility

        QSslCertificate localCertificate;
                        ^
  • src/server/QXmppServer.cpp:86:13: warning: [cppcoreguidelines-non-private-member-variables-in-classes]

    member variable 'privateKey' has public visibility

        QSslKey privateKey;
                ^
  • src/server/QXmppServer.cpp:89:10: warning: [modernize-use-default-member-init]

    use default member initializer for 'loaded'

        bool loaded;
             ^
                   {false}
  • src/server/QXmppServer.cpp:90:10: warning: [modernize-use-default-member-init]

    use default member initializer for 'started'

        bool started;
             ^
                    {false}
  • src/server/QXmppServer.cpp:94:1: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: domain, extensions, logger, incomingClients, incomingClientsByJid, serversForClients, incomingServers, outgoingServers, serversForServers, caCertificates

    QXmppServerPrivate::QXmppServerPrivate(QXmppServer *qq)
    ^
  • src/server/QXmppServer.cpp:94:53: warning: [readability-identifier-length]

    parameter name 'qq' is too short, expected at least 3 characters

    QXmppServerPrivate::QXmppServerPrivate(QXmppServer *qq)
                                                        ^
  • src/server/QXmppServer.cpp:109:26: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    bool QXmppServerPrivate::routeData(const QString &to, const QByteArray &data)
    ~~~~                     ^
    auto                                                                          -> bool
  • src/server/QXmppServer.cpp:109:36: warning: [bugprone-easily-swappable-parameters]

    2 adjacent parameters of 'routeData' of similar type ('const int &') are easily swapped by mistake

    bool QXmppServerPrivate::routeData(const QString &to, const QByteArray &data)
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /home/runner/work/qxmpp/qxmpp/src/server/QXmppServer.cpp:109:51: note: the first parameter in the range is 'to'
    bool QXmppServerPrivate::routeData(const QString &to, const QByteArray &data)
                                                      ^~
    /home/runner/work/qxmpp/qxmpp/src/server/QXmppServer.cpp:109:73: note: the last parameter in the range is 'data'
    bool QXmppServerPrivate::routeData(const QString &to, const QByteArray &data)
                                                                            ^~~~
  • src/server/QXmppServer.cpp:109:51: warning: [readability-identifier-length]

    parameter name 'to' is too short, expected at least 3 characters

    bool QXmppServerPrivate::routeData(const QString &to, const QByteArray &data)
                                                      ^
  • src/server/QXmppServer.cpp:112:19: warning: [cppcoreguidelines-init-variables]

    variable 'toDomain' is not initialized

        const QString toDomain = QXmppUtils::jidToDomain(to);
                      ^
                               = 0
  • src/server/QXmppServer.cpp:119:38: warning: [cppcoreguidelines-init-variables]

    variable 'found' is not initialized

            QList<QXmppIncomingClient *> found;
                                         ^
                                               = 0
  • src/server/QXmppServer.cpp:126:34: warning: [cppcoreguidelines-init-variables]

    variable 'conn' is not initialized

                QXmppIncomingClient *conn = incomingClientsByJid.value(to);
                                     ^
                                          = nullptr
  • src/server/QXmppServer.cpp:127:17: warning: [readability-implicit-bool-conversion]

    implicit conversion 'QXmppIncomingClient *' -> bool

                if (conn) {
                    ^
                         != nullptr
  • src/server/QXmppServer.cpp:138:7: warning: [readability-else-after-return]

    do not use 'else' after 'return'

        } else if (!serversForServers.isEmpty()) {
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • src/server/QXmppServer.cpp:151:15: warning: [cppcoreguidelines-init-variables]

    variable 'conn' is not initialized

            auto *conn = new QXmppOutgoingServer(domain, nullptr);
                  ^
    note: this fix will not be applied because it overlaps with another fix
  • src/server/QXmppServer.cpp:161:16: warning: [cppcoreguidelines-init-variables]

    variable 'q' is not initialized

            Q_EMIT q->setGauge("outgoing-server.count", outgoingServers.size());
                   ^
    note: this fix will not be applied because it overlaps with another fix
  • src/server/QXmppServer.cpp:161:16: warning: [readability-identifier-length]

    variable name 'q' is too short, expected at least 3 characters

  • src/server/QXmppServer.cpp:192:19: warning: [cppcoreguidelines-init-variables]

    variable 'domain' is not initialized

        const QString domain = server->domain();
                      ^
                             = 0
  • src/server/QXmppServer.cpp:193:19: warning: [cppcoreguidelines-init-variables]

    variable 'to' is not initialized

        const QString to = element.attribute("to");
                      ^
                         = 0
  • src/server/QXmppServer.cpp:193:19: warning: [readability-identifier-length]

    variable name 'to' is too short, expected at least 3 characters

  • src/server/QXmppServer.cpp:197:21: warning: [cppcoreguidelines-init-variables]

    variable 'request' is not initialized

                QXmppIq request;
                        ^
                                = 0
  • src/server/QXmppServer.cpp:201:25: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

                    QXmppIq response(QXmppIq::Error);
                            ^
  • src/server/QXmppServer.cpp:216:21: warning: [cppcoreguidelines-init-variables]

    variable 'request' is not initialized

                QXmppIq request;
                        ^
                                = 0
  • src/server/QXmppServer.cpp:219:21: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

                QXmppIq response(QXmppIq::Error);
                        ^
  • src/server/QXmppServer.cpp:231:26: warning: [readability-convert-member-functions-to-static]

    method 'info' can be made static

    void QXmppServerPrivate::info(const QString &message)
                             ^
    static 
  • src/server/QXmppServer.cpp:238:26: warning: [readability-convert-member-functions-to-static]

    method 'warning' can be made static

    void QXmppServerPrivate::warning(const QString &message)
                             ^
    static 
  • src/server/QXmppServer.cpp:288:18: warning: [cppcoreguidelines-init-variables]

    variable 'i' is not initialized

            for (int i = extensions.size() - 1; i >= 0; --i) {
                     ^
                       = 0
  • src/server/QXmppServer.cpp:888:7: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: caCertificates

    class QXmppSslServerPrivate
          ^
  • src/omemo/QXmppOmemoManager.cpp:6:10: error: [clang-diagnostic-error]

    'QXmppClient.h' file not found

    #include "QXmppClient.h"
             ^~~~~~~~~~~~~~~
  • src/omemo/QXmppOmemoManager.cpp:30:7: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: label, keyId

    class QXmppOmemoOwnDevicePrivate : public QSharedData
          ^
  • src/omemo/QXmppOmemoManager.cpp:106:7: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: jid, label, keyId

    class QXmppOmemoDevicePrivate : public QSharedData
          ^
  • src/omemo/QXmppOmemoData.cpp:415:52: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    QXmppOmemoDeviceBundle QXmppOmemoDeviceBundleItem::deviceBundle() const
                                                       ^
  • src/omemo/QXmppOmemoData.cpp:425:34: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    bool QXmppOmemoDeviceBundleItem::isItem(const QDomElement &itemElement)
    ~~~~                             ^
    auto                                                                    -> bool
  • src/omemo/QXmppOmemoData.cpp:440:48: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    QXmppOmemoDeviceList QXmppOmemoDeviceListItem::deviceList() const
                                                   ^
  • src/omemo/QXmppOmemoData.cpp:450:32: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    bool QXmppOmemoDeviceListItem::isItem(const QDomElement &itemElement)
    ~~~~                           ^
    auto                                                                  -> bool
  • src/omemo/QXmppOmemoManager_p.cpp:66:5: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: m_jid, m_deviceId

        Address(const QString &jid, uint32_t deviceId)
        ^
  • src/omemo/QXmppOmemoManager_p.cpp:66:13: warning: [bugprone-easily-swappable-parameters]

    2 adjacent parameters of 'Address' of similar type are easily swapped by mistake

        Address(const QString &jid, uint32_t deviceId)
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /home/runner/work/qxmpp/qxmpp/src/omemo/QXmppOmemoManager_p.cpp:66:28: note: the first parameter in the range is 'jid'
        Address(const QString &jid, uint32_t deviceId)
                               ^~~
    /home/runner/work/qxmpp/qxmpp/src/omemo/QXmppOmemoManager_p.cpp:66:42: note: the last parameter in the range is 'deviceId'
        Address(const QString &jid, uint32_t deviceId)
                                             ^~~~~~~~
    /home/runner/work/qxmpp/qxmpp/src/omemo/QXmppOmemoManager_p.cpp:66:33: note: 'const int &' and 'int' parameters accept and bind the same kind of values
        Address(const QString &jid, uint32_t deviceId)
                                    ^
  • src/omemo/QXmppOmemoManager_p.cpp:75:29: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

        signal_protocol_address data() const
                                ^
  • src/omemo/QXmppOmemoManager_p.cpp:90:30: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    static QXmppPubSubNodeConfig deviceListNodeConfig()
           ~~~~~~~~~~~~~~~~~~~~~ ^
           auto                                         -> QXmppPubSubNodeConfig
  • src/omemo/QXmppOmemoManager_p.cpp:103:34: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    static QXmppPubSubPublishOptions deviceListNodePublishOptions()
           ~~~~~~~~~~~~~~~~~~~~~~~~~ ^
           auto                                                     -> QXmppPubSubPublishOptions
  • src/omemo/QXmppOmemoManager_p.cpp:116:30: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    static QXmppPubSubNodeConfig deviceBundlesNodeConfig(QXmppPubSubNodeConfig::ItemLimit itemLimit = QXmppPubSubNodeConfig::Max())
           ~~~~~~~~~~~~~~~~~~~~~ ^
           auto                                                                                                                     -> QXmppPubSubNodeConfig
  • src/omemo/QXmppOmemoManager_p.cpp:130:34: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    static QXmppPubSubPublishOptions deviceBundlesNodePublishOptions(QXmppPubSubNodeConfig::ItemLimit itemLimit = QXmppPubSubNodeConfig::Max())
           ~~~~~~~~~~~~~~~~~~~~~~~~~ ^
           auto                                                                                                                                 -> QXmppPubSubPublishOptions
  • src/omemo/QXmppOmemoManager_p.cpp:148:12: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    static int deserializeSignedPublicPreKeySignature(const uint8_t **signedPublicPreKeySignature, const QByteArray &serializedSignedPublicPreKeySignature)
           ~~~ ^
           auto                                                                                                                                             -> int
  • src/omemo/QXmppOmemoManager_p.cpp:161:16: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    static QString extractJid(signal_protocol_address address)
                   ^
  • src/omemo/QXmppOmemoManager_p.cpp:166:16: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    static QString errorToString(const QXmppStanza::Error &err)
                   ^
  • src/omemo/QXmppOmemoManager_p.cpp:172:16: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    static QString errorToString(const QXmppError &err)
                   ^
  • src/omemo/QXmppOmemoManager_p.cpp:199:6: warning: [cppcoreguidelines-avoid-non-const-global-variables]

    variable 'mapToSuccess' is non-const and globally accessible, consider making it const

    auto mapToSuccess(std::variant<T, Err> var)
         ^
  • src/omemo/QXmppOmemoManager_p.cpp:204:1: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: cryptoLibInitializer, signedPreKeyPairsRenewalTimer, deviceRemovalTimer, ownDevice, preKeyPairs, signedPreKeyPairs, deviceBundle, jidsOfManuallySubscribedDevices, globalContext, storeContext, mutex, cryptoProvider, identityKeyStore, preKeyStore, signedPreKeyStore, sessionStore

    QXmppOmemoManagerPrivate::QXmppOmemoManagerPrivate(Manager *parent, QXmppOmemoStorage *omemoStorage)
    ^
  • src/omemo/QXmppOmemoManager_p.cpp:231:22: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    bool ManagerPrivate::initGlobalContext()
    ~~~~                 ^
    auto                                     -> bool
  • src/omemo/QXmppOmemoManager_p.cpp:231:22: warning: [readability-convert-member-functions-to-static]

    method 'initGlobalContext' can be made static

    bool ManagerPrivate::initGlobalContext()
                         ^
    static 
  • src/omemo/QXmppOmemoManager_p.cpp:238:16: warning: [readability-simplify-boolean-expr]

    redundant boolean literal in conditional return statement

            return false;
    ~~~~~~~~~~~~~~~^~~~~~
  • src/omemo/QXmppOmemoManager_p.cpp:249:22: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    bool ManagerPrivate::initLocking()
    ~~~~                 ^
    auto                               -> bool
  • src/omemo/QXmppOmemoManager_p.cpp:249:22: warning: [readability-convert-member-functions-to-static]

    method 'initLocking' can be made static

    bool ManagerPrivate::initLocking()
                         ^
    static 
  • src/omemo/QXmppOmemoManager_p.cpp:252:31: warning: [cppcoreguidelines-pro-type-reinterpret-cast]

    do not use reinterpret_cast

            const auto *manager = reinterpret_cast<Manager *>(user_data);
                                  ^
  • src/omemo/QXmppOmemoManager_p.cpp:253:15: warning: [readability-identifier-length]

    variable name 'd' is too short, expected at least 3 characters

            auto *d = manager->d.get();
                  ^
  • src/omemo/QXmppOmemoManager_p.cpp:258:31: warning: [cppcoreguidelines-pro-type-reinterpret-cast]

    do not use reinterpret_cast

            const auto *manager = reinterpret_cast<Manager *>(user_data);
                                  ^
  • src/omemo/QXmppOmemoManager_p.cpp:259:15: warning: [readability-identifier-length]

    variable name 'd' is too short, expected at least 3 characters

            auto *d = manager->d.get();
                  ^
  • src/omemo/QXmppOmemoManager_p.cpp:265:16: warning: [readability-simplify-boolean-expr]

    redundant boolean literal in conditional return statement

            return false;
    ~~~~~~~~~~~~~~~^~~~~~
  • src/omemo/QXmppOmemoManager_p.cpp:276:22: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    bool ManagerPrivate::initCryptoProvider()
    ~~~~                 ^
    auto                                      -> bool
  • src/omemo/QXmppOmemoManager_p.cpp:276:22: warning: [readability-convert-member-functions-to-static]

    method 'initCryptoProvider' can be made static

    bool ManagerPrivate::initCryptoProvider()
                         ^
    static 
  • src/omemo/QXmppOmemoManager_p.cpp:282:16: warning: [readability-simplify-boolean-expr]

    redundant boolean literal in conditional return statement

            return false;
    ~~~~~~~~~~~~~~~^~~~~~
  • src/omemo/QXmppOmemoManager_p.cpp:314:52: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    signal_protocol_identity_key_store ManagerPrivate::createIdentityKeyStore() const
                                                       ^
  • src/omemo/QXmppOmemoManager_p.cpp:316:40: warning: [cppcoreguidelines-init-variables]

    variable 'store' is not initialized

        signal_protocol_identity_key_store store;
                                           ^
                                                 = 0
  • src/omemo/QXmppOmemoManager_p.cpp:318:38: warning: [bugprone-easily-swappable-parameters]

    2 adjacent parameters of 'operator()' of similar type ('int **') are easily swapped by mistake

        store.get_identity_key_pair = [](signal_buffer **public_data, signal_buffer **private_data, void *user_data) {
                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /home/runner/work/qxmpp/qxmpp/src/omemo/QXmppOmemoManager_p.cpp:318:54: note: the first parameter in the range is 'public_data'
        store.get_identity_key_pair = [](signal_buffer **public_data, signal_buffer **private_data, void *user_data) {
                                                         ^~~~~~~~~~~
    /home/runner/work/qxmpp/qxmpp/src/omemo/QXmppOmemoManager_p.cpp:318:83: note: the last parameter in the range is 'private_data'
        store.get_identity_key_pair = [](signal_buffer **public_data, signal_buffer **private_data, void *user_data) {
                                                                                      ^~~~~~~~~~~~
  • src/omemo/QXmppOmemoManager_p.cpp:319:25: warning: [cppcoreguidelines-pro-type-reinterpret-cast]

    do not use reinterpret_cast

            auto *manager = reinterpret_cast<Manager *>(user_data);
                            ^
  • src/omemo/QXmppOmemoManager_p.cpp:320:21: warning: [readability-identifier-length]

    variable name 'd' is too short, expected at least 3 characters

            const auto *d = manager->d.get();
                        ^
  • src/omemo/QXmppOmemoManager_p.cpp:323:15: warning: [bugprone-assignment-in-if-condition]

    an assignment within an 'if' condition is bug-prone

            if (!(*private_data = signal_buffer_create(reinterpret_cast<const uint8_t *>(privateIdentityKey.constData()), privateIdentityKey.size()))) {
                  ^
    /home/runner/work/qxmpp/qxmpp/src/omemo/QXmppOmemoManager_p.cpp:323:15: note: if it should be an assignment, move it out of the 'if' condition
    /home/runner/work/qxmpp/qxmpp/src/omemo/QXmppOmemoManager_p.cpp:323:15: note: if it is meant to be an equality check, change '=' to '=='
  • src/omemo/QXmppOmemoManager_p.cpp:329:15: warning: [bugprone-assignment-in-if-condition]

    an assignment within an 'if' condition is bug-prone

            if (!(*public_data = signal_buffer_create(reinterpret_cast<const uint8_t *>(publicIdentityKey.constData()), publicIdentityKey.size()))) {
                  ^
    /home/runner/work/qxmpp/qxmpp/src/omemo/QXmppOmemoManager_p.cpp:329:15: note: if it should be an assignment, move it out of the 'if' condition
    /home/runner/work/qxmpp/qxmpp/src/omemo/QXmppOmemoManager_p.cpp:329:15: note: if it is meant to be an equality check, change '=' to '=='
  • src/omemo/QXmppOmemoManager_p.cpp:338:31: warning: [cppcoreguidelines-pro-type-reinterpret-cast]

    do not use reinterpret_cast

            const auto *manager = reinterpret_cast<Manager *>(user_data);
                                  ^
  • src/omemo/QXmppOmemoManager_p.cpp:339:21: warning: [readability-identifier-length]

    variable name 'd' is too short, expected at least 3 characters

            const auto *d = manager->d.get();
                        ^
  • src/omemo/QXmppOmemoManager_p.cpp:370:54: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    signal_protocol_signed_pre_key_store ManagerPrivate::createSignedPreKeyStore() const
                                                         ^
  • src/omemo/QXmppOmemoManager_p.cpp:372:42: warning: [cppcoreguidelines-init-variables]

    variable 'store' is not initialized

        signal_protocol_signed_pre_key_store store;
                                             ^
                                                   = 0
  • src/omemo/QXmppOmemoManager_p.cpp:375:25: warning: [cppcoreguidelines-pro-type-reinterpret-cast]

    do not use reinterpret_cast

            auto *manager = reinterpret_cast<Manager *>(user_data);
                            ^
  • src/omemo/QXmppOmemoManager_p.cpp:376:21: warning: [readability-identifier-length]

    variable name 'd' is too short, expected at least 3 characters

            const auto *d = manager->d.get();
                        ^
  • src/omemo/QXmppOmemoManager_p.cpp:383:15: warning: [bugprone-assignment-in-if-condition]

    an assignment within an 'if' condition is bug-prone

            if (!(*record = signal_buffer_create(reinterpret_cast<const uint8_t *>(signedPreKeyPair.constData()), signedPreKeyPair.size()))) {
                  ^
    /home/runner/work/qxmpp/qxmpp/src/omemo/QXmppOmemoManager_p.cpp:383:15: note: if it should be an assignment, move it out of the 'if' condition
    /home/runner/work/qxmpp/qxmpp/src/omemo/QXmppOmemoManager_p.cpp:383:15: note: if it is meant to be an equality check, change '=' to '=='
  • src/omemo/QXmppOmemoManager_p.cpp:392:25: warning: [cppcoreguidelines-pro-type-reinterpret-cast]

    do not use reinterpret_cast

            auto *manager = reinterpret_cast<Manager *>(user_data);
                            ^
  • src/omemo/QXmppOmemoManager_p.cpp:393:15: warning: [readability-identifier-length]

    variable name 'd' is too short, expected at least 3 characters

            auto *d = manager->d.get();
                  ^
  • src/omemo/QXmppOmemoManager_p.cpp:395:45: warning: [cppcoreguidelines-init-variables]

    variable 'signedPreKeyPair' is not initialized

            QXmppOmemoStorage::SignedPreKeyPair signedPreKeyPair;
                                                ^
                                                                 = 0
  • src/omemo/QXmppOmemoManager_p.cpp:397:44: warning: [cppcoreguidelines-pro-type-reinterpret-cast]

    do not use reinterpret_cast

            signedPreKeyPair.data = QByteArray(reinterpret_cast<const char *>(record), record_len);
                                               ^
  • src/omemo/QXmppOmemoManager_p.cpp:406:31: warning: [cppcoreguidelines-pro-type-reinterpret-cast]

    do not use reinterpret_cast

            const auto *manager = reinterpret_cast<Manager *>(user_data);
                                  ^
  • src/omemo/QXmppOmemoManager_p.cpp:407:21: warning: [readability-identifier-length]

    variable name 'd' is too short, expected at least 3 characters

            const auto *d = manager->d.get();
                        ^
  • src/omemo/QXmppOmemoManager_p.cpp:412:31: warning: [cppcoreguidelines-pro-type-reinterpret-cast]

    do not use reinterpret_cast

            const auto *manager = reinterpret_cast<Manager *>(user_data);
                                  ^
  • src/omemo/QXmppOmemoManager_p.cpp:413:15: warning: [readability-identifier-length]

    variable name 'd' is too short, expected at least 3 characters

            auto *d = manager->d.get();
                  ^
  • src/omemo/QXmppOmemoManager_p.cpp:434:47: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    signal_protocol_pre_key_store ManagerPrivate::createPreKeyStore() const
                                                  ^
  • src/omemo/QXmppOmemoManager_p.cpp:436:35: warning: [cppcoreguidelines-init-variables]

    variable 'store' is not initialized

        signal_protocol_pre_key_store store;
                                      ^
                                            = 0
  • src/omemo/QXmppOmemoManager_p.cpp:439:25: warning: [cppcoreguidelines-pro-type-reinterpret-cast]

    do not use reinterpret_cast

            auto *manager = reinterpret_cast<Manager *>(user_data);
                            ^
  • src/omemo/QXmppOmemoManager_p.cpp:440:21: warning: [readability-identifier-length]

    variable name 'd' is too short, expected at least 3 characters

            const auto *d = manager->d.get();
                        ^
  • src/omemo/QXmppOmemoManager_p.cpp:447:15: warning: [bugprone-assignment-in-if-condition]

    an assignment within an 'if' condition is bug-prone

            if (!(*record = signal_buffer_create(reinterpret_cast<const uint8_t *>(preKey.constData()), preKey.size()))) {
                  ^
    /home/runner/work/qxmpp/qxmpp/src/omemo/QXmppOmemoManager_p.cpp:447:15: note: if it should be an assignment, move it out of the 'if' condition
    /home/runner/work/qxmpp/qxmpp/src/omemo/QXmppOmemoManager_p.cpp:447:15: note: if it is meant to be an equality check, change '=' to '=='
  • src/omemo/QXmppOmemoManager_p.cpp:456:31: warning: [cppcoreguidelines-pro-type-reinterpret-cast]

    do not use reinterpret_cast

            const auto *manager = reinterpret_cast<Manager *>(user_data);
                                  ^
  • src/omemo/QXmppOmemoManager_p.cpp:457:15: warning: [readability-identifier-length]

    variable name 'd' is too short, expected at least 3 characters

            auto *d = manager->d.get();
                  ^
  • src/omemo/QXmppOmemoManager_p.cpp:458:40: warning: [cppcoreguidelines-pro-type-reinterpret-cast]

    do not use reinterpret_cast

            const auto preKey = QByteArray(reinterpret_cast<const char *>(record), record_len);
                                           ^
  • src/omemo/QXmppOmemoManager_p.cpp:465:31: warning: [cppcoreguidelines-pro-type-reinterpret-cast]

    do not use reinterpret_cast

            const auto *manager = reinterpret_cast<Manager *>(user_data);
                                  ^
  • src/omemo/QXmppOmemoManager_p.cpp:466:21: warning: [readability-identifier-length]

    variable name 'd' is too short, expected at least 3 characters

            const auto *d = manager->d.get();
                        ^
  • src/omemo/QXmppOmemoManager_p.cpp:471:25: warning: [cppcoreguidelines-pro-type-reinterpret-cast]

    do not use reinterpret_cast

            auto *manager = reinterpret_cast<Manager *>(user_data);
                            ^
  • src/omemo/QXmppOmemoManager_p.cpp:472:15: warning: [readability-identifier-length]

    variable name 'd' is too short, expected at least 3 characters

            auto *d = manager->d.get();
                  ^
  • src/omemo/QXmppOmemoManager_p.cpp:496:47: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    signal_protocol_session_store ManagerPrivate::createSessionStore() const
                                                  ^
  • src/omemo/QXmppOmemoManager_p.cpp:498:35: warning: [cppcoreguidelines-init-variables]

    variable 'store' is not initialized

        signal_protocol_session_store store;
                                      ^
                                            = 0
  • src/omemo/QXmppOmemoManager_p.cpp:501:25: warning: [cppcoreguidelines-pro-type-reinterpret-cast]

    do not use reinterpret_cast

            auto *manager = reinterpret_cast<Manager *>(user_data);
                            ^
  • src/omemo/QXmppOmemoManager_p.cpp:502:21: warning: [readability-identifier-length]

    variable name 'd' is too short, expected at least 3 characters

            const auto *d = manager->d.get();
                        ^
  • src/omemo/QXmppOmemoManager_p.cpp:511:15: warning: [bugprone-assignment-in-if-condition]

    an assignment within an 'if' condition is bug-prone

            if (!(*record = signal_buffer_create(reinterpret_cast<const uint8_t *>(session.constData()), size_t(session.size())))) {
                  ^
    /home/runner/work/qxmpp/qxmpp/src/omemo/QXmppOmemoManager_p.cpp:511:15: note: if it should be an assignment, move it out of the 'if' condition
    /home/runner/work/qxmpp/qxmpp/src/omemo/QXmppOmemoManager_p.cpp:511:15: note: if it is meant to be an equality check, change '=' to '=='
  • src/omemo/QXmppOmemoManager_p.cpp:520:25: warning: [cppcoreguidelines-pro-type-reinterpret-cast]

    do not use reinterpret_cast

            auto *manager = reinterpret_cast<Manager *>(user_data);
                            ^
  • src/omemo/QXmppOmemoManager_p.cpp:521:21: warning: [readability-identifier-length]

    variable name 'd' is too short, expected at least 3 characters

            const auto *d = manager->d.get();
                        ^
  • src/omemo/QXmppOmemoManager_p.cpp:535:26: warning: [cppcoreguidelines-init-variables]

    variable 'deviceIds' is not initialized

            signal_int_list *deviceIds = signal_int_list_alloc();
                             ^
                                       = nullptr
  • src/omemo/QXmppOmemoManager_p.cpp:549:31: warning: [cppcoreguidelines-pro-type-reinterpret-cast]

    do not use reinterpret_cast

            const auto *manager = reinterpret_cast<Manager *>(user_data);
                                  ^
  • src/omemo/QXmppOmemoManager_p.cpp:550:15: warning: [readability-identifier-length]

    variable name 'd' is too short, expected at least 3 characters

            auto *d = manager->d.get();
                  ^
  • src/omemo/QXmppOmemoManager_p.cpp:551:41: warning: [cppcoreguidelines-pro-type-reinterpret-cast]

    do not use reinterpret_cast

            const auto session = QByteArray(reinterpret_cast<const char *>(record), record_len);
                                            ^
  • src/omemo/QXmppOmemoManager_p.cpp:562:31: warning: [cppcoreguidelines-pro-type-reinterpret-cast]

    do not use reinterpret_cast

            const auto *manager = reinterpret_cast<Manager *>(user_data);
                                  ^
  • src/omemo/QXmppOmemoManager_p.cpp:563:21: warning: [readability-identifier-length]

    variable name 'd' is too short, expected at least 3 characters

            const auto *d = manager->d.get();
                        ^
  • src/omemo/QXmppOmemoManager_p.cpp:569:31: warning: [cppcoreguidelines-pro-type-reinterpret-cast]

    do not use reinterpret_cast

            const auto *manager = reinterpret_cast<Manager *>(user_data);
                                  ^
  • src/omemo/QXmppOmemoManager_p.cpp:570:15: warning: [readability-identifier-length]

    variable name 'd' is too short, expected at least 3 characters

            auto *d = manager->d.get();
                  ^
  • src/omemo/QXmppOmemoManager_p.cpp:582:31: warning: [cppcoreguidelines-pro-type-reinterpret-cast]

    do not use reinterpret_cast

            const auto *manager = reinterpret_cast<Manager *>(user_data);
                                  ^
  • src/omemo/QXmppOmemoManager_p.cpp:583:15: warning: [readability-identifier-length]

    variable name 'd' is too short, expected at least 3 characters

            auto *d = manager->d.get();
                  ^
  • src/omemo/QXmppOmemoManager_p.cpp:616:33: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    QXmppTask<bool> ManagerPrivate::setUpDeviceId()
                                    ^
  • src/omemo/QXmppOmemoManager_p.cpp:654:51: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    std::optional<uint32_t> QXmppOmemoManagerPrivate::generateDeviceId()
                                                      ^
  • src/omemo/QXmppOmemoManager_p.cpp:656:14: warning: [cppcoreguidelines-init-variables]

    variable 'deviceId' is not initialized

        uint32_t deviceId = 0;
                 ^
                          = 0
  • src/omemo/QXmppOmemoManager_p.cpp:669:51: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    std::optional<uint32_t> QXmppOmemoManagerPrivate::generateDeviceId(const QVector<QString> &existingIds)
                                                      ^
  • src/omemo/QXmppOmemoManager_p.cpp:671:14: warning: [cppcoreguidelines-init-variables]

    variable 'deviceId' is not initialized

        uint32_t deviceId = 0;
                 ^
                          = 0
  • src/omemo/QXmppOmemoManager_p.cpp:690:22: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    bool ManagerPrivate::setUpIdentityKeyPair(ratchet_identity_key_pair **identityKeyPair)
    ~~~~                 ^
    auto                                                                                   -> bool
  • src/omemo/QXmppOmemoManager_p.cpp:690:22: warning: [readability-convert-member-functions-to-static]

    method 'setUpIdentityKeyPair' can be made static

    bool ManagerPrivate::setUpIdentityKeyPair(ratchet_identity_key_pair **identityKeyPair)
                         ^
    static 
  • src/omemo/QXmppOmemoManager_p.cpp:736:22: warning: [readability-convert-member-functions-to-static]

    method 'renewSignedPreKeyPairs' can be made static

    void ManagerPrivate::renewSignedPreKeyPairs()
                         ^
  • src/omemo/QXmppOmemoManager_p.cpp:756:50: warning: [cppcoreguidelines-init-variables]

    variable 'identityKeyPair' is not initialized

            RefCountedPtr<ratchet_identity_key_pair> identityKeyPair;
                                                     ^
                                                                     = 0
  • src/omemo/QXmppOmemoManager_p.cpp:786:22: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    bool ManagerPrivate::updateSignedPreKeyPair(ratchet_identity_key_pair *identityKeyPair)
    ~~~~                 ^
    auto                                                                                    -> bool
  • src/omemo/QXmppOmemoManager_p.cpp:788:43: warning: [cppcoreguidelines-init-variables]

    variable 'signedPreKeyPair' is not initialized

        RefCountedPtr<session_signed_pre_key> signedPreKeyPair;
                                              ^
                                                               = 0

Have any feedback or feature suggestions? Share it here.

Please sign in to comment.