mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 22:55:11 +00:00
Version bumped to 0.9.61 stable.
Merge branch 'archived_stickers' into cancel_reset. Conflicts: Telegram/Resources/winrc/Telegram.rc Telegram/Resources/winrc/Updater.rc Telegram/SourceFiles/app.cpp Telegram/SourceFiles/core/version.h Telegram/SourceFiles/localstorage.cpp Telegram/Telegram.vcxproj.filters Telegram/Telegram.xcodeproj/project.pbxproj Telegram/build/version
This commit is contained in:
@@ -889,13 +889,13 @@ bool StickerData::setInstalled() const {
|
||||
switch (set.type()) {
|
||||
case mtpc_inputStickerSetID: {
|
||||
auto it = Global::StickerSets().constFind(set.c_inputStickerSetID().vid.v);
|
||||
return (it != Global::StickerSets().cend()) && !(it->flags & MTPDstickerSet::Flag::f_disabled);
|
||||
return (it != Global::StickerSets().cend()) && !(it->flags & MTPDstickerSet::Flag::f_archived) && (it->flags & MTPDstickerSet::Flag::f_installed);
|
||||
} break;
|
||||
case mtpc_inputStickerSetShortName: {
|
||||
QString name = qs(set.c_inputStickerSetShortName().vshort_name).toLower();
|
||||
for (auto it = Global::StickerSets().cbegin(), e = Global::StickerSets().cend(); it != e; ++it) {
|
||||
if (it->shortName.toLower() == name) {
|
||||
return !(it->flags & MTPDstickerSet::Flag::f_disabled);
|
||||
return !(it->flags & MTPDstickerSet::Flag::f_archived) && (it->flags & MTPDstickerSet::Flag::f_installed);
|
||||
}
|
||||
}
|
||||
} break;
|
||||
@@ -1095,10 +1095,11 @@ VoiceData::~VoiceData() {
|
||||
DocumentAdditionalData::~DocumentAdditionalData() {
|
||||
}
|
||||
|
||||
DocumentData::DocumentData(DocumentId id, int32 dc, uint64 accessHash, const QString &url, const QVector<MTPDocumentAttribute> &attributes)
|
||||
DocumentData::DocumentData(DocumentId id, int32 dc, uint64 accessHash, int32 version, const QString &url, const QVector<MTPDocumentAttribute> &attributes)
|
||||
: id(id)
|
||||
, _dc(dc)
|
||||
, _access(accessHash)
|
||||
, _version(version)
|
||||
, _url(url) {
|
||||
setattributes(attributes);
|
||||
if (_dc && _access) {
|
||||
@@ -1107,15 +1108,15 @@ DocumentData::DocumentData(DocumentId id, int32 dc, uint64 accessHash, const QSt
|
||||
}
|
||||
|
||||
DocumentData *DocumentData::create(DocumentId id) {
|
||||
return new DocumentData(id, 0, 0, QString(), QVector<MTPDocumentAttribute>());
|
||||
return new DocumentData(id, 0, 0, 0, QString(), QVector<MTPDocumentAttribute>());
|
||||
}
|
||||
|
||||
DocumentData *DocumentData::create(DocumentId id, int32 dc, uint64 accessHash, const QVector<MTPDocumentAttribute> &attributes) {
|
||||
return new DocumentData(id, dc, accessHash, QString(), attributes);
|
||||
DocumentData *DocumentData::create(DocumentId id, int32 dc, uint64 accessHash, int32 version, const QVector<MTPDocumentAttribute> &attributes) {
|
||||
return new DocumentData(id, dc, accessHash, version, QString(), attributes);
|
||||
}
|
||||
|
||||
DocumentData *DocumentData::create(DocumentId id, const QString &url, const QVector<MTPDocumentAttribute> &attributes) {
|
||||
return new DocumentData(id, 0, 0, url, attributes);
|
||||
return new DocumentData(id, 0, 0, 0, url, attributes);
|
||||
}
|
||||
|
||||
void DocumentData::setattributes(const QVector<MTPDocumentAttribute> &attributes) {
|
||||
@@ -1396,7 +1397,7 @@ void DocumentData::save(const QString &toFile, ActionOnLoad action, const FullMs
|
||||
if (!_access && !_url.isEmpty()) {
|
||||
_loader = new webFileLoader(_url, toFile, fromCloud, autoLoading);
|
||||
} else {
|
||||
_loader = new mtpFileLoader(_dc, id, _access, locationType(), toFile, size, (saveToCache() ? LoadToCacheAsWell : LoadToFileOnly), fromCloud, autoLoading);
|
||||
_loader = new mtpFileLoader(_dc, id, _access, _version, locationType(), toFile, size, (saveToCache() ? LoadToCacheAsWell : LoadToFileOnly), fromCloud, autoLoading);
|
||||
}
|
||||
_loader->connect(_loader, SIGNAL(progress(FileLoader*)), App::main(), SLOT(documentLoadProgress(FileLoader*)));
|
||||
_loader->connect(_loader, SIGNAL(failed(FileLoader*,bool)), App::main(), SLOT(documentLoadFailed(FileLoader*,bool)));
|
||||
@@ -1537,6 +1538,22 @@ void DocumentData::recountIsImage() {
|
||||
_duration = fileIsImage(name, mime) ? 1 : -1; // hack
|
||||
}
|
||||
|
||||
bool DocumentData::setRemoteVersion(int32 version) {
|
||||
if (_version == version) {
|
||||
return false;
|
||||
}
|
||||
_version = version;
|
||||
_location = FileLocation();
|
||||
_data = QByteArray();
|
||||
status = FileReady;
|
||||
if (loading()) {
|
||||
_loader->deleteLater();
|
||||
_loader->stop();
|
||||
_loader = nullptr;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void DocumentData::setRemoteLocation(int32 dc, uint64 access) {
|
||||
_dc = dc;
|
||||
_access = access;
|
||||
|
Reference in New Issue
Block a user