2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Add a create feed channels list box.

This commit is contained in:
John Preston
2018-02-20 19:56:41 +03:00
parent 74aa1ad71e
commit 17a4d19beb
8 changed files with 263 additions and 52 deletions

View File

@@ -5039,7 +5039,7 @@ void MainWidget::feedUpdate(const MTPUpdate &update) {
case mtpc_updateChannel: {
auto &d = update.c_updateChannel();
if (const auto channel = App::channelLoaded(d.vchannel_id.v)) {
channel->inviter = 0;
channel->inviter = UserId(0);
if (!channel->amIn()) {
if (const auto history = App::historyLoaded(channel->id)) {
history->updateChatListExistence();
@@ -5048,6 +5048,18 @@ void MainWidget::feedUpdate(const MTPUpdate &update) {
_updatedChannels.insert(channel, true);
Auth().api().requestSelfParticipant(channel);
}
if (const auto feed = channel->feed()) {
if (!feed->lastMessageKnown()
|| !feed->unreadCountKnown()) {
Auth().api().requestDialogEntry(feed);
}
} else if (channel->amIn()) {
const auto history = App::history(channel->id);
if (!history->lastMessageKnown()
|| !history->unreadCountKnown()) {
Auth().api().requestDialogEntry(history);
}
}
}
} break;