Minor improvements.

This commit is contained in:
levlam 2023-10-30 19:04:14 +03:00
parent 041930528f
commit 5c1b940402
21 changed files with 37 additions and 17 deletions

View File

@ -6,16 +6,21 @@
//
#include "td/telegram/BoostManager.h"
#include "td/telegram/AccessRights.h"
#include "td/telegram/ContactsManager.h"
#include "td/telegram/Global.h"
#include "td/telegram/LinkManager.h"
#include "td/telegram/MessageId.h"
#include "td/telegram/MessagesManager.h"
#include "td/telegram/ServerMessageId.h"
#include "td/telegram/Td.h"
#include "td/telegram/telegram_api.h"
#include "td/telegram/UserId.h"
#include "td/utils/algorithm.h"
#include "td/utils/buffer.h"
#include "td/utils/logging.h"
#include "td/utils/misc.h"
#include "td/utils/SliceBuilder.h"
namespace td {

View File

@ -15,6 +15,9 @@
#include "td/utils/common.h"
#include "td/utils/Promise.h"
#include "td/utils/Slice.h"
#include "td/utils/Status.h"
#include <utility>
namespace td {

View File

@ -12,11 +12,9 @@
#include "td/telegram/MessageEntity.h"
#include "td/telegram/MessagesManager.h"
#include "td/telegram/misc.h"
#include "td/telegram/ServerMessageId.h"
#include "td/telegram/Td.h"
#include "td/telegram/telegram_api.h"
#include "td/telegram/UpdatesManager.h"
#include "td/telegram/WebPagesManager.h"
#include "td/utils/buffer.h"
#include "td/utils/logging.h"

View File

@ -19,7 +19,6 @@
namespace td {
class ContactsManager;
class Dependencies;
class Td;

View File

@ -6,9 +6,11 @@
//
#include "td/telegram/GiveawayParameters.h"
#include "td/telegram/AccessRights.h"
#include "td/telegram/ContactsManager.h"
#include "td/telegram/Dependencies.h"
#include "td/telegram/DialogId.h"
#include "td/telegram/Global.h"
#include "td/telegram/MessagesManager.h"
#include "td/telegram/OptionManager.h"
#include "td/telegram/Td.h"

View File

@ -7,6 +7,7 @@
#include "td/telegram/InputMessageText.h"
#include "td/telegram/ContactsManager.h"
#include "td/telegram/Dependencies.h"
#include "td/telegram/MessageEntity.h"
#include "td/telegram/misc.h"
#include "td/telegram/Td.h"

View File

@ -9,7 +9,9 @@
#include "td/telegram/DialogId.h"
#include "td/telegram/MessageEntity.h"
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
#include "td/utils/common.h"
#include "td/utils/Status.h"
namespace td {

View File

@ -7,6 +7,7 @@
#pragma once
#include "td/telegram/BackgroundInfo.h"
#include "td/telegram/ChannelId.h"
#include "td/telegram/DialogId.h"
#include "td/telegram/EncryptedFile.h"
#include "td/telegram/files/FileId.h"

View File

@ -6,14 +6,17 @@
//
#include "td/telegram/MessageInputReplyTo.h"
#include "td/telegram/AccessRights.h"
#include "td/telegram/ContactsManager.h"
#include "td/telegram/Dependencies.h"
#include "td/telegram/DialogId.h"
#include "td/telegram/InputDialogId.h"
#include "td/telegram/MessagesManager.h"
#include "td/telegram/misc.h"
#include "td/telegram/ServerMessageId.h"
#include "td/telegram/StoryId.h"
#include "td/telegram/Td.h"
#include "td/telegram/UserId.h"
#include "td/utils/logging.h"

View File

@ -6,8 +6,6 @@
//
#include "td/telegram/MessageReplyHeader.h"
#include "td/telegram/MessageFullId.h"
#include "td/telegram/ScheduledServerMessageId.h"
#include "td/telegram/ServerMessageId.h"
#include "td/telegram/StoryId.h"
#include "td/telegram/UserId.h"

View File

@ -6,6 +6,7 @@
//
#pragma once
#include "td/telegram/DialogId.h"
#include "td/telegram/MessageId.h"
#include "td/telegram/RepliedMessageInfo.h"
#include "td/telegram/StoryFullId.h"

View File

@ -255,7 +255,7 @@ class NotificationTypePushMessage final : public NotificationType {
return td_api::make_object<td_api::pushMessageContentGameScore>(title, score, is_pinned);
}
if (key == "MESSAGE_GIFTCODE") {
int32 month_count = to_integer<int32>(arg);
auto month_count = to_integer<int32>(arg);
return td_api::make_object<td_api::pushMessageContentPremiumGiftCode>(month_count);
}
if (key == "MESSAGE_GIVEAWAY") {

View File

@ -31,7 +31,6 @@
#include "td/utils/common.h"
#include "td/utils/JsonBuilder.h"
#include "td/utils/logging.h"
#include "td/utils/Random.h"
#include "td/utils/Status.h"
namespace td {
@ -74,7 +73,7 @@ Result<InputInvoiceInfo> get_input_invoice_info(Td *td, td_api::object_ptr<td_ap
case td_api::inputInvoiceTelegram::ID: {
auto invoice = td_api::move_object_as<td_api::inputInvoiceTelegram>(input_invoice);
if (invoice->purpose_ == nullptr) {
return Status::Error(400, "Purpose must not be empty");
return Status::Error(400, "Purpose must be non-empty");
}
switch (invoice->purpose_->get_id()) {
case td_api::telegramPaymentPurposePremiumGiftCodes::ID: {

View File

@ -6,8 +6,10 @@
//
#include "td/telegram/Premium.h"
#include "td/telegram/AccessRights.h"
#include "td/telegram/AnimationsManager.h"
#include "td/telegram/Application.h"
#include "td/telegram/ChannelId.h"
#include "td/telegram/ContactsManager.h"
#include "td/telegram/DialogId.h"
#include "td/telegram/Document.h"
@ -15,6 +17,7 @@
#include "td/telegram/GiveawayParameters.h"
#include "td/telegram/Global.h"
#include "td/telegram/MessageEntity.h"
#include "td/telegram/MessageId.h"
#include "td/telegram/MessageSender.h"
#include "td/telegram/MessagesManager.h"
#include "td/telegram/misc.h"

View File

@ -6,16 +6,15 @@
//
#include "td/telegram/RepliedMessageInfo.h"
#include "td/telegram/ContactsManager.h"
#include "td/telegram/Dependencies.h"
#include "td/telegram/MessageContent.h"
#include "td/telegram/MessageContentType.h"
#include "td/telegram/MessageFullId.h"
#include "td/telegram/MessagesManager.h"
#include "td/telegram/misc.h"
#include "td/telegram/OptionManager.h"
#include "td/telegram/ScheduledServerMessageId.h"
#include "td/telegram/ServerMessageId.h"
#include "td/telegram/StoryId.h"
#include "td/telegram/Td.h"
#include "td/utils/algorithm.h"

View File

@ -8,6 +8,7 @@
#include "td/telegram/ChannelId.h"
#include "td/telegram/DialogId.h"
#include "td/telegram/files/FileId.h"
#include "td/telegram/MessageContent.h"
#include "td/telegram/MessageEntity.h"
#include "td/telegram/MessageFullId.h"
@ -19,6 +20,7 @@
#include "td/telegram/UserId.h"
#include "td/utils/common.h"
#include "td/utils/StringBuilder.h"
#include <functional>

View File

@ -6,6 +6,7 @@
//
#include "td/telegram/Td.h"
#include "td/telegram/AccentColorId.h"
#include "td/telegram/AccountManager.h"
#include "td/telegram/AnimationsManager.h"
#include "td/telegram/Application.h"

View File

@ -14,6 +14,7 @@
#include "td/telegram/CallbackQueriesManager.h"
#include "td/telegram/CallManager.h"
#include "td/telegram/ChannelId.h"
#include "td/telegram/ChannelType.h"
#include "td/telegram/ChatId.h"
#include "td/telegram/ConfigManager.h"
#include "td/telegram/ContactsManager.h"

View File

@ -1471,9 +1471,9 @@ class WebPageBlockChatLink final : public WebPageBlock {
template <class ParserT>
void parse(ParserT &parser) {
using ::td::parse;
bool has_title = true;
bool has_photo = true;
bool has_username = true;
bool has_title;
bool has_photo;
bool has_username;
bool has_accent_color_id = false;
if (parser.version() >= static_cast<int32>(Version::AddPageBlockChatLinkFlags)) {
BEGIN_PARSE_FLAGS();
@ -1482,6 +1482,10 @@ class WebPageBlockChatLink final : public WebPageBlock {
PARSE_FLAG(has_username);
PARSE_FLAG(has_accent_color_id);
END_PARSE_FLAGS();
} else {
has_title = true;
has_photo = true;
has_username = true;
}
if (has_title) {
parse(title, parser);

View File

@ -25,7 +25,6 @@
#include "td/telegram/MessagesManager.h"
#include "td/telegram/Photo.h"
#include "td/telegram/PhotoFormat.h"
#include "td/telegram/secret_api.h"
#include "td/telegram/StickersManager.h"
#include "td/telegram/StoryFullId.h"
#include "td/telegram/StoryId.h"

View File

@ -11,7 +11,6 @@
#include "td/telegram/files/FileId.h"
#include "td/telegram/files/FileSourceId.h"
#include "td/telegram/MessageFullId.h"
#include "td/telegram/SecretInputMedia.h"
#include "td/telegram/StoryFullId.h"
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
@ -197,7 +196,7 @@ class WebPagesManager final : public Actor {
FlatHashMap<StoryFullId, FlatHashSet<WebPageId, WebPageIdHash>, StoryFullIdHash> story_web_pages_;
FlatHashMap<string, std::pair<WebPageId, bool>> url_to_web_page_id_; // url -> [WebPageId, from_database]
FlatHashMap<string, std::pair<WebPageId, bool>> url_to_web_page_id_; // URL -> [WebPageId, from_database]
FlatHashMap<string, FileSourceId> url_to_file_source_id_;