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

Method readBotStorage

Telegram/SourceFiles/storage/storage_account.cpp:3662–3688  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3660}
3661
3662QByteArray Account::readBotStorage(PeerId botId) {
3663 if (!_botStoragesNotReadMap.remove(botId)) {
3664 return {};
3665 }
3666
3667 const auto j = _botStoragesMap.find(botId);
3668 if (j == _botStoragesMap.cend()) {
3669 return {};
3670 }
3671 FileReadDescriptor storage;
3672 if (!ReadEncryptedFile(storage, j->second, _basePath, _localKey)) {
3673 ClearKey(j->second, _basePath);
3674 _botStoragesMap.erase(j);
3675 writeMapDelayed();
3676 return {};
3677 }
3678
3679 auto result = QByteArray();
3680 storage.stream >> result;
3681 if (storage.stream.status() != QDataStream::Ok) {
3682 ClearKey(j->second, _basePath);
3683 _botStoragesMap.erase(j);
3684 writeMapDelayed();
3685 return {};
3686 }
3687 return result;
3688}
3689
3690bool Account::encrypt(
3691 const void *src,

Callers 1

readFromDiskMethod · 0.80

Calls 8

ReadEncryptedFileFunction · 0.85
ClearKeyFunction · 0.85
QByteArrayClass · 0.85
removeMethod · 0.45
findMethod · 0.45
cendMethod · 0.45
eraseMethod · 0.45
statusMethod · 0.45

Tested by

no test coverage detected