Initial support for min-user-from-message request.

This commit is contained in:
John Preston
2025-12-18 21:18:33 +04:00
parent 66645ce523
commit 53324d5494
12 changed files with 184 additions and 136 deletions
+16
View File
@@ -33,6 +33,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_wall_paper.h"
#include "data/notify/data_notify_settings.h"
#include "history/history.h"
#include "history/history_item.h"
#include "api/api_peer_photo.h"
#include "apiwrap.h"
#include "lang/lang_keys.h"
@@ -317,6 +318,21 @@ void UserData::setPersonalChannel(ChannelId channelId, MsgId messageId) {
}
}
MTPInputUser UserData::inputUser() const {
const auto item = isLoaded() ? nullptr : owner().messageWithPeer(id);
if (item) {
return MTP_inputUserFromMessage(
item->history()->peer->input(),
MTP_int(item->id.bare),
MTP_long(peerToUser(id).bare));
} else if (isSelf()) {
return MTP_inputUserSelf();
}
return MTP_inputUser(
MTP_long(peerToUser(id).bare),
MTP_long(_accessHash));
}
void UserData::setName(
const QString &newFirstName,
const QString &newLastName,