mirror of
https://github.com/telegramdesktop/tdesktop
synced 2024-12-24 15:34:20 +00:00
parent
fb847135b5
commit
826d6011a1
@ -1661,6 +1661,9 @@ void ApiWrap::requestSelfParticipant(not_null<ChannelData*> channel) {
|
||||
}
|
||||
|
||||
const auto finalize = [=](UserId inviter, TimeId inviteDate) {
|
||||
if (inviter < 0) {
|
||||
channel->markForbidden();
|
||||
}
|
||||
channel->inviter = inviter;
|
||||
channel->inviteDate = inviteDate;
|
||||
if (const auto history = _session->data().historyLoaded(channel)) {
|
||||
|
@ -267,6 +267,17 @@ void ChannelData::applyEditBanned(not_null<UserData*> user, const MTPChatBannedR
|
||||
Notify::peerUpdatedDelayed(this, flags);
|
||||
}
|
||||
|
||||
void ChannelData::markForbidden() {
|
||||
owner().processChat(MTP_channelForbidden(
|
||||
MTP_flags(isMegagroup()
|
||||
? MTPDchannelForbidden::Flag::f_megagroup
|
||||
: MTPDchannelForbidden::Flag::f_broadcast),
|
||||
MTP_int(bareId()),
|
||||
MTP_long(access),
|
||||
MTP_string(name),
|
||||
MTPint()));
|
||||
}
|
||||
|
||||
bool ChannelData::isGroupAdmin(not_null<UserData*> user) const {
|
||||
if (auto info = mgInfo.get()) {
|
||||
return info->admins.contains(peerToUser(user->id));
|
||||
|
@ -180,6 +180,8 @@ public:
|
||||
const MTPChatBannedRights &oldRights,
|
||||
const MTPChatBannedRights &newRights);
|
||||
|
||||
void markForbidden();
|
||||
|
||||
bool isGroupAdmin(not_null<UserData*> user) const;
|
||||
|
||||
bool lastParticipantsCountOutdated() const {
|
||||
|
@ -2454,7 +2454,7 @@ void History::dialogEntryApplied() {
|
||||
if (!chatListMessage()) {
|
||||
if (const auto channel = peer->asChannel()) {
|
||||
const auto inviter = channel->inviter;
|
||||
if (inviter != 0 && channel->amIn()) {
|
||||
if (inviter > 0 && channel->amIn()) {
|
||||
if (const auto from = owner().userLoaded(inviter)) {
|
||||
clear(ClearType::Unload);
|
||||
addNewerSlice(QVector<MTPMessage>());
|
||||
|
Loading…
Reference in New Issue
Block a user