From 2391ad7d16715f725ec04e12b970252f15290975 Mon Sep 17 00:00:00 2001 From: confuseh Date: Sun, 28 Jan 2018 17:30:14 +0000 Subject: [PATCH 1/6] clang PCH workaround https://bugreports.qt.io/browse/QTBUG-27018 --- chatterino.pro | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/chatterino.pro b/chatterino.pro index 5513c6d6c..201361ff1 100644 --- a/chatterino.pro +++ b/chatterino.pro @@ -17,6 +17,11 @@ DEFINES += QT_DEPRECATED_WARNINGS PRECOMPILED_HEADER = src/precompiled_header.hpp CONFIG += precompile_header +# https://bugreports.qt.io/browse/QTBUG-27018 +equals(QMAKE_CXX, "clang++") { + TARGET = bin/chatterino +} + # Icons macx:ICON = resources/images/chatterino2.icns win32:RC_FILE = resources/windows.rc From 0d417dfa2d169b03dfb5960b82036e20aefff3bf Mon Sep 17 00:00:00 2001 From: fourtf Date: Mon, 29 Jan 2018 13:22:22 +0100 Subject: [PATCH 2/6] minor style changes --- chatterino.pro | 1 - src/widgets/split.cpp | 6 +----- src/widgets/split.hpp | 1 - src/widgets/titlebar.cpp | 13 ------------- src/widgets/window.cpp | 9 +-------- 5 files changed, 2 insertions(+), 28 deletions(-) delete mode 100644 src/widgets/titlebar.cpp diff --git a/chatterino.pro b/chatterino.pro index 201361ff1..2754b545e 100644 --- a/chatterino.pro +++ b/chatterino.pro @@ -115,7 +115,6 @@ SOURCES += \ src/singletons/emotemanager.cpp \ src/messages/messagebuilder.cpp \ src/twitch/twitchmessagebuilder.cpp \ - src/widgets/titlebar.cpp \ src/singletons/accountmanager.cpp \ src/twitch/twitchuser.cpp \ src/ircaccount.cpp \ diff --git a/src/widgets/split.cpp b/src/widgets/split.cpp index 22dcdd67d..e75ededd3 100644 --- a/src/widgets/split.cpp +++ b/src/widgets/split.cpp @@ -1,4 +1,5 @@ #include "widgets/split.hpp" + #include "singletons/channelmanager.hpp" #include "singletons/settingsmanager.hpp" #include "singletons/thememanager.hpp" @@ -137,11 +138,6 @@ ChannelPtr Split::getChannel() const return this->channel; } -ChannelPtr &Split::getChannelRef() -{ - return this->channel; -} - void Split::setChannel(ChannelPtr _newChannel) { this->view.setChannel(_newChannel); diff --git a/src/widgets/split.hpp b/src/widgets/split.hpp index 42ec4c69b..43f1e0481 100644 --- a/src/widgets/split.hpp +++ b/src/widgets/split.hpp @@ -56,7 +56,6 @@ public: const std::string &getUUID() const; ChannelPtr getChannel() const; - ChannelPtr &getChannelRef(); void setFlexSizeX(double x); double getFlexSizeX(); void setFlexSizeY(double y); diff --git a/src/widgets/titlebar.cpp b/src/widgets/titlebar.cpp deleted file mode 100644 index ee3ac7426..000000000 --- a/src/widgets/titlebar.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include "titlebar.hpp" - -namespace chatterino { -namespace widgets { - -TitleBar::TitleBar(QWidget *parent) - : QWidget(parent) -{ - setFixedHeight(32); -} - -} // namespace widgets -} // namespace chatterino diff --git a/src/widgets/window.cpp b/src/widgets/window.cpp index 0b5f58bcc..ed8834c6e 100644 --- a/src/widgets/window.cpp +++ b/src/widgets/window.cpp @@ -47,11 +47,6 @@ Window::Window(const QString &windowName, singletons::ThemeManager &_themeManage QVBoxLayout *layout = new QVBoxLayout(this); - // add titlebar - // if (SettingsManager::getInstance().useCustomWindowFrame.get()) { - // layout->addWidget(&_titleBar); - // } - layout->addWidget(&this->notebook); this->getLayoutContainer()->setLayout(layout); @@ -64,9 +59,7 @@ Window::Window(const QString &windowName, singletons::ThemeManager &_themeManage /// Initialize program-wide hotkeys // CTRL+P: Open Settings Dialog - CreateWindowShortcut(this, "CTRL+P", [] { - SettingsDialog::showDialog(); // - }); + CreateWindowShortcut(this, "CTRL+P", [] { SettingsDialog::showDialog(); }); // CTRL+Number: Switch to n'th tab CreateWindowShortcut(this, "CTRL+1", [this] { this->notebook.selectIndex(0); }); From e2b54edb2d714f4d7893c4ff7f2708d616ac5849 Mon Sep 17 00:00:00 2001 From: Nikolai Zimmermann Date: Tue, 30 Jan 2018 13:31:18 +0100 Subject: [PATCH 3/6] Fix build error (#264) --- src/widgets/window.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/widgets/window.hpp b/src/widgets/window.hpp index 33827dbe3..0b04b71d8 100644 --- a/src/widgets/window.hpp +++ b/src/widgets/window.hpp @@ -3,7 +3,7 @@ #include "util/helpers.hpp" #include "widgets/basewindow.hpp" #include "widgets/notebook.hpp" -#include "widgets/titlebar.hpp" +//#include "widgets/titlebar.hpp" //#ifdef USEWINSDK //#include @@ -67,7 +67,7 @@ private: void loadGeometry(); Notebook notebook; - TitleBar titleBar; + //TitleBar titleBar; friend class Notebook; From 25979d453557245c5f5cb953d4ea9e717e99a009 Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Sat, 3 Feb 2018 16:17:59 +0100 Subject: [PATCH 4/6] Unscuffed settings log page --- src/widgets/settingspages/emotespage.cpp | 2 ++ src/widgets/settingspages/logspage.cpp | 26 ++++++++++++++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/widgets/settingspages/emotespage.cpp b/src/widgets/settingspages/emotespage.cpp index 026c00ee6..b5788815b 100644 --- a/src/widgets/settingspages/emotespage.cpp +++ b/src/widgets/settingspages/emotespage.cpp @@ -5,6 +5,7 @@ namespace chatterino { namespace widgets { namespace settingspages { + EmotesPage::EmotesPage() : SettingsPage("Emotes", ":/images/emote.svg") { @@ -22,6 +23,7 @@ EmotesPage::EmotesPage() layout->addStretch(1); } + } // namespace settingspages } // namespace widgets } // namespace chatterino diff --git a/src/widgets/settingspages/logspage.cpp b/src/widgets/settingspages/logspage.cpp index e99327e19..138df8e1e 100644 --- a/src/widgets/settingspages/logspage.cpp +++ b/src/widgets/settingspages/logspage.cpp @@ -1,4 +1,5 @@ #include "logspage.hpp" +#include "singletons/pathmanager.hpp" #include #include @@ -9,6 +10,16 @@ namespace chatterino { namespace widgets { namespace settingspages { +inline QString CreateLink(const QString &url, bool file = false) +{ + if (file) { + return QString("" + url + + ""); + } + + return QString("" + url + ""); +} + LogsPage::LogsPage() : SettingsPage("Logs", "") { @@ -16,13 +27,16 @@ LogsPage::LogsPage() util::LayoutCreator layoutCreator(this); auto layout = layoutCreator.emplace().withoutMargin(); - { - auto form = layout.emplace(); + singletons::PathManager &pathManager = singletons::PathManager::getInstance(); + auto logPath = pathManager.logsFolderPath; - // clang-format off - form->addRow("Enabled:", this->createCheckBox("Enable logging", settings.enableLogging)); - // clang-format on - } + auto created = layout.emplace(); + created->setText("Logs are saved to " + CreateLink(logPath, true)); + created->setTextFormat(Qt::RichText); + created->setTextInteractionFlags(Qt::TextBrowserInteraction | Qt::LinksAccessibleByKeyboard | + Qt::LinksAccessibleByKeyboard); + created->setOpenExternalLinks(true); + layout.append(this->createCheckBox("Enable logging", settings.enableLogging)); layout->addStretch(1); } From f9a25171bf87678803ad4440bba7563c35a3db94 Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Sat, 3 Feb 2018 17:14:56 +0100 Subject: [PATCH 5/6] Implement logging Fixes #6 --- src/singletons/helper/loggingchannel.cpp | 59 ++++++++++++++++++------ src/singletons/helper/loggingchannel.hpp | 13 ++++-- 2 files changed, 53 insertions(+), 19 deletions(-) diff --git a/src/singletons/helper/loggingchannel.cpp b/src/singletons/helper/loggingchannel.cpp index e5454716d..96c5125b8 100644 --- a/src/singletons/helper/loggingchannel.cpp +++ b/src/singletons/helper/loggingchannel.cpp @@ -7,18 +7,18 @@ namespace chatterino { namespace singletons { +QByteArray endline("\n"); + LoggingChannel::LoggingChannel(const QString &_channelName, const QString &_baseDirectory) : channelName(_channelName) , baseDirectory(_baseDirectory) { QDateTime now = QDateTime::currentDateTime(); - QString baseFileName = this->channelName + "-" + now.toString("yyyy-MM-dd") + ".log"; + this->dateString = this->generateDateString(now); - // Open file handle to log file of current date - this->fileHandle.setFileName(this->baseDirectory + QDir::separator() + baseFileName); + this->openLogFile(); - this->fileHandle.open(QIODevice::Append); this->appendLine(this->generateOpeningString(now)); } @@ -28,24 +28,38 @@ LoggingChannel::~LoggingChannel() this->fileHandle.close(); } +void LoggingChannel::openLogFile() +{ + if (this->fileHandle.isOpen()) { + this->fileHandle.flush(); + this->fileHandle.close(); + } + + QString baseFileName = this->channelName + "-" + this->dateString + ".log"; + + // Open file handle to log file of current date + this->fileHandle.setFileName(this->baseDirectory + QDir::separator() + baseFileName); + + this->fileHandle.open(QIODevice::Append); +} + void LoggingChannel::addMessage(std::shared_ptr message) { QDateTime now = QDateTime::currentDateTime(); + QString messageDateString = this->generateDateString(now); + if (messageDateString != this->dateString) { + this->dateString = messageDateString; + this->openLogFile(); + } + QString str; str.append('['); str.append(now.toString("HH:mm:ss")); str.append("] "); - if ((message->flags & messages::Message::MessageFlags::System) != 0) { - str.append(message->searchText); - str.append('\n'); - } else { - str.append(message->loginName); - str.append(": "); - str.append(message->searchText); - str.append('\n'); - } + str.append(message->searchText); + str.append(endline); this->appendLine(str); } @@ -56,7 +70,7 @@ QString LoggingChannel::generateOpeningString(const QDateTime &now) const ret.append(now.toString("yyyy-MM-dd HH:mm:ss ")); ret.append(now.timeZoneAbbreviation()); - ret.append('\n'); + ret.append(endline); return ret; } @@ -67,16 +81,31 @@ QString LoggingChannel::generateClosingString(const QDateTime &now) const ret.append(now.toString("yyyy-MM-dd HH:mm:ss")); ret.append(now.timeZoneAbbreviation()); - ret.append('\n'); + ret.append(endline); return ret; } void LoggingChannel::appendLine(const QString &line) { + auto a1 = line.toUtf8(); + auto a2 = line.toLatin1(); + auto a3 = line.toLocal8Bit(); + + auto a4 = line.data(); + + auto a5 = line.toStdString(); + + // this->fileHandle.write(a5.c_str(), a5.length()); + // this->fileHandle.write(a5.c_str(), a5.length()); this->fileHandle.write(line.toUtf8()); this->fileHandle.flush(); } +QString LoggingChannel::generateDateString(const QDateTime &now) +{ + return now.toString("yyyy-MM-dd"); +} + } // namespace singletons } // namespace chatterino diff --git a/src/singletons/helper/loggingchannel.hpp b/src/singletons/helper/loggingchannel.hpp index b60fb3540..499169119 100644 --- a/src/singletons/helper/loggingchannel.hpp +++ b/src/singletons/helper/loggingchannel.hpp @@ -21,17 +21,22 @@ public: void addMessage(std::shared_ptr message); private: + void openLogFile(); + QString generateOpeningString(const QDateTime &now = QDateTime::currentDateTime()) const; QString generateClosingString(const QDateTime &now = QDateTime::currentDateTime()) const; void appendLine(const QString &line); -private: - QString channelName; - const QString &baseDirectory; - QString fileName; + QString generateDateString(const QDateTime &now); + + const QString channelName; + const QString baseDirectory; + QFile fileHandle; + QString dateString; + friend class LoggingManager; }; From 556dbe0456a596ea253af61068157c10131bf341 Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Sun, 4 Feb 2018 16:33:46 +0100 Subject: [PATCH 6/6] Fix whisper receiving Added setting to display them inline under "Special Channels" page Store a twitch users color in the TwitchUser struct this is useful if we ever want to use the users own color. The users own color is only updated once he has written once in chat Add helper method for calling function only on normal channels Fixes #54 --- src/singletons/channelmanager.cpp | 7 ++ src/singletons/channelmanager.hpp | 1 + src/singletons/helper/ircmessagehandler.cpp | 26 ++++++- src/singletons/helper/ircmessagehandler.hpp | 7 +- src/twitch/twitchmessagebuilder.cpp | 72 +++++++++++++------ src/twitch/twitchmessagebuilder.hpp | 10 ++- src/twitch/twitchuser.hpp | 3 + .../settingspages/specialchannelspage.cpp | 7 ++ 8 files changed, 106 insertions(+), 27 deletions(-) diff --git a/src/singletons/channelmanager.cpp b/src/singletons/channelmanager.cpp index b18a56ff7..8f64f2127 100644 --- a/src/singletons/channelmanager.cpp +++ b/src/singletons/channelmanager.cpp @@ -138,5 +138,12 @@ void ChannelManager::doOnAll(std::function func) func(this->mentionsChannel); } +void ChannelManager::doOnAllNormalChannels(std::function func) +{ + for (const auto &channel : this->twitchChannels) { + func(std::get<0>(channel)); + } +} + } // namespace chatterino } diff --git a/src/singletons/channelmanager.hpp b/src/singletons/channelmanager.hpp index 89e3d257e..24170504a 100644 --- a/src/singletons/channelmanager.hpp +++ b/src/singletons/channelmanager.hpp @@ -26,6 +26,7 @@ public: const std::string &getUserID(const std::string &username); void doOnAll(std::function func); + void doOnAllNormalChannels(std::function func); // Special channels const ChannelPtr whispersChannel; diff --git a/src/singletons/helper/ircmessagehandler.cpp b/src/singletons/helper/ircmessagehandler.cpp index a74e9fda3..4dd477c13 100644 --- a/src/singletons/helper/ircmessagehandler.cpp +++ b/src/singletons/helper/ircmessagehandler.cpp @@ -9,6 +9,7 @@ #include "singletons/resourcemanager.hpp" #include "singletons/windowmanager.hpp" #include "twitch/twitchchannel.hpp" +#include "twitch/twitchmessagebuilder.hpp" using namespace chatterino::messages; @@ -139,7 +140,29 @@ void IrcMessageHandler::handleUserStateMessage(Communi::IrcMessage *message) void IrcMessageHandler::handleWhisperMessage(Communi::IrcMessage *message) { - // TODO: Implement + debug::Log("Received whisper!"); + messages::MessageParseArgs args; + + args.isReceivedWhisper = true; + + auto c = this->channelManager.whispersChannel.get(); + + twitch::TwitchMessageBuilder builder(c, message, message->parameter(1), args); + + if (!builder.isIgnored()) { + messages::MessagePtr _message = builder.build(); + if (_message->flags & messages::Message::Highlighted) { + singletons::ChannelManager::getInstance().mentionsChannel->addMessage(_message); + } + + c->addMessage(_message); + + if (SettingManager::getInstance().inlineWhispers) { + this->channelManager.doOnAllNormalChannels([_message](ChannelPtr channel) { + channel->addMessage(_message); // + }); + } + } } void IrcMessageHandler::handleUserNoticeMessage(Communi::IrcMessage *message) @@ -202,6 +225,7 @@ void IrcMessageHandler::handleWriteConnectionNoticeMessage(Communi::IrcNoticeMes this->handleNoticeMessage(message); } + } // namespace helper } // namespace singletons } // namespace chatterino diff --git a/src/singletons/helper/ircmessagehandler.hpp b/src/singletons/helper/ircmessagehandler.hpp index 81fec9b1e..bbd9ba48a 100644 --- a/src/singletons/helper/ircmessagehandler.hpp +++ b/src/singletons/helper/ircmessagehandler.hpp @@ -27,6 +27,7 @@ public: void handleNoticeMessage(Communi::IrcNoticeMessage *message); void handleWriteConnectionNoticeMessage(Communi::IrcNoticeMessage *message); }; -} -} -} + +} // namespace helper +} // namespace singletons +} // namespace chatterino diff --git a/src/twitch/twitchmessagebuilder.cpp b/src/twitch/twitchmessagebuilder.cpp index 2c67b2963..911831db0 100644 --- a/src/twitch/twitchmessagebuilder.cpp +++ b/src/twitch/twitchmessagebuilder.cpp @@ -1,5 +1,6 @@ #include "twitchmessagebuilder.hpp" #include "debug/log.hpp" +#include "singletons/accountmanager.hpp" #include "singletons/emotemanager.hpp" #include "singletons/ircmanager.hpp" #include "singletons/resourcemanager.hpp" @@ -26,8 +27,22 @@ TwitchMessageBuilder::TwitchMessageBuilder(Channel *_channel, , args(_args) , tags(this->ircMessage->tags()) , usernameColor(singletons::ThemeManager::getInstance().messages.textColors.system) + , originalMessage(_ircMessage->content()) + , action(_ircMessage->isAction()) +{ +} + +TwitchMessageBuilder::TwitchMessageBuilder(Channel *_channel, + const Communi::IrcMessage *_ircMessage, QString content, + const messages::MessageParseArgs &_args) + : channel(_channel) + , twitchChannel(dynamic_cast(_channel)) + , ircMessage(_ircMessage) + , args(_args) + , tags(this->ircMessage->tags()) + , usernameColor(singletons::ThemeManager::getInstance().messages.textColors.system) + , originalMessage(content) { - this->originalMessage = this->ircMessage->content(); } bool TwitchMessageBuilder::isIgnored() const @@ -124,8 +139,8 @@ MessagePtr TwitchMessageBuilder::build() long int i = 0; for (QString split : splits) { - MessageColor textColor = ircMessage->isAction() ? MessageColor(this->usernameColor) - : MessageColor(MessageColor::Text); + MessageColor textColor = + this->action ? MessageColor(this->usernameColor) : MessageColor(MessageColor::Text); // twitch emote if (currentTwitchEmote != twitchEmotes.end() && currentTwitchEmote->first == i) { @@ -243,7 +258,7 @@ void TwitchMessageBuilder::parseUsername() } // username - this->userName = ircMessage->nick(); + this->userName = this->ircMessage->nick(); if (this->userName.isEmpty()) { this->userName = this->tags.value(QLatin1String("login")).toString(); @@ -308,20 +323,36 @@ void TwitchMessageBuilder::appendUsername() if (this->args.isSentWhisper) { // TODO(pajlada): Re-implement // userDisplayString += IrcManager::getInstance().getUser().getUserName(); - } + } else if (this->args.isReceivedWhisper) { + // Sender username + this->emplace(usernameText, MessageElement::Text, this->usernameColor, + FontStyle::MediumBold) + ->setLink({Link::UserInfo, this->userName}); - if (this->args.isReceivedWhisper) { - // TODO(pajlada): Re-implement - // userDisplayString += " -> " + IrcManager::getInstance().getUser().getUserName(); - } + auto currentUser = singletons::AccountManager::getInstance().Twitch.getCurrent(); - if (!ircMessage->isAction()) { - usernameText += ":"; - } + // Separator + this->emplace( + "->", MessageElement::Text, + singletons::ThemeManager::getInstance().messages.textColors.system, FontStyle::Medium); - this->emplace(usernameText, MessageElement::Text, this->usernameColor, - FontStyle::MediumBold) - ->setLink({Link::UserInfo, this->userName}); + QColor selfColor = currentUser->color; + if (!selfColor.isValid()) { + selfColor = singletons::ThemeManager::getInstance().messages.textColors.system; + } + + // Your own username + this->emplace(currentUser->getUserName() + ":", MessageElement::Text, + selfColor, FontStyle::MediumBold); + } else { + if (!this->action) { + usernameText += ":"; + } + + this->emplace(usernameText, MessageElement::Text, this->usernameColor, + FontStyle::MediumBold) + ->setLink({Link::UserInfo, this->userName}); + } } void TwitchMessageBuilder::parseHighlights() @@ -329,11 +360,12 @@ void TwitchMessageBuilder::parseHighlights() static auto player = new QMediaPlayer; static QUrl currentPlayerUrl; singletons::SettingManager &settings = singletons::SettingManager::getInstance(); - static pajlada::Settings::Setting currentUser("/accounts/current"); + auto currentUser = singletons::AccountManager::getInstance().Twitch.getCurrent(); - QString currentUsername = QString::fromStdString(currentUser.getValue()); + QString currentUsername = currentUser->getUserName(); if (this->ircMessage->nick() == currentUsername) { + currentUser->color = this->usernameColor; // Do nothing. Highlights cannot be triggered by yourself return; } @@ -412,7 +444,7 @@ void TwitchMessageBuilder::parseHighlights() } } -void TwitchMessageBuilder::appendTwitchEmote(const Communi::IrcPrivateMessage *ircMessage, +void TwitchMessageBuilder::appendTwitchEmote(const Communi::IrcMessage *ircMessage, const QString &emote, std::vector> &vec) { @@ -441,11 +473,11 @@ void TwitchMessageBuilder::appendTwitchEmote(const Communi::IrcPrivateMessage *i long int start = std::stol(coords.at(0).toStdString(), nullptr, 10); long int end = std::stol(coords.at(1).toStdString(), nullptr, 10); - if (start >= end || start < 0 || end > ircMessage->content().length()) { + if (start >= end || start < 0 || end > this->originalMessage.length()) { return; } - QString name = ircMessage->content().mid(start, end - start + 1); + QString name = this->originalMessage.mid(start, end - start + 1); vec.push_back( std::pair(start, emoteManager.getTwitchEmoteById(id, name))); diff --git a/src/twitch/twitchmessagebuilder.hpp b/src/twitch/twitchmessagebuilder.hpp index 16035a714..9a1696fa4 100644 --- a/src/twitch/twitchmessagebuilder.hpp +++ b/src/twitch/twitchmessagebuilder.hpp @@ -28,10 +28,12 @@ public: explicit TwitchMessageBuilder(Channel *_channel, const Communi::IrcPrivateMessage *_ircMessage, const messages::MessageParseArgs &_args); + explicit TwitchMessageBuilder(Channel *_channel, const Communi::IrcMessage *_ircMessage, + QString content, const messages::MessageParseArgs &_args); Channel *channel; TwitchChannel *twitchChannel; - const Communi::IrcPrivateMessage *ircMessage; + const Communi::IrcMessage *ircMessage; messages::MessageParseArgs args; const QVariantMap tags; @@ -45,7 +47,9 @@ private: QString roomID; QColor usernameColor; - QString originalMessage; + const QString originalMessage; + + const bool action = false; void parseMessageID(); void parseRoomID(); @@ -54,7 +58,7 @@ private: void appendUsername(); void parseHighlights(); - void appendTwitchEmote(const Communi::IrcPrivateMessage *ircMessage, const QString &emote, + void appendTwitchEmote(const Communi::IrcMessage *ircMessage, const QString &emote, std::vector> &vec); bool tryAppendEmote(QString &emoteString); diff --git a/src/twitch/twitchuser.hpp b/src/twitch/twitchuser.hpp index c7562b200..c89f4f30e 100644 --- a/src/twitch/twitchuser.hpp +++ b/src/twitch/twitchuser.hpp @@ -2,6 +2,7 @@ #include "ircaccount.hpp" +#include #include namespace chatterino { @@ -27,6 +28,8 @@ public: bool isAnon() const; + QColor color; + private: QString _oauthClient; QString _oauthToken; diff --git a/src/widgets/settingspages/specialchannelspage.cpp b/src/widgets/settingspages/specialchannelspage.cpp index 6c3685c74..f6df33737 100644 --- a/src/widgets/settingspages/specialchannelspage.cpp +++ b/src/widgets/settingspages/specialchannelspage.cpp @@ -13,6 +13,7 @@ namespace settingspages { SpecialChannelsPage::SpecialChannelsPage() : SettingsPage("Special channels", "") { + singletons::SettingManager &settings = singletons::SettingManager::getInstance(); util::LayoutCreator layoutCreator(this); auto layout = layoutCreator.setLayoutType(); @@ -21,6 +22,12 @@ SpecialChannelsPage::SpecialChannelsPage() mentions.emplace("Join /mentions to view your mentions."); } + auto whispers = layout.emplace("Whispers").setLayoutType(); + { + whispers.emplace("Join /whispers to view your mentions."); + whispers.append(this->createCheckBox("Show whispers inline", settings.inlineWhispers)); + } + layout->addStretch(1); } } // namespace settingspages