mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Close chat/media if thrown out by admin.
This commit is contained in:
@@ -165,6 +165,7 @@ void ChannelData::setFlags(ChannelDataFlags which) {
|
||||
const auto taken = ((diff & Flag::Forum) && !(which & Flag::Forum))
|
||||
? mgInfo->takeForumData()
|
||||
: nullptr;
|
||||
const auto wasIn = amIn();
|
||||
if ((diff & Flag::Forum) && (which & Flag::Forum)) {
|
||||
mgInfo->ensureForum(this);
|
||||
}
|
||||
@@ -174,6 +175,14 @@ void ChannelData::setFlags(ChannelDataFlags which) {
|
||||
session().changes().peerUpdated(chat, UpdateFlag::Migration);
|
||||
session().changes().peerUpdated(this, UpdateFlag::Migration);
|
||||
}
|
||||
|
||||
if (wasIn && !amIn()) {
|
||||
crl::on_main(&session(), [=] {
|
||||
if (!amIn()) {
|
||||
Core::App().closeChatFromWindows(this);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
if (diff & (Flag::Forum | Flag::CallNotEmpty | Flag::SimilarExpanded)) {
|
||||
if (const auto history = this->owner().historyLoaded(this)) {
|
||||
|
Reference in New Issue
Block a user