diff --git a/Sources/Sources/Bot.cpp b/Sources/Sources/Bot.cpp index e095f68..f867378 100644 --- a/Sources/Sources/Bot.cpp +++ b/Sources/Sources/Bot.cpp @@ -25,17 +25,12 @@ Telegram::Bot::Bot(const std::shared_ptr& bot_settings) : bot_settings(bot_settings), telegram_listener() { - qDebug() << "internal 1"; - /* If webhook URL and SSL configuration specified - create webhook server */ if (bot_settings->webhook_url.has_value() and bot_settings->ssl_configuration.has_value()) { - qDebug() << "internal 2"; telegram_listener.emplace(this->bot_settings); - qDebug() << "internal 3.5"; - setWebhook(*bot_settings->webhook_url, bot_settings->public_key->get(), bot_settings->webhook_ip_addres, bot_settings->max_connections, bot_settings->allowed_updates, bot_settings->drop_pending_updates).get(); - qDebug() << "internal 3"; + setWebhook(*bot_settings->webhook_url, bot_settings->public_key.value_or(nullptr).get(), bot_settings->webhook_ip_addres, bot_settings->max_connections, bot_settings->allowed_updates, bot_settings->drop_pending_updates); QObject::connect(&telegram_listener.value(), &Telegram::Internal::TelegramListener::updateReceived, [this](const Update& update) { if (update.message.has_value()) emit messageReceived(update.update_id, *update.message); diff --git a/Sources/Sources/Internal/Utility/QHttpMultiPartInserter.cpp b/Sources/Sources/Internal/Utility/QHttpMultiPartInserter.cpp index 286cfa1..913662b 100644 --- a/Sources/Sources/Internal/Utility/QHttpMultiPartInserter.cpp +++ b/Sources/Sources/Internal/Utility/QHttpMultiPartInserter.cpp @@ -5,7 +5,6 @@ Utility::QHttpMultiPartInserter::QHttpMultiPartInserter(QHttpMultiPart* qhttp_mu {} void Utility::QHttpMultiPartInserter::insert(const QString& key, QFile* value) { - if (value == nullptr) return; QHttpPart part; part.setHeader(QNetworkRequest::ContentDispositionHeader, QStringLiteral("form-data; name=\"%1\"; filename=\"%2\"").arg(key).arg(value->fileName()));