diff --git a/Telegram/SourceFiles/ayu/sync/ayu_sync_controller.cpp b/Telegram/SourceFiles/ayu/sync/ayu_sync_controller.cpp index ebe5a6492..4e7a8c371 100644 --- a/Telegram/SourceFiles/ayu/sync/ayu_sync_controller.cpp +++ b/Telegram/SourceFiles/ayu/sync/ayu_sync_controller.cpp @@ -68,11 +68,11 @@ namespace AyuSync { } void ayu_sync_controller::invokeHandler(json p) { - DEBUG_LOG(("Invoking handler on %1").arg(p.dump().c_str())); + LOG(("Invoking handler on %1").arg(p.dump().c_str())); auto userId = p["userId"].get(); auto type = p["type"].get(); - DEBUG_LOG(("userId: %1, type: %1").arg(userId).arg(type.c_str())); + LOG(("userId: %1, type: %1").arg(userId).arg(type.c_str())); } } \ No newline at end of file diff --git a/Telegram/SourceFiles/history/view/history_view_context_menu.cpp b/Telegram/SourceFiles/history/view/history_view_context_menu.cpp index 7dca2d0f0..28480b4a9 100644 --- a/Telegram/SourceFiles/history/view/history_view_context_menu.cpp +++ b/Telegram/SourceFiles/history/view/history_view_context_menu.cpp @@ -1079,23 +1079,25 @@ base::unique_qptr FillContextMenu( } } - if (AyuDatabase::editedMessagesTableExists() && !((AyuDatabase::getEditedMessages(item)).empty())) { - result->addAction(QString("History"), [=] { - auto box = Box(item); - Ui::show(std::move(box)); - }, &st::menuIconInfo); + if (item != nullptr) { + if (AyuDatabase::editedMessagesTableExists() && !((AyuDatabase::getEditedMessages(item)).empty())) { + result->addAction(QString("History"), [=] { + auto box = Box(item); + Ui::show(std::move(box)); + }, &st::menuIconInfo); + } + + const auto settings = &AyuSettings::getInstance(); + const auto history = item->history(); + result->addAction(QString("Hide"), [=]() { + const auto initKeepDeleted = settings->keepDeletedMessages; + + settings->set_keepDeletedMessages(false); + history->destroyMessage(item); + settings->set_keepDeletedMessages(initKeepDeleted); + }, &st::menuIconClear); } - const auto settings = &AyuSettings::getInstance(); - const auto history = item->history(); - result->addAction(QString("Hide"), [=]() { - const auto initKeepDeleted = settings->keepDeletedMessages; - - settings->set_keepDeletedMessages(false); - history->destroyMessage(item); - settings->set_keepDeletedMessages(initKeepDeleted); - }, &st::menuIconClear); - if (!view || !list->hasCopyRestriction(view->data())) { AddCopyLinkAction(result, link); }