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 Jun 20, 2024
2 parents c2a029d + 9ac90ab commit 3fa204e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
7 changes: 4 additions & 3 deletions src/omemo/QXmppOmemoManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1023,8 +1023,7 @@ QXmppTask<QXmppE2eeExtension::MessageDecryptResult> QXmppOmemoManager::decryptMe
SendError::EncryptionError });
}

auto omemoElement = message.omemoElement();
if (!omemoElement) {
if (!message.omemoElement()) {
return makeReadyTask<MessageDecryptResult>(NotEncrypted());
}

Expand Down Expand Up @@ -1163,9 +1162,11 @@ bool Manager::handleMessage(const QXmppMessage &message)
{
if (d->isStarted && message.omemoElement()) {
auto future = d->decryptMessage(message);
future.then(this, [=](std::optional<QXmppMessage> optionalDecryptedMessage) mutable {
future.then(this, [this, message](std::optional<QXmppMessage> optionalDecryptedMessage) {
if (optionalDecryptedMessage) {
injectMessage(std::move(*optionalDecryptedMessage));
} else {
Q_EMIT client()->messageReceived(message);
}
});

Expand Down
35 changes: 20 additions & 15 deletions src/omemo/QXmppOmemoManager_p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1074,17 +1074,6 @@ QXmppTask<std::optional<QXmppOmemoElement>> ManagerPrivate::encryptStanza(const
const auto &deviceId = itr.key();
const auto &device = itr.value();

// Skip encrypting for a device if it does not respond for a while.
if (const auto unrespondedSentStanzasCount = device.unrespondedSentStanzasCount; unrespondedSentStanzasCount == UNRESPONDED_STANZAS_UNTIL_ENCRYPTION_IS_STOPPED) {
if (++(*skippedDevicesCount) == devicesCount) {
warning("OMEMO element could not be created because no recipient device responded to " %
QString::number(unrespondedSentStanzasCount) % " sent stanzas");
interface.finish(std::nullopt);
}

continue;
}

auto controlDeviceProcessing = [=](bool isSuccessful = true) mutable {
if (isSuccessful) {
++(*successfullyProcessedDevicesCount);
Expand All @@ -1103,6 +1092,19 @@ QXmppTask<std::optional<QXmppOmemoElement>> ManagerPrivate::encryptStanza(const
}
};

// Skip encrypting for a device if it does not respond for a while.
if (const auto unrespondedSentStanzasCount = device.unrespondedSentStanzasCount; unrespondedSentStanzasCount == UNRESPONDED_STANZAS_UNTIL_ENCRYPTION_IS_STOPPED) {
if (++(*skippedDevicesCount) == devicesCount) {
warning("OMEMO element could not be created because no recipient device responded to " %
QString::number(unrespondedSentStanzasCount) % " sent stanzas");
interface.finish(std::nullopt);
} else {
controlDeviceProcessing(false);
}

continue;
}

const auto address = Address(jid, deviceId);

auto addOmemoEnvelope = [=](bool isKeyExchange = false) mutable {
Expand All @@ -1117,7 +1119,11 @@ QXmppTask<std::optional<QXmppOmemoElement>> ManagerPrivate::encryptStanza(const
} else if (devices.value(jid).contains(deviceId)) {
auto &deviceBeingModified = devices[jid][deviceId];
deviceBeingModified.unrespondedReceivedStanzasCount = 0;
++deviceBeingModified.unrespondedSentStanzasCount;

if (auto &unrespondedSentStanzasCount = deviceBeingModified.unrespondedSentStanzasCount; unrespondedSentStanzasCount + 1 <= UNRESPONDED_STANZAS_UNTIL_ENCRYPTION_IS_STOPPED) {
++unrespondedSentStanzasCount;
}

omemoStorage->addDevice(jid, deviceId, deviceBeingModified);

QXmppOmemoEnvelope omemoEnvelope;
Expand Down Expand Up @@ -1633,13 +1639,12 @@ QXmppTask<std::optional<QCA::SecureArray>> ManagerPrivate::extractPayloadDecrypt
warning("OMEMO envelope data could not be deserialized");
interface.finish(std::nullopt);
} else {
BufferPtr publicIdentityKeyBuffer;
BufferPtr publicIdentityKeyBuffer(ec_public_key_get_ed(pre_key_signal_message_get_identity_key(omemoEnvelopeData.get())));

if (ec_public_key_serialize(publicIdentityKeyBuffer.ptrRef(), pre_key_signal_message_get_identity_key(omemoEnvelopeData.get())) < 0) {
if (const auto key = publicIdentityKeyBuffer.toByteArray(); key.isEmpty()) {
warning("Public Identity key could not be retrieved");
interface.finish(std::nullopt);
} else {
const auto key = publicIdentityKeyBuffer.toByteArray();
auto &device = devices[senderJid][senderDeviceId];
auto &storedKeyId = device.keyId;

Expand Down

1 comment on commit 3fa204e

@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 reports: 4 file(s) not formatted
  • tests/qxmppversionmanager/tst_qxmppversionmanager.cpp
  • tests/qxmppentitytimemanager/tst_qxmppentitytimemanager.cpp
  • src/client/QXmppBlockingManager.h
  • src/base/QXmppPubSubIq_p.h
clang-tidy reports: 4513 concern(s)
  • src/client/QXmppIqHandling.cpp:7:22: warning: [cppcoreguidelines-avoid-non-const-global-variables]

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

    void QXmpp::Private::sendIqReply(QXmppClient *client,
                         ^
  • src/client/QXmppCall.cpp:24:1: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: direction, jid, ownJid, requests, sid, state, streams

    QXmppCallPrivate::QXmppCallPrivate(QXmppCall *qq)
    ^
  • src/client/QXmppCall.cpp:24:47: warning: [readability-identifier-length]

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

    QXmppCallPrivate::QXmppCallPrivate(QXmppCall *qq)
                                                  ^
  • src/client/QXmppCall.cpp:26:15: warning: [modernize-use-nullptr]

    use nullptr

          manager(0),
                  ^
                  nullptr
  • src/client/QXmppCall.cpp:36:5: warning: [cppcoreguidelines-prefer-member-initializer]

    'pipeline' should be initialized in a member initializer of the constructor

        pipeline = gst_pipeline_new(nullptr);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • src/client/QXmppCall.cpp:37:10: warning: [readability-implicit-bool-conversion]

    implicit conversion 'GstElement *' (aka '_GstElement *') -> bool

        if (!pipeline) {
            ~^
                      == nullptr
  • src/client/QXmppCall.cpp:42:10: warning: [readability-implicit-bool-conversion]

    implicit conversion 'GstElement *' (aka '_GstElement *') -> bool

        if (!rtpbin) {
            ~^
                    == nullptr
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppCall.cpp:47:86: warning: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]
        g_object_set(rtpbin, "drop-on-latency", true, "async-handling", true, "latency", 25, nullptr);
                                                                                         ^
  • src/client/QXmppCall.cpp:52:63: warning: [readability-identifier-length]

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

                                 G_CALLBACK(+[](QXmppCallPrivate *p, GstPad *pad) {
                                                                  ^
  • src/client/QXmppCall.cpp:57:63: warning: [readability-identifier-length]

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

                                 G_CALLBACK(+[](QXmppCallPrivate *p, uint sessionId, uint pt) {
                                                                  ^
  • src/client/QXmppCall.cpp:57:66: warning: [bugprone-easily-swappable-parameters]

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

                                 G_CALLBACK(+[](QXmppCallPrivate *p, uint sessionId, uint pt) {
                                                                     ^~~~~~~~~~~~~~~~~~~~~~~
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppCall.cpp:57:71: note: the first parameter in the range is 'sessionId'
                                 G_CALLBACK(+[](QXmppCallPrivate *p, uint sessionId, uint pt) {
                                                                          ^~~~~~~~~
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppCall.cpp:57:87: note: the last parameter in the range is 'pt'
                                 G_CALLBACK(+[](QXmppCallPrivate *p, uint sessionId, uint pt) {
                                                                                          ^~
  • src/client/QXmppCall.cpp:57:66: warning: [bugprone-easily-swappable-parameters]

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

                                 G_CALLBACK(+[](QXmppCallPrivate *p, uint sessionId, uint pt) {
                                                                     ^~~~~~~~~~~~~~~~~~~~~~~
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppCall.cpp:57:71: note: the first parameter in the range is 'sessionId'
                                 G_CALLBACK(+[](QXmppCallPrivate *p, uint sessionId, uint pt) {
                                                                          ^~~~~~~~~
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppCall.cpp:57:87: note: the last parameter in the range is 'pt'
                                 G_CALLBACK(+[](QXmppCallPrivate *p, uint sessionId, uint pt) {
                                                                                          ^~
  • src/client/QXmppCall.cpp:57:87: warning: [readability-identifier-length]

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

                                 G_CALLBACK(+[](QXmppCallPrivate *p, uint sessionId, uint pt) {
                                                                                          ^
  • src/client/QXmppCall.cpp:62:63: warning: [readability-identifier-length]

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

                                 G_CALLBACK(+[](QXmppCallPrivate *p, uint sessionId, uint ssrc) {
                                                                  ^
  • src/client/QXmppCall.cpp:62:66: warning: [bugprone-easily-swappable-parameters]

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

                                 G_CALLBACK(+[](QXmppCallPrivate *p, uint sessionId, uint ssrc) {
                                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppCall.cpp:62:71: note: the first parameter in the range is 'sessionId'
                                 G_CALLBACK(+[](QXmppCallPrivate *p, uint sessionId, uint ssrc) {
                                                                          ^~~~~~~~~
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppCall.cpp:62:87: note: the last parameter in the range is 'ssrc'
                                 G_CALLBACK(+[](QXmppCallPrivate *p, uint sessionId, uint ssrc) {
                                                                                          ^~~~
  • src/client/QXmppCall.cpp:62:66: warning: [bugprone-easily-swappable-parameters]

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

                                 G_CALLBACK(+[](QXmppCallPrivate *p, uint sessionId, uint ssrc) {
                                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppCall.cpp:62:71: note: the first parameter in the range is 'sessionId'
                                 G_CALLBACK(+[](QXmppCallPrivate *p, uint sessionId, uint ssrc) {
                                                                          ^~~~~~~~~
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppCall.cpp:62:87: note: the last parameter in the range is 'ssrc'
                                 G_CALLBACK(+[](QXmppCallPrivate *p, uint sessionId, uint ssrc) {
                                                                                          ^~~~
  • src/client/QXmppCall.cpp:82:35: warning: [bugprone-easily-swappable-parameters]

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

    void QXmppCallPrivate::ssrcActive(uint sessionId, uint ssrc)
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppCall.cpp:82:40: note: the first parameter in the range is 'sessionId'
    void QXmppCallPrivate::ssrcActive(uint sessionId, uint ssrc)
                                           ^~~~~~~~~
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppCall.cpp:82:56: note: the last parameter in the range is 'ssrc'
    void QXmppCallPrivate::ssrcActive(uint sessionId, uint ssrc)
                                                           ^~~~
  • src/client/QXmppCall.cpp:85:17: warning: [cppcoreguidelines-init-variables]

    variable 'rtpSession' is not initialized

        GstElement *rtpSession;
                    ^
                               = nullptr
  • src/client/QXmppCall.cpp:103:9: warning: [readability-qualified-auto]

    'auto stream' can be declared as 'auto *stream'

            auto stream = findStreamById(sessionId);
            ^~~~~
            auto *
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppCall.cpp:108:33: warning: 6 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]
            if (nameParts.size() != 6) {
                                    ^
  • src/client/QXmppCall.cpp:112:13: warning: [readability-identifier-length]

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

            int pt = nameParts[5].toInt();
                ^
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppCall.cpp:112:28: warning: 5 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]
            int pt = nameParts[5].toInt();
                               ^
  • src/client/QXmppCall.cpp:113:9: warning: [readability-qualified-auto]

    'auto stream' can be declared as 'auto *stream'

            auto stream = findStreamById(sessionId);
            ^~~~~
            auto *
  • src/client/QXmppCall.cpp:114:45: warning: [bugprone-branch-clone]

    repeated branch in conditional chain

            if (stream->media() == VIDEO_MEDIA) {
                                                ^
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppCall.cpp:121:10: note: end of the original
            } else if (stream->media() == AUDIO_MEDIA) {
             ^
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppCall.cpp:121:52: note: clone 1 starts here
            } else if (stream->media() == AUDIO_MEDIA) {
                                                       ^
  • src/client/QXmppCall.cpp:132:28: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    GstCaps *QXmppCallPrivate::ptMap(uint sessionId, uint pt)
                               ^
  • src/client/QXmppCall.cpp:132:34: warning: [bugprone-easily-swappable-parameters]

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

    GstCaps *QXmppCallPrivate::ptMap(uint sessionId, uint pt)
                                     ^~~~~~~~~~~~~~~~~~~~~~~
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppCall.cpp:132:39: note: the first parameter in the range is 'sessionId'
    GstCaps *QXmppCallPrivate::ptMap(uint sessionId, uint pt)
                                          ^~~~~~~~~
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppCall.cpp:132:55: note: the last parameter in the range is 'pt'
    GstCaps *QXmppCallPrivate::ptMap(uint sessionId, uint pt)
                                                          ^~
  • src/client/QXmppCall.cpp:148:24: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    bool QXmppCallPrivate::isFormatSupported(const QString &codecName) const
    ~~~~                   ^
    auto                                                                     -> bool
  • src/client/QXmppCall.cpp:148:24: warning: [readability-convert-member-functions-to-static]

    method 'isFormatSupported' can be made static

    bool QXmppCallPrivate::isFormatSupported(const QString &codecName) const
                           ^                                           ~~~~~
    static 
  • src/client/QXmppCall.cpp:150:24: warning: [cppcoreguidelines-init-variables]

    variable 'factory' is not initialized

        GstElementFactory *factory;
                           ^
                                   = nullptr
  • src/client/QXmppCall.cpp:159:24: warning: [readability-convert-member-functions-to-static]

    method 'filterGStreamerFormats' can be made static

    void QXmppCallPrivate::filterGStreamerFormats(QList<GstCodec> &formats)
                           ^
    static 
  • src/client/QXmppCall.cpp:161:10: warning: [readability-identifier-length]

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

        auto it = formats.begin();
             ^
  • src/client/QXmppCall.cpp:163:14: warning: [cppcoreguidelines-init-variables]

    variable 'supported' is not initialized

            bool supported = isFormatSupported(it->gstPay) &&
                 ^
                           = false
  • src/client/QXmppCall.cpp:175:36: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    QXmppCallStream *QXmppCallPrivate::findStreamByMedia(const QString &media)
    ~~~~~~~~~~~~~~~~~                  ^
    auto                                                                       -> QXmppCallStream *
  • src/client/QXmppCall.cpp:175:36: warning: [readability-convert-member-functions-to-static]

    method 'findStreamByMedia' can be made static

    QXmppCallStream *QXmppCallPrivate::findStreamByMedia(const QString &media)
                                       ^
    static 
  • src/client/QXmppCall.cpp:185:36: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    QXmppCallStream *QXmppCallPrivate::findStreamByName(const QString &name)
    ~~~~~~~~~~~~~~~~~                  ^
    auto                                                                     -> QXmppCallStream *
  • src/client/QXmppCall.cpp:185:36: warning: [readability-convert-member-functions-to-static]

    method 'findStreamByName' can be made static

    QXmppCallStream *QXmppCallPrivate::findStreamByName(const QString &name)
                                       ^
    static 
  • src/client/QXmppCall.cpp:195:36: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    QXmppCallStream *QXmppCallPrivate::findStreamById(const int id)
    ~~~~~~~~~~~~~~~~~                  ^
    auto                                                            -> QXmppCallStream *
  • src/client/QXmppCall.cpp:195:36: warning: [readability-convert-member-functions-to-static]

    method 'findStreamById' can be made static

    QXmppCallStream *QXmppCallPrivate::findStreamById(const int id)
                                       ^
  • src/client/QXmppCall.cpp:195:61: warning: [readability-identifier-length]

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

    QXmppCallStream *QXmppCallPrivate::findStreamById(const int id)
                                                                ^
  • src/client/QXmppCall.cpp:205:24: warning: [readability-convert-member-functions-to-static]

    method 'handleAck' can be made static

    void QXmppCallPrivate::handleAck(const QXmppIq &ack)
                           ^
  • src/client/QXmppCall.cpp:207:19: warning: [cppcoreguidelines-init-variables]

    variable 'id' is not initialized

        const QString id = ack.id();
                      ^
                         = 0
  • src/client/QXmppCall.cpp:207:19: warning: [readability-identifier-length]

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

  • src/client/QXmppCall.cpp:223:24: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    bool QXmppCallPrivate::handleDescription(QXmppCallStream *stream, const QXmppJingleIq::Content &content)
    ~~~~                   ^
    auto                                                                                                     -> bool
  • src/client/QXmppCall.cpp:223:24: warning: [readability-convert-member-functions-to-static]

    method 'handleDescription' can be made static

    bool QXmppCallPrivate::handleDescription(QXmppCallStream *stream, const QXmppJingleIq::Content &content)
                           ^
    static 
  • src/client/QXmppCall.cpp:226:10: warning: [readability-identifier-length]

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

        auto it = stream->d->payloadTypes.begin();
             ^
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppCall.cpp:229:36: warning: 96 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]
            bool dynamic = it->id() >= 96;
                                       ^
  • src/client/QXmppCall.cpp:269:16: warning: [readability-simplify-boolean-expr]

    redundant boolean literal in conditional return statement

            return false;
    ~~~~~~~~~~~~~~~^~~~~~
  • src/client/QXmppCall.cpp:275:24: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    bool QXmppCallPrivate::handleTransport(QXmppCallStream *stream, const QXmppJingleIq::Content &content)
    ~~~~                   ^
    auto                                                                                                   -> bool
  • src/client/QXmppCall.cpp:275:24: warning: [readability-convert-member-functions-to-static]

    method 'handleTransport' can be made static

    bool QXmppCallPrivate::handleTransport(QXmppCallStream *stream, const QXmppJingleIq::Content &content)
                           ^
    static 
  • src/client/QXmppCall.cpp:291:59: warning: [readability-identifier-length]

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

    void QXmppCallPrivate::handleRequest(const QXmppJingleIq &iq)
                                                              ^
  • src/client/QXmppCall.cpp:306:26: warning: [cppcoreguidelines-init-variables]

    variable 'stream' is not initialized

            QXmppCallStream *stream = findStreamByName(content.name());
                             ^
                                    = nullptr
  • src/client/QXmppCall.cpp:339:26: warning: [cppcoreguidelines-init-variables]

    variable 'stream' is not initialized

            QXmppCallStream *stream = findStreamByName(content.name());
                             ^
                                    = nullptr
  • src/client/QXmppCall.cpp:354:26: warning: [cppcoreguidelines-init-variables]

    variable 'stream' is not initialized

            QXmppCallStream *stream = findStreamByName(content.name());
                             ^
                                    = nullptr
  • src/client/QXmppCall.cpp:355:13: warning: [readability-implicit-bool-conversion]

    implicit conversion 'QXmppCallStream *' -> bool

            if (stream) {
                ^
                       != nullptr
  • src/client/QXmppCall.cpp:361:14: warning: [readability-implicit-bool-conversion]

    implicit conversion 'QXmppCallStream *' -> bool

            if (!stream) {
                ~^
                        == nullptr
  • src/client/QXmppCall.cpp:370:27: warning: [readability-identifier-length]

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

                QXmppJingleIq iq;
                              ^
  • src/client/QXmppCall.cpp:378:13: warning: [cppcoreguidelines-owning-memory]

    deleting a pointer through a type that is not marked 'gsl::owner<>'; consider using a smart pointer instead

                delete stream;
                ^      ~~~~~~
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppCall.cpp:354:9: note: variable declared here
            QXmppCallStream *stream = findStreamByName(content.name());
            ^~~~~~~~~~~~~~~~~~~~~~~
  • src/client/QXmppCall.cpp:383:23: warning: [readability-identifier-length]

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

            QXmppJingleIq iq;
                          ^
  • src/client/QXmppCall.cpp:397:26: warning: [cppcoreguidelines-init-variables]

    variable 'stream' is not initialized

            QXmppCallStream *stream = findStreamByName(content.name());
                             ^
                                    = nullptr
  • src/client/QXmppCall.cpp:406:36: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    QXmppCallStream *QXmppCallPrivate::createStream(const QString &media, const QString &creator, const QString &name)
    ~~~~~~~~~~~~~~~~~                  ^
    auto                                                                                                               -> QXmppCallStream *
  • src/client/QXmppCall.cpp:406:49: warning: [bugprone-easily-swappable-parameters]

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

    QXmppCallStream *QXmppCallPrivate::createStream(const QString &media, const QString &creator, const QString &name)
                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppCall.cpp:406:64: note: the first parameter in the range is 'media'
    QXmppCallStream *QXmppCallPrivate::createStream(const QString &media, const QString &creator, const QString &name)
                                                                   ^~~~~
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppCall.cpp:406:110: note: the last parameter in the range is 'name'
    QXmppCallStream *QXmppCallPrivate::createStream(const QString &media, const QString &creator, const QString &name)
                                                                                                                 ^~~~
  • src/client/QXmppCall.cpp:420:11: warning: [cppcoreguidelines-init-variables]

    variable 'stream' is not initialized

        auto *stream = new QXmppCallStream(pipeline, rtpbin, media, creator, name, ++nextId);
              ^
                     = nullptr
  • src/client/QXmppCall.cpp:448:12: warning: [cppcoreguidelines-init-variables]

    variable 'q' is not initialized

        Q_EMIT q->streamCreated(stream);
               ^
                 = 0
  • src/client/QXmppCall.cpp:448:12: warning: [readability-identifier-length]

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

  • src/client/QXmppCall.cpp:453:42: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    QXmppJingleIq::Content QXmppCallPrivate::localContent(QXmppCallStream *stream) const
                                             ^
  • src/client/QXmppCall.cpp:455:28: warning: [cppcoreguidelines-init-variables]

    variable 'content' is not initialized

        QXmppJingleIq::Content content;
                               ^
                                       = 0
  • src/client/QXmppCall.cpp:476:24: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    bool QXmppCallPrivate::sendAck(const QXmppJingleIq &iq)
    ~~~~                   ^
    auto                                                    -> bool
  • src/client/QXmppCall.cpp:476:53: warning: [readability-identifier-length]

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

    bool QXmppCallPrivate::sendAck(const QXmppJingleIq &iq)
                                                        ^
  • src/client/QXmppCall.cpp:485:24: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    bool QXmppCallPrivate::sendInvite()
    ~~~~                   ^
    auto                                -> bool
  • src/client/QXmppCall.cpp:488:22: warning: [cppcoreguidelines-init-variables]

    variable 'stream' is not initialized

        QXmppCallStream *stream = findStreamByMedia(AUDIO_MEDIA);
                         ^
                                = nullptr
  • src/client/QXmppCall.cpp:491:19: warning: [readability-identifier-length]

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

        QXmppJingleIq iq;
                      ^
  • src/client/QXmppCall.cpp:504:24: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    bool QXmppCallPrivate::sendRequest(const QXmppJingleIq &iq)
    ~~~~                   ^
    auto                                                        -> bool
  • src/client/QXmppCall.cpp:504:57: warning: [readability-identifier-length]

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

    bool QXmppCallPrivate::sendRequest(const QXmppJingleIq &iq)
                                                            ^
  • src/client/QXmppCall.cpp:510:24: warning: [readability-convert-member-functions-to-static]

    method 'setState' can be made static

    void QXmppCallPrivate::setState(QXmppCall::State newState)
                           ^
    static 
  • src/client/QXmppCall.cpp:514:16: warning: [cppcoreguidelines-init-variables]

    variable 'q' is not initialized

            Q_EMIT q->stateChanged(state);
                   ^
                     = 0
  • src/client/QXmppCall.cpp:514:16: warning: [readability-identifier-length]

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

  • src/client/QXmppCall.cpp:517:20: warning: [cppcoreguidelines-init-variables]

    variable 'q' is not initialized

                Q_EMIT q->connected();
                       ^
                         = 0
  • src/client/QXmppCall.cpp:517:20: warning: [readability-identifier-length]

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

  • src/client/QXmppCall.cpp:519:20: warning: [cppcoreguidelines-init-variables]

    variable 'q' is not initialized

                Q_EMIT q->finished();
                       ^
                         = 0
  • src/client/QXmppCall.cpp:519:20: warning: [readability-identifier-length]

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

  • src/client/QXmppCall.cpp:535:19: warning: [readability-identifier-length]

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

        QXmppJingleIq iq;
                      ^
  • src/client/QXmppCallInviteManager.cpp:22:5: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: id, callPartnerJid

        QXmppCallInvitePrivate(QXmppCallInviteManager *manager)
        ^
  • src/client/QXmppCallInviteManager.cpp:27:27: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

        QXmppTask<SendResult> request(QXmppCallInviteElement &&callInviteElement);
                              ^
  • src/client/QXmppCallInviteManager.cpp:39:47: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    QXmppTask<SendResult> QXmppCallInvitePrivate::request(QXmppCallInviteElement &&callInviteElement)
                                                  ^
  • src/client/QXmppCallInviteManager.cpp:201:7: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: callInvites

    class QXmppCallInviteManagerPrivate
          ^
  • src/client/QXmppMamManager.cpp:28:21: warning: [cppcoreguidelines-init-variables]

    variable 'output' is not initialized

        QVector<Output> output;
                        ^
                               = 0
  • src/client/QXmppMamManager.cpp:35:19: warning: [readability-identifier-length]

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

    auto sum(const T &c)
                      ^
  • src/client/QXmppMamManager.cpp:40:8: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: delay

    struct MamMessage
           ^
  • src/client/QXmppMamManager.cpp:49:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    QXmppMessage parseMamMessage(const MamMessage &mamMessage, EncryptedType encrypted)
    ~~~~~~~~~~~~ ^
    auto                                                                                -> QXmppMessage
  • src/client/QXmppMamManager.cpp:51:18: warning: [readability-identifier-length]

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

        QXmppMessage m;
                     ^
  • src/client/QXmppMamManager.cpp:59:48: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    std::optional<std::tuple<MamMessage, QString>> parseMamMessageResult(const QDomElement &messageEl)
                                                   ^
  • src/client/QXmppMamManager.cpp:89:8: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: promise, iq, messages, processedMessages

    struct RetrieveRequestState
           ^
  • src/client/QXmppMamManager.cpp:107:7: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: ongoingRequests

    class QXmppMamManagerPrivate
          ^
  • src/client/QXmppMamManager.cpp:183:24: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    static QXmppMamQueryIq buildRequest(const QString &to,
                           ^
  • src/client/QXmppMamManager.cpp:183:37: warning: [bugprone-easily-swappable-parameters]

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

    static QXmppMamQueryIq buildRequest(const QString &to,
                                        ^~~~~~~~~~~~~~~~~~
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppMamManager.cpp:183:52: note: the first parameter in the range is 'to'
    static QXmppMamQueryIq buildRequest(const QString &to,
                                                       ^~
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppMamManager.cpp:186:54: note: the last parameter in the range is 'start'
                                        const QDateTime &start,
                                                         ^~~~~
  • src/client/QXmppMamManager.cpp:190:33: warning: [cppcoreguidelines-init-variables]

    variable 'fields' is not initialized

        QList<QXmppDataForm::Field> fields;
                                    ^
                                           = 0
  • src/client/QXmppMamManager.cpp:198:30: warning: [cppcoreguidelines-init-variables]

    variable 'jidField' is not initialized

            QXmppDataForm::Field jidField;
                                 ^
                                          = 0
  • src/client/QXmppMamManager.cpp:205:30: warning: [cppcoreguidelines-init-variables]

    variable 'startField' is not initialized

            QXmppDataForm::Field startField;
                                 ^
                                            = 0
  • src/client/QXmppMamManager.cpp:212:30: warning: [cppcoreguidelines-init-variables]

    variable 'endField' is not initialized

            QXmppDataForm::Field endField;
                                 ^
                                          = 0
  • src/client/QXmppMamManager.cpp:218:19: warning: [cppcoreguidelines-init-variables]

    variable 'form' is not initialized

        QXmppDataForm form;
                      ^
                           = 0
  • src/client/QXmppMamManager.cpp:222:21: warning: [cppcoreguidelines-init-variables]

    variable 'queryIq' is not initialized

        QXmppMamQueryIq queryIq;
                        ^
                                = 0
  • src/client/QXmppMamManager.cpp:223:13: warning: [cppcoreguidelines-init-variables]

    variable 'queryId' is not initialized

        QString queryId = queryIq.id(); /* reuse the IQ id as query id */
                ^
                        = 0
  • src/client/QXmppVersionManager.cpp:18:7: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: clientName, clientVersion, clientOs

    class QXmppVersionManagerPrivate
          ^
  • src/client/QXmppClient.cpp:38:13: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    static bool isIqResponse(const QDomElement &el)
           ~~~~ ^
           auto                                     -> bool
  • src/client/QXmppClient.cpp:38:45: warning: [readability-identifier-length]

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

    static bool isIqResponse(const QDomElement &el)
                                                ^
  • src/client/QXmppClient.cpp:45:1: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: extensions

    QXmppClientPrivate::QXmppClientPrivate(QXmppClient *qq)
    ^
  • src/client/QXmppClient.cpp:45:53: warning: [readability-identifier-length]

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

    QXmppClientPrivate::QXmppClientPrivate(QXmppClient *qq)
                                                        ^
  • src/client/QXmppClient.cpp:68:25: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    int QXmppClientPrivate::getNextReconnectTime() const
    ~~~                     ^
    auto                                                 -> int
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppClient.cpp:70:29: warning: 5 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]
        if (reconnectionTries < 5) {
                                ^
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppClient.cpp:71:16: warning: 10 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]
            return 10 * 1000;
                   ^
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppClient.cpp:71:21: warning: 1000 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]
            return 10 * 1000;
                        ^
  • src/client/QXmppClient.cpp:72:7: warning: [readability-else-after-return]

    do not use 'else' after 'return'

        } else if (reconnectionTries < 10) {
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppClient.cpp:72:36: warning: 10 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]
        } else if (reconnectionTries < 10) {
                                       ^
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppClient.cpp:73:16: warning: 20 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]
            return 20 * 1000;
                   ^
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppClient.cpp:73:21: warning: 1000 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]
            return 20 * 1000;
                        ^
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppClient.cpp:74:36: warning: 15 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]
        } else if (reconnectionTries < 15) {
                                       ^
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppClient.cpp:75:16: warning: 40 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]
            return 40 * 1000;
                   ^
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppClient.cpp:75:21: warning: 1000 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]
            return 40 * 1000;
                        ^
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppClient.cpp:77:16: warning: 60 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]
            return 60 * 1000;
                   ^
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppClient.cpp:77:21: warning: 1000 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]
            return 60 * 1000;
                        ^
  • src/client/QXmppClient.cpp:81:33: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    QStringList QXmppClientPrivate::discoveryFeatures()
                                    ^
  • src/client/QXmppClient.cpp:124:6: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    bool process(const QList<QXmppClientExtension *> &extensions, const QDomElement &element, const std::optional<QXmppE2eeMetadata> &e2eeMetadata)
    ~~~~ ^
    auto                                                                                                                                            -> bool
  • src/client/QXmppClient.cpp:143:6: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    bool process(QXmppClient *client, const QList<QXmppClientExtension *> &extensions, QXmppMessage &&message)
    ~~~~ ^
    auto                                                                                                       -> bool
  • src/client/QXmppClient.cpp:155:6: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    bool process(QXmppClient *client, const QList<QXmppClientExtension *> &extensions, QXmppE2eeExtension *e2eeExt, const QDomElement &element)
    ~~~~ ^
    auto                                                                                                                                        -> bool
  • src/client/QXmppClient.cpp:161:9: warning: [readability-implicit-bool-conversion]

    implicit conversion 'QXmppE2eeExtension *' -> bool

        if (e2eeExt) {
            ^
                    != nullptr
  • src/client/QXmppTransferManager.cpp:33:16: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    static QString streamHash(const QString &sid, const QString &initiatorJid, const QString &targetJid)
                   ^
  • src/client/QXmppTransferManager.cpp:33:27: warning: [bugprone-easily-swappable-parameters]

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

    static QString streamHash(const QString &sid, const QString &initiatorJid, const QString &targetJid)
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppTransferManager.cpp:33:42: note: the first parameter in the range is 'sid'
    static QString streamHash(const QString &sid, const QString &initiatorJid, const QString &targetJid)
                                             ^~~
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppTransferManager.cpp:33:91: note: the last parameter in the range is 'targetJid'
    static QString streamHash(const QString &sid, const QString &initiatorJid, const QString &targetJid)
                                                                                              ^~~~~~~~~
  • src/client/QXmppTransferManager.cpp:35:24: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

        QCryptographicHash hash(QCryptographicHash::Sha1);
                           ^
  • src/client/QXmppTransferManager.cpp:36:13: warning: [cppcoreguidelines-init-variables]

    variable 'str' is not initialized

        QString str = sid + initiatorJid + targetJid;
                ^
                    = 0
  • src/client/QXmppTransferManager.cpp:41:7: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: date, hash, name, description

    class QXmppTransferFileInfoPrivate : public QSharedData
          ^
  • src/client/QXmppTransferManager.cpp:207:9: warning: [modernize-use-default-member-init]

    use default member initializer for 'blockSize'

        int blockSize;
            ^
                     {16384}
  • src/client/QXmppTransferManager.cpp:208:18: warning: [modernize-use-default-member-init]

    use default member initializer for 'client'

        QXmppClient *client;
                     ^
                           {nullptr}
  • src/client/QXmppTransferManager.cpp:223:10: warning: [modernize-use-default-member-init]

    use default member initializer for 'deviceIsOwn'

        bool deviceIsOwn;
             ^
                        {false}
  • src/client/QXmppTransferManager.cpp:229:9: warning: [modernize-use-default-member-init]

    use default member initializer for 'ibbSequence'

        int ibbSequence;
            ^
                       {0}
  • src/client/QXmppTransferManager.cpp:232:17: warning: [modernize-use-default-member-init]

    use default member initializer for 'socksSocket'

        QTcpSocket *socksSocket;
                    ^
                               {nullptr}
  • src/client/QXmppTransferManager.cpp:236:1: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: , done, , hash, iodevice, offerId, jid, localFileUrl, sid, , mimeType, requestId, , transferStart, fileInfo, socksProxy

    QXmppTransferJobPrivate::QXmppTransferJobPrivate()
    ^
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppTransferManager.cpp:237:17: warning: 16384 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]
        : blockSize(16384),
                    ^
  • src/client/QXmppTransferManager.cpp:454:1: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: , m_candidateHost, m_streamCandidates, m_streamOfferId, m_streamOfferFrom

    QXmppTransferIncomingJob::QXmppTransferIncomingJob(const QString &jid, QXmppClient *client, QObject *parent)
    ^
  • src/client/QXmppTransferManager.cpp:461:32: warning: [readability-convert-member-functions-to-static]

    method 'checkData' can be made static

    void QXmppTransferIncomingJob::checkData()
                                   ^
  • src/client/QXmppTransferManager.cpp:463:5: warning: [bugprone-branch-clone]

    if with identical then and else branches

        if ((d->fileInfo.size() && d->done != d->fileInfo.size()) ||
        ^
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppTransferManager.cpp:466:7: note: else branch starts here
        } else {
          ^
  • src/client/QXmppTransferManager.cpp:492:19: warning: [cppcoreguidelines-init-variables]

    variable 'hostName' is not initialized

        const QString hostName = streamHash(d->sid,
                      ^
                               = 0
  • src/client/QXmppTransferManager.cpp:512:72: warning: [readability-identifier-length]

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

    void QXmppTransferIncomingJob::connectToHosts(const QXmppByteStreamIq &iq)
                                                                           ^
  • src/client/QXmppTransferManager.cpp:521:32: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    bool QXmppTransferIncomingJob::writeData(const QByteArray &data)
    ~~~~                           ^
    auto                                                             -> bool
  • src/client/QXmppTransferManager.cpp:521:32: warning: [readability-convert-member-functions-to-static]

    method 'writeData' can be made static

    bool QXmppTransferIncomingJob::writeData(const QByteArray &data)
                                   ^
    static 
  • src/client/QXmppTransferManager.cpp:523:18: warning: [cppcoreguidelines-init-variables]

    variable 'written' is not initialized

        const qint64 written = d->iodevice->write(data);
                     ^
                             = 0
  • src/client/QXmppTransferManager.cpp:531:12: warning: [cppcoreguidelines-init-variables]

    variable 'progress' is not initialized

        Q_EMIT progress(d->done, d->fileInfo.size());
               ^
                        = 0
  • src/client/QXmppTransferManager.cpp:537:10: warning: [readability-implicit-bool-conversion]

    implicit conversion 'QXmppSocksClient *' -> bool

        if (!m_candidateClient) {
            ~^
                               == nullptr
  • src/client/QXmppTransferManager.cpp:563:10: warning: [readability-implicit-bool-conversion]

    implicit conversion 'QXmppSocksClient *' -> bool

        if (!m_candidateClient) {
            ~^
                               == nullptr
  • src/client/QXmppTransferManager.cpp:604:1: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: ,

    QXmppTransferOutgoingJob::QXmppTransferOutgoingJob(const QString &jid, QXmppClient *client, QObject *parent)
    ^
  • src/client/QXmppTransferManager.cpp:609:32: warning: [readability-convert-member-functions-to-static]

    method 'connectToProxy' can be made static

    void QXmppTransferOutgoingJob::connectToProxy()
                                   ^
  • src/client/QXmppTransferManager.cpp:613:19: warning: [cppcoreguidelines-init-variables]

    variable 'hostName' is not initialized

        const QString hostName = streamHash(d->sid,
                      ^
                               = 0
  • src/client/QXmppTransferManager.cpp:617:23: warning: [cppcoreguidelines-init-variables]

    variable 'socksClient' is not initialized

        QXmppSocksClient *socksClient = new QXmppSocksClient(d->socksProxy.host(), d->socksProxy.port(), this);
                          ^
                                      = nullptr
  • src/client/QXmppTransferManager.cpp:636:32: warning: [readability-convert-member-functions-to-static]

    method '_q_disconnected' can be made static

    void QXmppTransferOutgoingJob::_q_disconnected()
                                   ^
    static 
  • src/client/QXmppTransferManager.cpp:642:5: warning: [bugprone-branch-clone]

    if with identical then and else branches

        if (fileSize() && d->done != fileSize()) {
        ^
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppTransferManager.cpp:644:7: note: else branch starts here
        } else {
          ^
  • src/client/QXmppTransferManager.cpp:649:32: warning: [readability-convert-member-functions-to-static]

    method '_q_proxyReady' can be made static

    void QXmppTransferOutgoingJob::_q_proxyReady()
                                   ^
    static 
  • src/client/QXmppTransferManager.cpp:662:32: warning: [readability-convert-member-functions-to-static]

    method '_q_sendData' can be made static

    void QXmppTransferOutgoingJob::_q_sendData()
                                   ^
  • src/client/QXmppTransferManager.cpp:681:5: warning: [cppcoreguidelines-owning-memory]

    initializing non-owner 'char *' with a newly created 'gsl::owner<>'

        char *buffer = new char[d->blockSize];
        ^~~~~~~~~~~~~~~~~~~~~~~
  • src/client/QXmppTransferManager.cpp:682:12: warning: [cppcoreguidelines-init-variables]

    variable 'length' is not initialized

        qint64 length = d->iodevice->read(buffer, d->blockSize);
               ^
                      = 0
  • src/client/QXmppTransferManager.cpp:684:9: warning: [cppcoreguidelines-owning-memory]

    deleting a pointer through a type that is not marked 'gsl::owner<>'; consider using a smart pointer instead

            delete[] buffer;
            ^        ~~~~~~
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppTransferManager.cpp:681:5: note: variable declared here
        char *buffer = new char[d->blockSize];
        ^~~~~~~~~~~~~~~~~~~~~~~
  • src/client/QXmppTransferManager.cpp:687:7: warning: [readability-else-after-return]

    do not use 'else' after 'return'

        } else {
          ^~~~~~
  • src/client/QXmppTransferManager.cpp:689:9: warning: [cppcoreguidelines-owning-memory]

    deleting a pointer through a type that is not marked 'gsl::owner<>'; consider using a smart pointer instead

            delete[] buffer;
            ^        ~~~~~~
    /home/runner/work/qxmpp/qxmpp/src/client/QXmppTransferManager.cpp:681:5: note: variable declared here
        char *buffer = new char[d->blockSize];
        ^~~~~~~~~~~~~~~~~~~~~~~
  • src/client/QXmppTransferManager.cpp:691:16: warning: [cppcoreguidelines-init-variables]

    variable 'progress' is not initialized

            Q_EMIT progress(d->done, fileSize());
                   ^
    note: this fix will not be applied because it overlaps with another fix
  • src/client/QXmppTransferManager.cpp:701:31: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

        QXmppTransferIncomingJob *getIncomingJobByRequestId(const QString &jid, const QString &id);
        ~~~~~~~~~~~~~~~~~~~~~~~~~~^
        auto                                                                                       -> QXmppTransferIncomingJob *

Have any feedback or feature suggestions? Share it here.

Please sign in to comment.