Added ability to choose to show recent group history for each new user.

Fixed #9864.
This commit is contained in:
23rd
2022-07-07 15:51:15 +03:00
committed by John Preston
parent c14d9b18f7
commit 5fbbdd8a9e
6 changed files with 67 additions and 11 deletions
@@ -462,13 +462,14 @@ void ChatParticipants::requestCountDelayed(
void ChatParticipants::add(
not_null<PeerData*> peer,
const std::vector<not_null<UserData*>> &users,
bool passGroupHistory,
Fn<void(bool)> done) {
if (const auto chat = peer->asChat()) {
for (const auto &user : users) {
_api.request(MTPmessages_AddChatUser(
chat->inputChat,
user->inputUser,
MTP_int(kForwardMessagesOnAdd)
MTP_int(passGroupHistory ? kForwardMessagesOnAdd : 0)
)).done([=](const MTPUpdates &result) {
chat->session().api().applyUpdates(result);
if (done) done(true);