mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Minimal layer 72 support.
This commit is contained in:
@@ -287,12 +287,43 @@ void MainWindow::showDelayedServiceMsgs() {
|
||||
void MainWindow::sendServiceHistoryRequest() {
|
||||
if (!_main || !_main->started() || _delayedServiceMsgs.isEmpty() || _serviceHistoryRequest) return;
|
||||
|
||||
UserData *user = App::userLoaded(ServiceUserId);
|
||||
auto user = App::userLoaded(ServiceUserId);
|
||||
if (!user) {
|
||||
auto userFlags = MTPDuser::Flag::f_first_name | MTPDuser::Flag::f_phone | MTPDuser::Flag::f_status | MTPDuser::Flag::f_verified;
|
||||
user = App::feedUsers(MTP_vector<MTPUser>(1, MTP_user(MTP_flags(userFlags), MTP_int(ServiceUserId), MTPlong(), MTP_string("Telegram"), MTPstring(), MTPstring(), MTP_string("42777"), MTP_userProfilePhotoEmpty(), MTP_userStatusRecently(), MTPint(), MTPstring(), MTPstring(), MTPstring())));
|
||||
user = App::feedUsers(MTP_vector<MTPUser>(1, MTP_user(
|
||||
MTP_flags(userFlags),
|
||||
MTP_int(ServiceUserId),
|
||||
MTPlong(),
|
||||
MTP_string("Telegram"),
|
||||
MTPstring(),
|
||||
MTPstring(),
|
||||
MTP_string("42777"),
|
||||
MTP_userProfilePhotoEmpty(),
|
||||
MTP_userStatusRecently(),
|
||||
MTPint(),
|
||||
MTPstring(),
|
||||
MTPstring(),
|
||||
MTPstring())));
|
||||
}
|
||||
_serviceHistoryRequest = MTP::send(MTPmessages_GetHistory(user->input, MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(1), MTP_int(0), MTP_int(0)), _main->rpcDone(&MainWidget::serviceHistoryDone), _main->rpcFail(&MainWidget::serviceHistoryFail));
|
||||
auto offsetId = 0;
|
||||
auto offsetDate = 0;
|
||||
auto addOffset = 0;
|
||||
auto limit = 1;
|
||||
auto maxId = 0;
|
||||
auto minId = 0;
|
||||
auto historyHash = 0;
|
||||
_serviceHistoryRequest = MTP::send(
|
||||
MTPmessages_GetHistory(
|
||||
user->input,
|
||||
MTP_int(offsetId),
|
||||
MTP_int(offsetDate),
|
||||
MTP_int(addOffset),
|
||||
MTP_int(limit),
|
||||
MTP_int(maxId),
|
||||
MTP_int(minId),
|
||||
MTP_int(historyHash)),
|
||||
_main->rpcDone(&MainWidget::serviceHistoryDone),
|
||||
_main->rpcFail(&MainWidget::serviceHistoryFail));
|
||||
}
|
||||
|
||||
void MainWindow::setupMain(const MTPUser *self) {
|
||||
|
Reference in New Issue
Block a user