2
0
mirror of https://github.com/tdlib/telegram-bot-api synced 2025-08-22 01:49:24 +00:00

Compare commits

..

1 Commits

6 changed files with 11 additions and 39 deletions

View File

@ -6,7 +6,7 @@ if (POLICY CMP0065)
cmake_policy(SET CMP0065 NEW)
endif()
project(TelegramBotApi VERSION 7.8 LANGUAGES CXX)
project(TelegramBotApi VERSION 7.7 LANGUAGES CXX)
if (POLICY CMP0069)
option(TELEGRAM_BOT_API_ENABLE_LTO "Use \"ON\" to enable Link Time Optimization.")

View File

@ -543,26 +543,29 @@ function onOptionsChanged() {
break;
case 'CentOS 7':
commands.push(sudo + 'yum update -y');
var packages = 'gcc-c++ make git zlib-devel openssl-devel';
commands.push(sudo + 'yum install -y centos-release-scl-rh epel-release');
commands.push(sudo + 'yum install -y devtoolset-9-gcc devtoolset-9-gcc-c++');
cmake = 'cmake3';
var packages = 'gcc-c++ make git zlib-devel openssl-devel gperf ' + cmake;
packages += ' gperf ' + cmake;
commands.push(sudo + 'yum install -y ' + packages);
break;
case 'CentOS 8':
case 'CentOS Stream 9':
commands.push(sudo + 'dnf update -y');
var packages = 'gcc-c++ make git zlib-devel openssl-devel';
if (linux_distro === 'CentOS 8') {
commands.push(sudo + 'dnf --enablerepo=powertools install gperf');
} else {
commands.push(sudo + 'dnf --enablerepo=crb install gperf');
}
var packages = 'gcc-c++ make git zlib-devel openssl-devel cmake';
packages += ' ' + cmake;
commands.push(sudo + 'dnf install -y ' + packages);
break;
case 'Fedora 21+':
commands.push(sudo + 'dnf update -y');
var packages = 'gperf gcc-c++ make git zlib-devel openssl-devel cmake';
var packages = 'gperf gcc-c++ make git zlib-devel openssl-devel';
packages += ' ' + cmake;
commands.push(sudo + 'dnf install -y ' + packages);
break;
case 'Debian 8/9':

2
td

@ -1 +1 @@
Subproject commit 1fa2a372a88c26369dcac2ce476166531df74a77
Subproject commit cb164927417f22811c74cd8678ed4a5ab7cb80ba

View File

@ -420,7 +420,6 @@ class Client::JsonUser final : public td::Jsonable {
object("can_read_all_group_messages", td::JsonBool(user_info->can_read_all_group_messages));
object("supports_inline_queries", td::JsonBool(user_info->is_inline_bot));
object("can_connect_to_business", td::JsonBool(user_info->can_connect_to_business));
object("has_main_web_app", td::JsonBool(user_info->has_main_web_app));
}
}
@ -3286,8 +3285,6 @@ void Client::JsonMessage::store(td::JsonValueScope *scope) const {
object("refunded_payment", JsonRefundedPayment(content));
break;
}
case td_api::messageGiftedStars::ID:
break;
default:
UNREACHABLE();
}
@ -4088,7 +4085,7 @@ class Client::JsonStarTransactionPartner final : public td::Jsonable {
case td_api::starTransactionPartnerBot::ID: {
auto source_user = static_cast<const td_api::starTransactionPartnerBot *>(source_);
object("type", "user");
object("user", JsonUser(source_user->user_id_, client_));
object("user", JsonUser(source_user->bot_user_id_, client_));
if (!source_user->invoice_payload_.empty()) {
if (!td::check_utf8(source_user->invoice_payload_)) {
LOG(WARNING) << "Receive non-UTF-8 invoice payload";
@ -4105,7 +4102,6 @@ class Client::JsonStarTransactionPartner final : public td::Jsonable {
case td_api::starTransactionPartnerTelegram::ID:
case td_api::starTransactionPartnerAppStore::ID:
case td_api::starTransactionPartnerGooglePlay::ID:
case td_api::starTransactionPartnerUser::ID:
case td_api::starTransactionPartnerChannel::ID:
LOG(ERROR) << "Receive " << to_string(*source_);
object("type", "other");
@ -11303,21 +11299,10 @@ td::Status Client::process_set_chat_description_query(PromisedQueryPtr &query) {
}
td::Status Client::process_pin_chat_message_query(PromisedQueryPtr &query) {
auto business_connection_id = query->arg("business_connection_id");
auto chat_id = query->arg("chat_id");
auto message_id = get_message_id(query.get());
auto disable_notification = to_bool(query->arg("disable_notification"));
if (!business_connection_id.empty()) {
check_business_connection_chat_id(
business_connection_id.str(), chat_id.str(), std::move(query),
[this, message_id](const BusinessConnection *business_connection, int64 chat_id, PromisedQueryPtr query) {
send_request(
make_object<td_api::setBusinessMessageIsPinned>(business_connection->id_, chat_id, message_id, true),
td::make_unique<TdOnOkQueryCallback>(std::move(query)));
});
return td::Status::OK();
}
check_message(chat_id, message_id, false, AccessRights::Write, "message to pin", std::move(query),
[this, disable_notification](int64 chat_id, int64 message_id, PromisedQueryPtr query) {
send_request(make_object<td_api::pinChatMessage>(chat_id, message_id, disable_notification, false),
@ -11327,21 +11312,9 @@ td::Status Client::process_pin_chat_message_query(PromisedQueryPtr &query) {
}
td::Status Client::process_unpin_chat_message_query(PromisedQueryPtr &query) {
auto business_connection_id = query->arg("business_connection_id");
auto chat_id = query->arg("chat_id");
auto message_id = get_message_id(query.get());
if (!business_connection_id.empty()) {
check_business_connection_chat_id(
business_connection_id.str(), chat_id.str(), std::move(query),
[this, message_id](const BusinessConnection *business_connection, int64 chat_id, PromisedQueryPtr query) {
send_request(
make_object<td_api::setBusinessMessageIsPinned>(business_connection->id_, chat_id, message_id, false),
td::make_unique<TdOnOkQueryCallback>(std::move(query)));
});
return td::Status::OK();
}
if (message_id == 0) {
check_chat(chat_id, AccessRights::Write, std::move(query), [this](int64 chat_id, PromisedQueryPtr query) {
send_request(make_object<td_api::getChatPinnedMessage>(chat_id),
@ -12859,7 +12832,6 @@ void Client::add_user(UserInfo *user_info, object_ptr<td_api::user> &&user) {
user_info->can_read_all_group_messages = bot->can_read_all_group_messages_;
user_info->is_inline_bot = bot->is_inline_;
user_info->can_connect_to_business = bot->can_connect_to_business_;
user_info->has_main_web_app = bot->has_main_web_app_;
break;
}
case td_api::userTypeDeleted::ID:
@ -13806,8 +13778,6 @@ bool Client::need_skip_update_message(int64 chat_id, const object_ptr<td_api::me
return true;
case td_api::messagePremiumGiftCode::ID:
return true;
case td_api::messageGiftedStars::ID:
return true;
default:
break;
}

View File

@ -841,10 +841,9 @@ class Client final : public WebhookActor::Callback {
bool can_join_groups = false;
bool can_read_all_group_messages = false;
bool can_connect_to_business = false;
bool has_main_web_app = false;
bool is_inline_bot = false;
bool has_private_forwards = false;
bool has_restricted_voice_and_video_messages = false;
bool is_inline_bot = false;
bool is_premium = false;
bool added_to_attachment_menu = false;
};

View File

@ -165,7 +165,7 @@ int main(int argc, char *argv[]) {
auto start_time = td::Time::now();
auto shared_data = std::make_shared<SharedData>();
auto parameters = std::make_unique<ClientParameters>();
parameters->version_ = "7.8";
parameters->version_ = "7.7";
parameters->shared_data_ = shared_data;
parameters->start_time_ = start_time;
auto net_query_stats = td::create_net_query_stats();