2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-01 15:05:56 +00:00

Allow enabling forum, creating topics.

This commit is contained in:
John Preston
2022-09-20 22:12:30 +04:00
parent c88140e256
commit 388fe6adfb
21 changed files with 781 additions and 49 deletions

View File

@@ -46,6 +46,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_chat.h"
#include "data/data_user.h"
#include "data/data_folder.h"
#include "data/data_forum.h"
#include "data/data_forum_topic.h"
#include "data/data_histories.h"
#include "data/data_changes.h"
#include "data/data_download_manager.h"
@@ -261,7 +263,11 @@ Widget::Widget(
const auto openSearchResult = !controller->selectingPeer()
&& row.filteredRow;
const auto history = row.key.history();
if (history && history->peer->isForum()) {
if (const auto forumTopic = row.key.forumTopic()) {
controller->showRepliesForMessage(
forumTopic->forum(),
forumTopic->rootId());
} else if (history && history->peer->isForum()) {
controller->openForum(history->peer->asChannel());
} else if (history) {
const auto peer = history->peer;
@@ -372,6 +378,8 @@ Widget::Widget(
&& _searchFull
&& !_searchFullMigrated))) {
searchMore();
} else if (_openedForum) {
_openedForum->forum()->requestTopics();
} else {
const auto folder = _inner->shownFolder();
if (!folder || !folder->chatsList()->loaded()) {