mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Removed dcId from passport FileKey.
This commit is contained in:
parent
559d488b0b
commit
b3f8d0e81a
3 changed files with 6 additions and 7 deletions
|
@ -1745,7 +1745,7 @@ void FormController::loadFile(File &file) {
|
|||
return;
|
||||
}
|
||||
|
||||
const auto key = FileKey{ file.id, file.dcId };
|
||||
const auto key = FileKey{ file.id };
|
||||
const auto i = _fileLoaders.find(key);
|
||||
if (i != _fileLoaders.end()) {
|
||||
return;
|
||||
|
@ -2466,14 +2466,14 @@ EditFile *FormController::findEditFile(const FullMsgId &fullId) {
|
|||
|
||||
EditFile *FormController::findEditFile(const FileKey &key) {
|
||||
return findEditFileByCondition([&](const EditFile &file) {
|
||||
return (file.fields.dcId == key.dcId && file.fields.id == key.id);
|
||||
return (file.fields.id == key.id);
|
||||
});
|
||||
}
|
||||
|
||||
auto FormController::findFile(const FileKey &key)
|
||||
-> std::pair<Value*, File*> {
|
||||
const auto found = [&](const File &file) {
|
||||
return (file.dcId == key.dcId) && (file.id == key.id);
|
||||
return (file.id == key.id);
|
||||
};
|
||||
for (auto &pair : _form.values) {
|
||||
auto &value = pair.second;
|
||||
|
|
|
@ -336,16 +336,15 @@ struct PasswordSettings {
|
|||
|
||||
struct FileKey {
|
||||
uint64 id = 0;
|
||||
int32 dcId = 0;
|
||||
|
||||
inline bool operator==(const FileKey &other) const {
|
||||
return (id == other.id) && (dcId == other.dcId);
|
||||
return (id == other.id);
|
||||
}
|
||||
inline bool operator!=(const FileKey &other) const {
|
||||
return !(*this == other);
|
||||
}
|
||||
inline bool operator<(const FileKey &other) const {
|
||||
return (id < other.id) || ((id == other.id) && (dcId < other.dcId));
|
||||
return (id < other.id);
|
||||
}
|
||||
inline bool operator>(const FileKey &other) const {
|
||||
return (other < *this);
|
||||
|
|
|
@ -75,7 +75,7 @@ ScanInfo CollectScanInfo(const EditFile &file) {
|
|||
}();
|
||||
return {
|
||||
file.type,
|
||||
FileKey{ file.fields.id, file.fields.dcId },
|
||||
FileKey{ file.fields.id },
|
||||
!file.fields.error.isEmpty() ? file.fields.error : status,
|
||||
file.fields.image,
|
||||
file.deleted,
|
||||
|
|
Loading…
Add table
Reference in a new issue