Removed requesting of full peers from box of applying TTL for chats.
Since TTL is provided from the dialog info.
This commit is contained in:
parent
33c0c79593
commit
beb062dd64
|
@ -12,6 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "boxes/peer_list_controllers.h"
|
#include "boxes/peer_list_controllers.h"
|
||||||
#include "data/data_changes.h"
|
#include "data/data_changes.h"
|
||||||
#include "data/data_peer.h"
|
#include "data/data_peer.h"
|
||||||
|
#include "data/data_session.h"
|
||||||
#include "history/history.h"
|
#include "history/history.h"
|
||||||
#include "lang/lang_keys.h"
|
#include "lang/lang_keys.h"
|
||||||
#include "lottie/lottie_icon.h"
|
#include "lottie/lottie_icon.h"
|
||||||
|
@ -126,6 +127,9 @@ std::unique_ptr<TTLChatsBoxController::Row> TTLChatsBoxController::createRow(
|
||||||
} else if (!history->peer->canWrite()) {
|
} else if (!history->peer->canWrite()) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
if (session().data().contactsNoChatsList()->contains({ history })) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
auto result = std::make_unique<TTLRow>(history);
|
auto result = std::make_unique<TTLRow>(history);
|
||||||
const auto applyStatus = [=, raw = result.get()] {
|
const auto applyStatus = [=, raw = result.get()] {
|
||||||
const auto ttl = history->peer->messagesTTL();
|
const auto ttl = history->peer->messagesTTL();
|
||||||
|
@ -138,13 +142,6 @@ std::unique_ptr<TTLChatsBoxController::Row> TTLChatsBoxController::createRow(
|
||||||
: tr::lng_settings_ttl_select_chats_status_disabled(tr::now),
|
: tr::lng_settings_ttl_select_chats_status_disabled(tr::now),
|
||||||
ttl);
|
ttl);
|
||||||
};
|
};
|
||||||
if (!history->peer->messagesTTL()) {
|
|
||||||
session().api().requestFullPeer(history->peer);
|
|
||||||
session().changes().peerUpdates(
|
|
||||||
history->peer,
|
|
||||||
Data::PeerUpdate::Flag::FullInfo
|
|
||||||
) | rpl::take(1) | rpl::start_with_next(applyStatus, _lifetime);
|
|
||||||
}
|
|
||||||
applyStatus();
|
applyStatus();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue