mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 14:45:14 +00:00
stopping gifs on history close, only one gif playing
This commit is contained in:
@@ -2428,6 +2428,7 @@ namespace App {
|
||||
}
|
||||
|
||||
void regGifItem(ClipReader *reader, HistoryItem *item) {
|
||||
stopGifItems();
|
||||
::gifItems.insert(reader, item);
|
||||
}
|
||||
|
||||
@@ -2439,6 +2440,16 @@ namespace App {
|
||||
return ::gifItems;
|
||||
}
|
||||
|
||||
void stopGifItems() {
|
||||
while (!::gifItems.isEmpty()) {
|
||||
if (HistoryItem *playing = ::gifItems.begin().value()) {
|
||||
if (playing->getMedia() && playing->getMedia()->type() == MediaTypeGif) {
|
||||
static_cast<HistoryGif*>(playing->getMedia())->stop(playing);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QString phoneFromSharedContact(int32 userId) {
|
||||
SharedContactItems::const_iterator i = ::sharedContactItems.constFind(userId);
|
||||
if (i != ::sharedContactItems.cend()) {
|
||||
|
Reference in New Issue
Block a user