2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Stop playing documents when items are deleted.

This commit is contained in:
John Preston
2020-10-23 15:22:38 +03:00
parent 47bb8ec687
commit 3d54a263b8
8 changed files with 49 additions and 4 deletions

View File

@@ -31,6 +31,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "storage/storage_account.h"
#include "storage/storage_encrypted_file.h"
#include "media/player/media_player_instance.h" // instance()->play()
#include "media/audio/media_audio.h"
#include "boxes/abstract_box.h"
#include "passport/passport_form_controller.h"
#include "window/themes/window_theme.h"
@@ -3333,6 +3334,15 @@ void Session::unregisterContactItem(
}
}
void Session::documentMessageRemoved(not_null<DocumentData*> document) {
if (_documentItems.find(document) != _documentItems.end()) {
return;
}
if (document->loading()) {
document->cancel();
}
}
void Session::checkPlayingAnimations() {
auto check = base::flat_set<not_null<ViewElement*>>();
for (const auto view : _heavyViewParts) {