Skip to content

Commit

Permalink
Make StickerSetId storer/parser implementation private.
Browse files Browse the repository at this point in the history
  • Loading branch information
levlam committed Feb 21, 2023
1 parent acec58e commit 4b7a3dc
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ set(TDLIB_SOURCE
td/telegram/StickerFormat.cpp
td/telegram/StickerMaskPosition.cpp
td/telegram/StickerPhotoSize.cpp
td/telegram/StickerSetId.cpp
td/telegram/StickersManager.cpp
td/telegram/StickerType.cpp
td/telegram/StorageManager.cpp
Expand Down Expand Up @@ -804,7 +805,6 @@ set(TDLIB_SOURCE
td/telegram/SendCodeHelper.hpp
td/telegram/StickerMaskPosition.hpp
td/telegram/StickerPhotoSize.hpp
td/telegram/StickerSetId.hpp
td/telegram/StickersManager.hpp
td/telegram/TranscriptionInfo.hpp
td/telegram/VideoNotesManager.hpp
Expand Down
1 change: 0 additions & 1 deletion td/telegram/ContactsManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
#include "td/telegram/SecretChatLayer.h"
#include "td/telegram/SecretChatsManager.h"
#include "td/telegram/ServerMessageId.h"
#include "td/telegram/StickerSetId.hpp"
#include "td/telegram/StickersManager.h"
#include "td/telegram/Td.h"
#include "td/telegram/TdDb.h"
Expand Down
1 change: 0 additions & 1 deletion td/telegram/StickerMaskPosition.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#pragma once

#include "td/telegram/StickerMaskPosition.h"
#include "td/telegram/StickerSetId.hpp"

#include "td/utils/tl_helpers.h"

Expand Down
1 change: 0 additions & 1 deletion td/telegram/StickerPhotoSize.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#pragma once

#include "td/telegram/StickerPhotoSize.h"
#include "td/telegram/StickerSetId.hpp"

#include "td/utils/tl_helpers.h"

Expand Down
16 changes: 8 additions & 8 deletions td/telegram/StickerSetId.hpp → td/telegram/StickerSetId.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#pragma once

#include "td/telegram/StickerSetId.h"

#include "td/telegram/StickersManager.h"
Expand All @@ -14,14 +12,16 @@

namespace td {

template <class StorerT>
void store(const StickerSetId &sticker_set_id, StorerT &storer) {
storer.context()->td().get_actor_unsafe()->stickers_manager_->store_sticker_set_id(sticker_set_id, storer);
void StickerSetId::store(LogEventStorerCalcLength &storer) const {
storer.context()->td().get_actor_unsafe()->stickers_manager_->store_sticker_set_id(*this, storer);
}

void StickerSetId::store(LogEventStorerUnsafe &storer) const {
storer.context()->td().get_actor_unsafe()->stickers_manager_->store_sticker_set_id(*this, storer);
}

template <class ParserT>
void parse(StickerSetId &sticker_set_id, ParserT &parser) {
parser.context()->td().get_actor_unsafe()->stickers_manager_->parse_sticker_set_id(sticker_set_id, parser);
void StickerSetId::parse(LogEventParser &parser) {
parser.context()->td().get_actor_unsafe()->stickers_manager_->parse_sticker_set_id(*this, parser);
}

} // namespace td
8 changes: 8 additions & 0 deletions td/telegram/StickerSetId.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
//
#pragma once

#include "td/telegram/logevent/LogEvent.h"

#include "td/utils/common.h"
#include "td/utils/HashTableUtils.h"
#include "td/utils/StringBuilder.h"
Expand Down Expand Up @@ -40,6 +42,12 @@ class StickerSetId {
bool operator!=(const StickerSetId &other) const {
return id != other.id;
}

void store(LogEventStorerCalcLength &storer) const;

void store(LogEventStorerUnsafe &storer) const;

void parse(LogEventParser &parser);
};

struct StickerSetIdHash {
Expand Down
1 change: 0 additions & 1 deletion td/telegram/StickersManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include "td/telegram/PhotoSizeSource.h"
#include "td/telegram/secret_api.h"
#include "td/telegram/SecretChatLayer.h"
#include "td/telegram/StickerSetId.hpp"
#include "td/telegram/StickersManager.hpp"
#include "td/telegram/Td.h"
#include "td/telegram/td_api.h"
Expand Down

0 comments on commit 4b7a3dc

Please sign in to comment.