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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View file

@ -7,6 +7,7 @@
- Major: Added Streamer Mode configuration (under `Settings -> General`), where you can select which features of Chatterino should behave differently when you are in Streamer Mode. (#2001, #2316, #2342, #2376)
- Major: Color mentions to match the mentioned users. You can disable this by unchecking "Color @usernames" under `Settings -> General -> Advanced (misc.)`. (#1963, #2284)
- Major: Commands `/ignore` and `/unignore` have been renamed to `/block` and `/unblock` in order to keep consistency with Twitch's terms. (#2370)
- Minor: Added `/clearmessages` command - does what "Burger menu -> More -> Clear messages" does. (#2485)
- Minor: Added `/marker` command - similar to webchat, it creates a stream marker. (#2360)
- Minor: Added `/chatters` command showing chatter count. (#2344)
- Minor: Added a button to the split context menu to open the moderation view for a channel when the account selected has moderator permissions. (#2321)

View file

@ -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>
@ -631,6 +632,16 @@ void CommandController::initialize(Settings &, Paths &paths)
QString("Opening %1 in streamlink...").arg(words[1])));
openStreamlinkForChannel(words[1]);
return "";
});
this->registerCommand("/clearmessages", [](const auto & /*words*/,
ChannelPtr channel) {
auto *currentPage = dynamic_cast<SplitContainer *>(
getApp()->windows->getMainWindow().getNotebook().getSelectedPage());
currentPage->getSelectedSplit()->getChannelView().clearMessages();
return "";
});
}