No 'Clear History' for everyone in groups.

This commit is contained in:
John Preston 2021-02-19 14:18:13 +04:00
parent 018232680f
commit 0a678ae8bd
4 changed files with 7 additions and 9 deletions

View file

@ -1568,7 +1568,7 @@ channels.editBanned#72796912 channel:InputChannel user_id:InputUser banned_right
channels.getAdminLog#33ddf480 flags:# channel:InputChannel q:string events_filter:flags.0?ChannelAdminLogEventsFilter admins:flags.1?Vector<InputUser> max_id:long min_id:long limit:int = channels.AdminLogResults; channels.getAdminLog#33ddf480 flags:# channel:InputChannel q:string events_filter:flags.0?ChannelAdminLogEventsFilter admins:flags.1?Vector<InputUser> max_id:long min_id:long limit:int = channels.AdminLogResults;
channels.setStickers#ea8ca4f9 channel:InputChannel stickerset:InputStickerSet = Bool; channels.setStickers#ea8ca4f9 channel:InputChannel stickerset:InputStickerSet = Bool;
channels.readMessageContents#eab5dc38 channel:InputChannel id:Vector<int> = Bool; channels.readMessageContents#eab5dc38 channel:InputChannel id:Vector<int> = Bool;
channels.deleteHistory#bda41f3f flags:# for_everyone:flags.0?true channel:InputChannel max_id:int = Bool; channels.deleteHistory#af369d42 channel:InputChannel max_id:int = Bool;
channels.togglePreHistoryHidden#eabbb94c channel:InputChannel enabled:Bool = Updates; channels.togglePreHistoryHidden#eabbb94c channel:InputChannel enabled:Bool = Updates;
channels.getLeftChannels#8341ecc0 offset:int = messages.Chats; channels.getLeftChannels#8341ecc0 offset:int = messages.Chats;
channels.getGroupsForDiscussion#f5dad378 = messages.Chats; channels.getGroupsForDiscussion#f5dad378 = messages.Chats;

View file

@ -750,6 +750,8 @@ auto DeleteMessagesBox::revokeText(not_null<PeerData*> peer) const
tr::now, tr::now,
lt_user, lt_user,
user->firstName); user->firstName);
} else if (_wipeHistoryJustClear) {
return std::nullopt;
} else { } else {
result.checkbox = tr::lng_delete_for_everyone_check(tr::now); result.checkbox = tr::lng_delete_for_everyone_check(tr::now);
} }

View file

@ -606,11 +606,7 @@ void Histories::deleteAllMessages(
// } // }
}).send(); }).send();
} else if (channel) { } else if (channel) {
const auto flags = revoke
? MTPchannels_DeleteHistory::Flag::f_for_everyone
: MTPchannels_DeleteHistory::Flag(0);
return session().api().request(MTPchannels_DeleteHistory( return session().api().request(MTPchannels_DeleteHistory(
MTP_flags(flags),
channel->inputChannel, channel->inputChannel,
MTP_int(deleteTillId) MTP_int(deleteTillId)
)).done([=](const MTPBool &result) { )).done([=](const MTPBool &result) {

View file

@ -583,16 +583,16 @@ void Filler::addChannelActions(not_null<ChannelData*> channel) {
} }
} }
if (channel->amIn()) { if (channel->amIn()) {
auto text = isGroup
? tr::lng_profile_leave_group(tr::now)
: tr::lng_profile_leave_channel(tr::now);
_addAction(text, DeleteAndLeaveHandler(channel));
if ((isGroup && !channel->isPublic()) if ((isGroup && !channel->isPublic())
|| channel->canDeleteMessages()) { || channel->canDeleteMessages()) {
_addAction( _addAction(
tr::lng_profile_clear_history(tr::now), tr::lng_profile_clear_history(tr::now),
ClearHistoryHandler(channel)); ClearHistoryHandler(channel));
} }
auto text = isGroup
? tr::lng_profile_leave_group(tr::now)
: tr::lng_profile_leave_channel(tr::now);
_addAction(text, DeleteAndLeaveHandler(channel));
} else { } else {
auto text = isGroup auto text = isGroup
? tr::lng_profile_join_group(tr::now) ? tr::lng_profile_join_group(tr::now)