|
9 | 9 | #include "td/actor/actor.h"
|
10 | 10 | #include "td/actor/PromiseFuture.h"
|
11 | 11 |
|
12 |
| -#include "td/telegram/td_api.h" |
13 |
| -#include "td/telegram/telegram_api.h" |
14 |
| - |
15 | 12 | #include "td/telegram/DialogId.h"
|
16 | 13 | #include "td/telegram/net/NetQuery.h"
|
| 14 | +#include "td/telegram/td_api.h" |
| 15 | +#include "td/telegram/telegram_api.h" |
| 16 | +#include "td/telegram/TopDialogCategory.h" |
17 | 17 |
|
18 | 18 | #include "td/utils/common.h"
|
19 | 19 | #include "td/utils/Time.h"
|
|
23 | 23 |
|
24 | 24 | namespace td {
|
25 | 25 |
|
26 |
| -enum class TopDialogCategory : int32 { |
27 |
| - Correspondent, |
28 |
| - BotPM, |
29 |
| - BotInline, |
30 |
| - Group, |
31 |
| - Channel, |
32 |
| - Call, |
33 |
| - ForwardUsers, |
34 |
| - ForwardChats, |
35 |
| - Size |
36 |
| -}; |
37 |
| - |
38 |
| -inline TopDialogCategory top_dialog_category_from_td_api(const td_api::TopChatCategory &category) { |
39 |
| - switch (category.get_id()) { |
40 |
| - case td_api::topChatCategoryUsers::ID: |
41 |
| - return TopDialogCategory::Correspondent; |
42 |
| - case td_api::topChatCategoryBots::ID: |
43 |
| - return TopDialogCategory::BotPM; |
44 |
| - case td_api::topChatCategoryInlineBots::ID: |
45 |
| - return TopDialogCategory::BotInline; |
46 |
| - case td_api::topChatCategoryGroups::ID: |
47 |
| - return TopDialogCategory::Group; |
48 |
| - case td_api::topChatCategoryChannels::ID: |
49 |
| - return TopDialogCategory::Channel; |
50 |
| - case td_api::topChatCategoryCalls::ID: |
51 |
| - return TopDialogCategory::Call; |
52 |
| - case td_api::topChatCategoryForwardChats::ID: |
53 |
| - return TopDialogCategory::ForwardUsers; |
54 |
| - default: |
55 |
| - UNREACHABLE(); |
56 |
| - } |
57 |
| -} |
58 |
| - |
59 | 26 | class TopDialogManager : public NetQueryCallback {
|
60 | 27 | public:
|
61 | 28 | explicit TopDialogManager(ActorShared<> parent) : parent_(std::move(parent)) {
|
|
0 commit comments