Minor improvements.

This commit is contained in:
levlam 2023-08-05 15:31:42 +03:00
parent 57b935f6a7
commit 830da27abf
13 changed files with 24 additions and 21 deletions

View File

@ -6,9 +6,6 @@
//
#include "td/telegram/ChatReactions.h"
#include "td/telegram/MessageReaction.h"
#include "td/telegram/telegram_api.h"
#include "td/utils/algorithm.h"
namespace td {

View File

@ -13,7 +13,6 @@
#include "td/telegram/JsonValue.h"
#include "td/telegram/LinkManager.h"
#include "td/telegram/logevent/LogEvent.h"
#include "td/telegram/MessageReaction.h"
#include "td/telegram/misc.h"
#include "td/telegram/net/AuthDataShared.h"
#include "td/telegram/net/ConnectionCreator.h"

View File

@ -11,6 +11,7 @@
#include "td/telegram/telegram_api.h"
#include "td/utils/common.h"
#include "td/utils/HashTableUtils.h"
#include "td/utils/StringBuilder.h"
namespace td {

View File

@ -12,7 +12,6 @@
#include "td/telegram/Global.h"
#include "td/telegram/MessageSender.h"
#include "td/telegram/MessagesManager.h"
#include "td/telegram/OptionManager.h"
#include "td/telegram/ServerMessageId.h"
#include "td/telegram/Td.h"
#include "td/telegram/telegram_api.h"

View File

@ -38697,7 +38697,7 @@ void MessagesManager::on_get_channel_difference(DialogId dialog_id, int32 reques
if (difference_ptr == nullptr) {
CHECK(status.is_error());
bool have_access = have_input_peer(dialog_id, AccessRights::Read) && status.error().message() != "CHANNEL_INVALID";
bool have_access = have_input_peer(dialog_id, AccessRights::Read) && status.message() != "CHANNEL_INVALID";
if (have_access) {
if (d == nullptr) {
force_create_dialog(dialog_id, "on_get_channel_difference failed");

View File

@ -7,16 +7,21 @@
#include "td/telegram/ReactionType.h"
#include "td/telegram/ConfigManager.h"
#include "td/telegram/Global.h"
#include "td/telegram/misc.h"
#include "td/telegram/OptionManager.h"
#include "td/telegram/StickersManager.h"
#include "td/telegram/Td.h"
#include "td/actor/actor.h"
#include "td/utils/as.h"
#include "td/utils/base64.h"
#include "td/utils/buffer.h"
#include "td/utils/crypto.h"
#include "td/utils/emoji.h"
#include "td/utils/logging.h"
#include "td/utils/Slice.h"
#include "td/utils/SliceBuilder.h"
#include "td/utils/Status.h"
#include "td/utils/utf8.h"

View File

@ -11,11 +11,14 @@
#include "td/utils/common.h"
#include "td/utils/FlatHashMap.h"
#include "td/utils/HashTableUtils.h"
#include "td/utils/Promise.h"
#include "td/utils/StringBuilder.h"
namespace td {
struct ReactionTypeHash;
class Td;
class ReactionType {

View File

@ -10,6 +10,7 @@
#include "td/telegram/StoryId.h"
#include "td/utils/common.h"
#include "td/utils/HashTableUtils.h"
#include "td/utils/StringBuilder.h"
namespace td {

View File

@ -170,7 +170,6 @@
#include "td/utils/SliceBuilder.h"
#include "td/utils/Status.h"
#include "td/utils/Timer.h"
#include "td/utils/tl_parsers.h"
#include "td/utils/utf8.h"
#include <limits>

View File

@ -10,7 +10,6 @@
#include "td/utils/common.h"
#include "td/utils/port/RwMutex.h"
#include "td/utils/Slice.h"
namespace td {

View File

@ -6,6 +6,7 @@
//
#pragma once
#include "td/utils/common.h"
#include "td/utils/FlatHashMap.h"
#include "td/utils/Slice.h"

View File

@ -11,7 +11,6 @@
#include "td/utils/Container.h"
#include "td/utils/FlatHashMap.h"
#include "td/utils/FlatHashSet.h"
#include "td/utils/HashTableUtils.h"
#include "td/utils/List.h"
#include "td/utils/logging.h"
#include "td/utils/optional.h"

View File

@ -173,12 +173,12 @@ TEST(JSON, get_json_object_field) {
ASSERT_EQ(td::get_json_object_int_field(object, "long2").is_error(), true);
ASSERT_TRUE(td::get_json_object_long_field(object, "null").is_error());
ASSERT_EQ(td::get_json_object_long_field(object, "long").ok(), 123456789012ll);
ASSERT_EQ(td::get_json_object_long_field(object, "long").ok(), 123456789012ll);
ASSERT_EQ(td::get_json_object_long_field(object, "long", false).ok(), 123456789012ll);
ASSERT_EQ(td::get_json_object_long_field(object, "long2").ok(), 2123456789012ll);
ASSERT_EQ(td::get_json_object_long_field(object, "long2").ok(), 2123456789012ll);
ASSERT_EQ(td::get_json_object_long_field(object, "long2", false).ok(), 2123456789012ll);
ASSERT_EQ(td::get_json_object_long_field(object, "long").ok(), 123456789012);
ASSERT_EQ(td::get_json_object_long_field(object, "long").ok(), 123456789012);
ASSERT_EQ(td::get_json_object_long_field(object, "long", false).ok(), 123456789012);
ASSERT_EQ(td::get_json_object_long_field(object, "long2").ok(), 2123456789012);
ASSERT_EQ(td::get_json_object_long_field(object, "long2").ok(), 2123456789012);
ASSERT_EQ(td::get_json_object_long_field(object, "long2", false).ok(), 2123456789012);
ASSERT_EQ(td::get_json_object_long_field(object, "long3").ok(), 0);
ASSERT_EQ(td::get_json_object_long_field(object, "long4", true, 5).ok(), 5);
ASSERT_TRUE(td::get_json_object_long_field(object, "long5", false, 5).is_error());
@ -296,12 +296,12 @@ TEST(JSON, json_object_get_field) {
ASSERT_EQ(object.get_optional_int_field("long2").is_error(), true);
ASSERT_TRUE(object.get_optional_long_field("null").is_error());
ASSERT_EQ(object.get_optional_long_field("long").ok(), 123456789012ll);
ASSERT_EQ(object.get_optional_long_field("long").ok(), 123456789012ll);
ASSERT_EQ(object.get_required_long_field("long").ok(), 123456789012ll);
ASSERT_EQ(object.get_optional_long_field("long2").ok(), 2123456789012ll);
ASSERT_EQ(object.get_optional_long_field("long2").ok(), 2123456789012ll);
ASSERT_EQ(object.get_required_long_field("long2").ok(), 2123456789012ll);
ASSERT_EQ(object.get_optional_long_field("long").ok(), 123456789012);
ASSERT_EQ(object.get_optional_long_field("long").ok(), 123456789012);
ASSERT_EQ(object.get_required_long_field("long").ok(), 123456789012);
ASSERT_EQ(object.get_optional_long_field("long2").ok(), 2123456789012);
ASSERT_EQ(object.get_optional_long_field("long2").ok(), 2123456789012);
ASSERT_EQ(object.get_required_long_field("long2").ok(), 2123456789012);
ASSERT_EQ(object.get_optional_long_field("long3").ok(), 0);
ASSERT_EQ(object.get_optional_long_field("long4", 5).ok(), 5);
ASSERT_TRUE(object.get_required_long_field("long5").is_error());