mirror of https://github.com/procxx/kepka.git
Added canceling upload edit media to Data::Media destructors.
- We should stop upload media if message was deleted from other client.
This commit is contained in:
parent
5554867553
commit
67572b0d9a
|
@ -38,6 +38,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "data/data_channel.h"
|
#include "data/data_channel.h"
|
||||||
#include "lang/lang_keys.h"
|
#include "lang/lang_keys.h"
|
||||||
#include "layout.h"
|
#include "layout.h"
|
||||||
|
#include "storage/file_upload.h"
|
||||||
|
|
||||||
namespace Data {
|
namespace Data {
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -262,6 +263,9 @@ MediaPhoto::MediaPhoto(
|
||||||
}
|
}
|
||||||
|
|
||||||
MediaPhoto::~MediaPhoto() {
|
MediaPhoto::~MediaPhoto() {
|
||||||
|
if (uploading() && !App::quitting()) {
|
||||||
|
parent()->history()->session().uploader().cancel(parent()->fullId());
|
||||||
|
}
|
||||||
parent()->history()->owner().unregisterPhotoItem(_photo, parent());
|
parent()->history()->owner().unregisterPhotoItem(_photo, parent());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -499,6 +503,9 @@ MediaFile::MediaFile(
|
||||||
}
|
}
|
||||||
|
|
||||||
MediaFile::~MediaFile() {
|
MediaFile::~MediaFile() {
|
||||||
|
if (uploading() && !App::quitting()) {
|
||||||
|
parent()->history()->session().uploader().cancel(parent()->fullId());
|
||||||
|
}
|
||||||
parent()->history()->owner().unregisterDocumentItem(
|
parent()->history()->owner().unregisterDocumentItem(
|
||||||
_document,
|
_document,
|
||||||
parent());
|
parent());
|
||||||
|
|
|
@ -767,9 +767,6 @@ void HistoryItem::drawInDialog(
|
||||||
HistoryItem::~HistoryItem() {
|
HistoryItem::~HistoryItem() {
|
||||||
_history->owner().notifyItemRemoved(this);
|
_history->owner().notifyItemRemoved(this);
|
||||||
App::historyUnregItem(this);
|
App::historyUnregItem(this);
|
||||||
if (id < 0 && !App::quitting()) {
|
|
||||||
_history->session().uploader().cancel(fullId());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QDateTime ItemDateTime(not_null<const HistoryItem*> item) {
|
QDateTime ItemDateTime(not_null<const HistoryItem*> item) {
|
||||||
|
|
Loading…
Reference in New Issue