Skip to content

Commit

Permalink
fix: crash
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyZavar committed Feb 20, 2024
1 parent 3a9b470 commit e580640
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Telegram/SourceFiles/data/data_session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4263,8 +4263,9 @@ void Session::registerItemView(not_null<ViewElement*> view) {
}

void Session::unregisterItemView(not_null<ViewElement*> view) {
if (!_heavyViewParts.contains(view)) {
return; // AyuGram: fix crash when using `saveDeletedMessages`
// Expects(!_heavyViewParts.contains(view));
if (_heavyViewParts.contains(view)) {
view->unloadHeavyPart(); // AyuGram: fix crash when using `saveDeletedMessages`
}

_shownSpoilers.remove(view);
Expand Down
1 change: 1 addition & 0 deletions Telegram/SourceFiles/history/history_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3273,6 +3273,7 @@ void HistoryWidget::messagesReceived(
not_null<PeerData*> peer,
const MTPmessages_Messages &messages,
int requestId) {
// Expects(_history != nullptr);
if (!_history) {
return; // AyuGram: fix crash when using `saveDeletedMessages`
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -788,8 +788,8 @@ void TopBarWidget::backClicked() {
auto settings = &AyuSettings::getInstance();
if (settings->hideAllChatsFolder) {
const auto filters = &_controller->session().data().chatsFilters();
const auto lookup_id = filters->lookupId(_controller->session().premium() ? 0 : 1);
_controller->setActiveChatsFilter(lookup_id);
const auto lookupId = filters->lookupId(_controller->session().premium() ? 0 : 1);
_controller->setActiveChatsFilter(lookupId);
} else {
_controller->closeFolder();
}
Expand Down

0 comments on commit e580640

Please sign in to comment.