diff --git a/td/telegram/SecretChatActor.h b/td/telegram/SecretChatActor.h index 3ba4af87..cf098cac 100644 --- a/td/telegram/SecretChatActor.h +++ b/td/telegram/SecretChatActor.h @@ -188,8 +188,7 @@ class SecretChatActor : public NetQueryCallback { storer.store_int(ttl); storer.store_int(my_layer); //for future usage - BEGIN_STORE_FLAGS(); - END_STORE_FLAGS(); + storer.store_int(0); } template @@ -201,8 +200,8 @@ class SecretChatActor : public NetQueryCallback { his_layer &= ~HAS_FLAGS; my_layer = parser.fetch_int(); // for future usage - BEGIN_PARSE_FLAGS(); - END_PARSE_FLAGS(); + int32 flags = parser.fetch_int(); + CHECK(flags == 0); } } diff --git a/td/telegram/StickersManager.hpp b/td/telegram/StickersManager.hpp index 2bdb3593..e641c1e1 100644 --- a/td/telegram/StickersManager.hpp +++ b/td/telegram/StickersManager.hpp @@ -59,7 +59,8 @@ FileId StickersManager::parse_sticker(bool in_sticker_set, T &parser) { PARSE_FLAG(has_sticker_set_access_hash); PARSE_FLAG(in_sticker_set_stored); END_PARSE_FLAGS(); - CHECK(in_sticker_set_stored == in_sticker_set) << in_sticker_set << " " << in_sticker_set_stored; + CHECK(in_sticker_set_stored == in_sticker_set) + << in_sticker_set << " " << in_sticker_set_stored << " " << parser.version(); if (!in_sticker_set) { parse(sticker->set_id, parser); if (has_sticker_set_access_hash) { diff --git a/td/telegram/files/FileLocation.h b/td/telegram/files/FileLocation.h index ac168041..f0f3a677 100644 --- a/td/telegram/files/FileLocation.h +++ b/td/telegram/files/FileLocation.h @@ -1222,7 +1222,7 @@ class FileData { PARSE_FLAG(has_owner_dialog_id); PARSE_FLAG(has_expected_size); PARSE_FLAG(encryption_key_is_secure); - END_PARSE_FLAGS(); + // END_PARSE_FLAGS(); if (has_owner_dialog_id) { parse(owner_dialog_id_, parser); diff --git a/tddb/td/db/binlog/Binlog.cpp b/tddb/td/db/binlog/Binlog.cpp index 5d76028d..aa3104cd 100644 --- a/tddb/td/db/binlog/Binlog.cpp +++ b/tddb/td/db/binlog/Binlog.cpp @@ -72,8 +72,8 @@ struct AesCtrEncryptionEvent { template void store(StorerT &storer) const { using td::store; - BEGIN_STORE_FLAGS(); - END_STORE_FLAGS(); + int32 flags = 0; + store(flags, storer); store(key_salt_, storer); store(iv_, storer); store(key_hash_, storer); @@ -81,8 +81,9 @@ struct AesCtrEncryptionEvent { template void parse(ParserT &&parser) { using td::parse; - BEGIN_PARSE_FLAGS(); - END_PARSE_FLAGS(); + int32 flags; + parse(flags, parser); + CHECK(flags == 0); parse(key_salt_, parser); parse(iv_, parser); parse(key_hash_, parser); diff --git a/tdutils/td/utils/tl_helpers.h b/tdutils/td/utils/tl_helpers.h index 686dacbe..d98a5742 100644 --- a/tdutils/td/utils/tl_helpers.h +++ b/tdutils/td/utils/tl_helpers.h @@ -39,9 +39,10 @@ flag = ((flags_parse >> bit_offset_parse) & 1) != 0; \ bit_offset_parse++ -#define END_PARSE_FLAGS() \ - CHECK(bit_offset_parse < 31); \ - CHECK((flags_parse & ~((1 << bit_offset_parse) - 1)) == 0) << flags_parse << " " << bit_offset_parse; +#define END_PARSE_FLAGS() \ + CHECK(bit_offset_parse < 31); \ + CHECK((flags_parse & ~((1 << bit_offset_parse) - 1)) == 0) \ + << flags_parse << " " << bit_offset_parse << " " << parser.version(); namespace td { template