Skip to content

Commit

Permalink
Revert "Telegram::Bot constructor fixed"
Browse files Browse the repository at this point in the history
This reverts commit 4a3d3f7.
  • Loading branch information
Modersi committed Jun 23, 2024
1 parent 4a3d3f7 commit 72a8002
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
7 changes: 1 addition & 6 deletions Sources/Sources/Bot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,12 @@ Telegram::Bot::Bot(const std::shared_ptr<BotSettings>& 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down

0 comments on commit 72a8002

Please sign in to comment.