2018-09-28 04:21:20 +03:00
|
|
|
//
|
2024-01-01 03:07:21 +03:00
|
|
|
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024
|
2018-09-28 04:21:20 +03:00
|
|
|
//
|
|
|
|
// 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/ChannelId.h"
|
|
|
|
#include "td/telegram/ChatId.h"
|
|
|
|
#include "td/telegram/DialogId.h"
|
|
|
|
#include "td/telegram/SecretChatId.h"
|
2023-07-10 15:36:38 +03:00
|
|
|
#include "td/telegram/StoryFullId.h"
|
2018-09-28 04:21:20 +03:00
|
|
|
#include "td/telegram/UserId.h"
|
|
|
|
#include "td/telegram/WebPageId.h"
|
|
|
|
|
2022-03-11 21:38:48 +03:00
|
|
|
#include "td/utils/FlatHashSet.h"
|
2018-09-28 04:21:20 +03:00
|
|
|
|
|
|
|
namespace td {
|
|
|
|
|
2020-01-27 03:09:05 +03:00
|
|
|
class Td;
|
|
|
|
|
2022-03-11 15:10:24 +03:00
|
|
|
class Dependencies {
|
2022-03-11 21:38:48 +03:00
|
|
|
FlatHashSet<UserId, UserIdHash> user_ids;
|
|
|
|
FlatHashSet<ChatId, ChatIdHash> chat_ids;
|
|
|
|
FlatHashSet<ChannelId, ChannelIdHash> channel_ids;
|
|
|
|
FlatHashSet<SecretChatId, SecretChatIdHash> secret_chat_ids;
|
|
|
|
FlatHashSet<DialogId, DialogIdHash> dialog_ids;
|
|
|
|
FlatHashSet<WebPageId, WebPageIdHash> web_page_ids;
|
2023-07-10 15:36:38 +03:00
|
|
|
FlatHashSet<StoryFullId, StoryFullIdHash> story_full_ids;
|
2018-09-28 04:21:20 +03:00
|
|
|
|
2022-03-11 15:31:28 +03:00
|
|
|
public:
|
|
|
|
void add(UserId user_id);
|
|
|
|
|
|
|
|
void add(ChatId chat_id);
|
|
|
|
|
|
|
|
void add(ChannelId channel_id);
|
|
|
|
|
|
|
|
void add(SecretChatId secret_chat_id);
|
|
|
|
|
|
|
|
void add(WebPageId web_page_id);
|
|
|
|
|
2023-07-10 15:36:38 +03:00
|
|
|
void add(StoryFullId story_full_id);
|
|
|
|
|
2022-03-11 15:10:24 +03:00
|
|
|
void add_dialog_and_dependencies(DialogId dialog_id);
|
2020-09-10 23:24:33 +03:00
|
|
|
|
2022-03-11 15:10:24 +03:00
|
|
|
void add_dialog_dependencies(DialogId dialog_id);
|
2020-09-10 23:24:33 +03:00
|
|
|
|
2022-03-11 15:10:24 +03:00
|
|
|
void add_message_sender_dependencies(DialogId dialog_id);
|
2020-10-19 19:17:56 +03:00
|
|
|
|
2023-09-20 20:44:21 +03:00
|
|
|
bool resolve_force(Td *td, const char *source, bool ignore_errors = false) const;
|
2022-03-11 15:31:28 +03:00
|
|
|
|
2022-03-11 21:38:48 +03:00
|
|
|
const FlatHashSet<DialogId, DialogIdHash> &get_dialog_ids() const {
|
2022-03-11 15:31:28 +03:00
|
|
|
return dialog_ids;
|
|
|
|
}
|
2022-03-11 15:10:24 +03:00
|
|
|
};
|
2020-01-27 03:09:05 +03:00
|
|
|
|
2018-09-28 04:21:20 +03:00
|
|
|
} // namespace td
|