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

Method setBotInfoVersion

Telegram/SourceFiles/data/data_user.cpp:407–426  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

405}
406
407void UserData::setBotInfoVersion(int version) {
408 if (version < 0) {
409 // We don't support bots becoming non-bots.
410 if (botInfo) {
411 botInfo->version = -1;
412 }
413 } else if (!botInfo) {
414 botInfo = std::make_unique<BotInfo>();
415 botInfo->version = version;
416 owner().userIsBotChanged(this);
417 } else if (botInfo->version < version) {
418 if (!botInfo->commands.empty()) {
419 botInfo->commands.clear();
420 owner().botCommandsChanged(this);
421 }
422 botInfo->description.clear();
423 botInfo->version = version;
424 botInfo->inited = false;
425 }
426}
427
428void UserData::setBotInfo(const MTPBotInfo &info) {
429 switch (info.type()) {

Callers 3

ApplyUserUpdateFunction · 0.80
processUserMethod · 0.80
readPeerFunction · 0.80

Calls 4

userIsBotChangedMethod · 0.80
botCommandsChangedMethod · 0.80
emptyMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected