feat: /clearmessages command (#2485)

This commit is contained in:
Karar Al-Remahy
2021-03-14 18:25:45 +01:00
committed by GitHub
parent fd3efe0e15
commit 49bd1bd488
2 changed files with 12 additions and 0 deletions
@@ -22,6 +22,7 @@
#include "util/Twitch.hpp"
#include "widgets/Window.hpp"
#include "widgets/dialogs/UserInfoPopup.hpp"
#include "widgets/splits/Split.hpp"
#include <QApplication>
#include <QFile>
@@ -633,6 +634,16 @@ void CommandController::initialize(Settings &, Paths &paths)
return "";
});
this->registerCommand("/clearmessages", [](const auto & /*words*/,
ChannelPtr channel) {
auto *currentPage = dynamic_cast<SplitContainer *>(
getApp()->windows->getMainWindow().getNotebook().getSelectedPage());
currentPage->getSelectedSplit()->getChannelView().clearMessages();
return "";
});
}
void CommandController::save()