MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / saveSelfBio

Method saveSelfBio

Telegram/SourceFiles/apiwrap.cpp:5147–5169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5145}
5146
5147void ApiWrap::saveSelfBio(const QString &text) {
5148 if (_bio.requestId) {
5149 if (text != _bio.requestedText) {
5150 request(_bio.requestId).cancel();
5151 } else {
5152 return;
5153 }
5154 }
5155 _bio.requestedText = text;
5156 _bio.requestId = request(MTPaccount_UpdateProfile(
5157 MTP_flags(MTPaccount_UpdateProfile::Flag::f_about),
5158 MTPstring(),
5159 MTPstring(),
5160 MTP_string(text)
5161 )).done([=](const MTPUser &result) {
5162 _bio.requestId = 0;
5163
5164 _session->data().processUser(result);
5165 _session->user()->setAbout(_bio.requestedText);
5166 }).fail([=] {
5167 _bio.requestId = 0;
5168 }).send();
5169}
5170
5171void ApiWrap::registerStatsRequest(MTP::DcId dcId, mtpRequestId id) {
5172 _statsRequests[dcId].emplace(id);

Callers 3

SetupEmailLockWidgetMethod · 0.80
verifyCodeMethod · 0.80
SetupBioFunction · 0.80

Calls 10

MTP_flagsFunction · 0.85
MTP_stringFunction · 0.85
processUserMethod · 0.80
cancelMethod · 0.45
sendMethod · 0.45
failMethod · 0.45
doneMethod · 0.45
dataMethod · 0.45
setAboutMethod · 0.45
userMethod · 0.45

Tested by

no test coverage detected