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:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user