removed functions from SettingsManager that shouldn't be there
This commit is contained in:
@@ -20,4 +20,9 @@ void EmoteManager::initialize()
|
||||
this->gifTimer.initialize();
|
||||
}
|
||||
|
||||
bool EmoteManager::isIgnoredEmote(const QString &)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -17,6 +17,8 @@ public:
|
||||
|
||||
void initialize();
|
||||
|
||||
bool isIgnoredEmote(const QString &emote);
|
||||
|
||||
TwitchEmotes twitch;
|
||||
BTTVEmotes bttv;
|
||||
FFZEmotes ffz;
|
||||
|
||||
@@ -77,6 +77,6 @@ private:
|
||||
std::vector<std::unordered_map<float, FontData>> fontsByType;
|
||||
};
|
||||
|
||||
using FontStyle = chatterino::FontManager::Type;
|
||||
using FontStyle = FontManager::Type;
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
//#include <future>
|
||||
|
||||
// using namespace chatterino::messages;
|
||||
// using namespace messages;
|
||||
|
||||
// void IrcManager::refreshIgnoredUsers(const QString &username, const QString &oauthClient,
|
||||
// const QString &oauthToken)
|
||||
|
||||
@@ -17,7 +17,7 @@ void LoggingManager::initialize()
|
||||
this->pathManager = getApp()->paths;
|
||||
}
|
||||
|
||||
void LoggingManager::addMessage(const QString &channelName, chatterino::MessagePtr message)
|
||||
void LoggingManager::addMessage(const QString &channelName, MessagePtr message)
|
||||
{
|
||||
auto app = getApp();
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ public:
|
||||
|
||||
void initialize();
|
||||
|
||||
void addMessage(const QString &channelName, chatterino::MessagePtr message);
|
||||
void addMessage(const QString &channelName, MessagePtr message);
|
||||
|
||||
private:
|
||||
std::map<QString, std::unique_ptr<LoggingChannel>> loggingChannels;
|
||||
|
||||
@@ -124,9 +124,9 @@ void NativeMessagingManager::openGuiMessageQueue()
|
||||
|
||||
void NativeMessagingManager::sendToGuiProcess(const QByteArray &array)
|
||||
{
|
||||
ipc::message_queue messageQueue(ipc::open_only, "chatterino_gui");
|
||||
|
||||
try {
|
||||
ipc::message_queue messageQueue(ipc::open_only, "chatterino_gui");
|
||||
|
||||
messageQueue.try_send(array.data(), array.size(), 1);
|
||||
} catch (ipc::interprocess_exception &ex) {
|
||||
qDebug() << "send to gui process:" << ex.what();
|
||||
|
||||
@@ -8,9 +8,9 @@ namespace chatterino {
|
||||
|
||||
namespace {
|
||||
|
||||
inline chatterino::Image *lli(const char *pixmapPath, qreal scale = 1)
|
||||
inline Image *lli(const char *pixmapPath, qreal scale = 1)
|
||||
{
|
||||
return new chatterino::Image(new QPixmap(pixmapPath), scale);
|
||||
return new Image(new QPixmap(pixmapPath), scale);
|
||||
}
|
||||
|
||||
template <typename Type>
|
||||
@@ -221,7 +221,7 @@ inline bool ParseSingleCheermoteSet(ResourceManager::JSONCheermoteSet &set,
|
||||
|
||||
qreal chatterinoScale = 1 / scaleNumber;
|
||||
|
||||
auto image = new chatterino::Image(url, chatterinoScale);
|
||||
auto image = new Image(url, chatterinoScale);
|
||||
|
||||
// TODO(pajlada): Fill in name and tooltip
|
||||
tier.images[background][state][scale] = image;
|
||||
@@ -310,9 +310,9 @@ void ResourceManager::initialize()
|
||||
}
|
||||
|
||||
ResourceManager::BadgeVersion::BadgeVersion(QJsonObject &&root)
|
||||
: badgeImage1x(new chatterino::Image(root.value("image_url_1x").toString()))
|
||||
, badgeImage2x(new chatterino::Image(root.value("image_url_2x").toString()))
|
||||
, badgeImage4x(new chatterino::Image(root.value("image_url_4x").toString()))
|
||||
: badgeImage1x(new Image(root.value("image_url_1x").toString()))
|
||||
, badgeImage2x(new Image(root.value("image_url_2x").toString()))
|
||||
, badgeImage4x(new Image(root.value("image_url_4x").toString()))
|
||||
, description(root.value("description").toString().toStdString())
|
||||
, title(root.value("title").toString().toStdString())
|
||||
, clickAction(root.value("clickAction").toString().toStdString())
|
||||
@@ -438,7 +438,7 @@ void ResourceManager::loadChatterinoBadges()
|
||||
const QString &badgeVariantImageURL = badgeVariant.value("image").toString();
|
||||
|
||||
auto badgeVariantPtr = std::make_shared<ChatterinoBadge>(
|
||||
badgeVariantTooltip, new chatterino::Image(badgeVariantImageURL));
|
||||
badgeVariantTooltip, new Image(badgeVariantImageURL));
|
||||
|
||||
QJsonArray badgeVariantUsers = badgeVariant.value("users").toArray();
|
||||
|
||||
|
||||
@@ -35,39 +35,39 @@ public:
|
||||
QPixmap unmod;
|
||||
} buttons;
|
||||
|
||||
chatterino::Image *badgeStaff;
|
||||
chatterino::Image *badgeAdmin;
|
||||
chatterino::Image *badgeGlobalModerator;
|
||||
chatterino::Image *badgeModerator;
|
||||
chatterino::Image *badgeTurbo;
|
||||
chatterino::Image *badgeBroadcaster;
|
||||
chatterino::Image *badgePremium;
|
||||
chatterino::Image *badgeVerified;
|
||||
chatterino::Image *badgeSubscriber;
|
||||
chatterino::Image *badgeCollapsed;
|
||||
Image *badgeStaff;
|
||||
Image *badgeAdmin;
|
||||
Image *badgeGlobalModerator;
|
||||
Image *badgeModerator;
|
||||
Image *badgeTurbo;
|
||||
Image *badgeBroadcaster;
|
||||
Image *badgePremium;
|
||||
Image *badgeVerified;
|
||||
Image *badgeSubscriber;
|
||||
Image *badgeCollapsed;
|
||||
|
||||
chatterino::Image *cheerBadge100000;
|
||||
chatterino::Image *cheerBadge10000;
|
||||
chatterino::Image *cheerBadge5000;
|
||||
chatterino::Image *cheerBadge1000;
|
||||
chatterino::Image *cheerBadge100;
|
||||
chatterino::Image *cheerBadge1;
|
||||
Image *cheerBadge100000;
|
||||
Image *cheerBadge10000;
|
||||
Image *cheerBadge5000;
|
||||
Image *cheerBadge1000;
|
||||
Image *cheerBadge100;
|
||||
Image *cheerBadge1;
|
||||
|
||||
chatterino::Image *moderationmode_enabled;
|
||||
chatterino::Image *moderationmode_disabled;
|
||||
Image *moderationmode_enabled;
|
||||
Image *moderationmode_disabled;
|
||||
|
||||
chatterino::Image *splitHeaderContext;
|
||||
Image *splitHeaderContext;
|
||||
|
||||
std::map<std::string, chatterino::Image *> cheerBadges;
|
||||
std::map<std::string, Image *> cheerBadges;
|
||||
|
||||
struct BadgeVersion {
|
||||
BadgeVersion() = delete;
|
||||
|
||||
explicit BadgeVersion(QJsonObject &&root);
|
||||
|
||||
chatterino::Image *badgeImage1x;
|
||||
chatterino::Image *badgeImage2x;
|
||||
chatterino::Image *badgeImage4x;
|
||||
Image *badgeImage1x;
|
||||
Image *badgeImage2x;
|
||||
Image *badgeImage4x;
|
||||
std::string description;
|
||||
std::string title;
|
||||
std::string clickAction;
|
||||
@@ -82,8 +82,8 @@ public:
|
||||
|
||||
bool dynamicBadgesLoaded = false;
|
||||
|
||||
chatterino::Image *buttonBan;
|
||||
chatterino::Image *buttonTimeout;
|
||||
Image *buttonBan;
|
||||
Image *buttonTimeout;
|
||||
|
||||
struct JSONCheermoteSet {
|
||||
QString prefix;
|
||||
@@ -102,7 +102,7 @@ public:
|
||||
QString color;
|
||||
|
||||
// Background State Scale
|
||||
std::map<QString, std::map<QString, std::map<QString, chatterino::Image *>>> images;
|
||||
std::map<QString, std::map<QString, std::map<QString, Image *>>> images;
|
||||
};
|
||||
|
||||
std::vector<CheermoteTier> tiers;
|
||||
@@ -135,14 +135,14 @@ public:
|
||||
|
||||
// Chatterino badges
|
||||
struct ChatterinoBadge {
|
||||
ChatterinoBadge(const std::string &_tooltip, chatterino::Image *_image)
|
||||
ChatterinoBadge(const std::string &_tooltip, Image *_image)
|
||||
: tooltip(_tooltip)
|
||||
, image(_image)
|
||||
{
|
||||
}
|
||||
|
||||
std::string tooltip;
|
||||
chatterino::Image *image;
|
||||
Image *image;
|
||||
};
|
||||
|
||||
// username
|
||||
|
||||
@@ -18,22 +18,17 @@ void _actuallyRegisterSetting(std::weak_ptr<pajlada::Settings::ISettingData> set
|
||||
SettingManager::SettingManager()
|
||||
{
|
||||
qDebug() << "init SettingManager";
|
||||
}
|
||||
|
||||
this->wordFlagsListener.addSetting(this->showTimestamps);
|
||||
this->wordFlagsListener.addSetting(this->showBadges);
|
||||
this->wordFlagsListener.addSetting(this->enableBttvEmotes);
|
||||
this->wordFlagsListener.addSetting(this->enableEmojis);
|
||||
this->wordFlagsListener.addSetting(this->enableFfzEmotes);
|
||||
this->wordFlagsListener.addSetting(this->enableTwitchEmotes);
|
||||
this->wordFlagsListener.cb = [this](auto) {
|
||||
this->updateWordTypeMask(); //
|
||||
};
|
||||
SettingManager &SettingManager::getInstance()
|
||||
{
|
||||
static SettingManager instance;
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
void SettingManager::initialize()
|
||||
{
|
||||
this->moderationActions.connect([this](auto, auto) { this->updateModerationActions(); });
|
||||
|
||||
this->timestampFormat.connect([](auto, auto) {
|
||||
auto app = getApp();
|
||||
app->windows->layoutChannelViews();
|
||||
@@ -50,16 +45,6 @@ void SettingManager::initialize()
|
||||
[](auto, auto) { getApp()->windows->forceLayoutChannelViews(); });
|
||||
}
|
||||
|
||||
MessageElement::Flags SettingManager::getWordFlags()
|
||||
{
|
||||
return this->wordFlags;
|
||||
}
|
||||
|
||||
bool SettingManager::isIgnoredEmote(const QString &)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void SettingManager::load()
|
||||
{
|
||||
auto app = getApp();
|
||||
@@ -68,42 +53,6 @@ void SettingManager::load()
|
||||
pajlada::Settings::SettingManager::load(qPrintable(settingsPath));
|
||||
}
|
||||
|
||||
void SettingManager::updateWordTypeMask()
|
||||
{
|
||||
uint32_t newMaskUint = MessageElement::Text;
|
||||
|
||||
if (this->showTimestamps) {
|
||||
newMaskUint |= MessageElement::Timestamp;
|
||||
}
|
||||
|
||||
newMaskUint |=
|
||||
enableTwitchEmotes ? MessageElement::TwitchEmoteImage : MessageElement::TwitchEmoteText;
|
||||
newMaskUint |= enableFfzEmotes ? MessageElement::FfzEmoteImage : MessageElement::FfzEmoteText;
|
||||
newMaskUint |=
|
||||
enableBttvEmotes ? MessageElement::BttvEmoteImage : MessageElement::BttvEmoteText;
|
||||
newMaskUint |= enableEmojis ? MessageElement::EmojiImage : MessageElement::EmojiText;
|
||||
|
||||
newMaskUint |= MessageElement::BitsAmount;
|
||||
newMaskUint |= enableGifAnimations ? MessageElement::BitsAnimated : MessageElement::BitsStatic;
|
||||
|
||||
if (this->showBadges) {
|
||||
newMaskUint |= MessageElement::Badges;
|
||||
}
|
||||
|
||||
newMaskUint |= MessageElement::Username;
|
||||
|
||||
newMaskUint |= MessageElement::AlwaysShow;
|
||||
newMaskUint |= MessageElement::Collapsed;
|
||||
|
||||
MessageElement::Flags newMask = static_cast<MessageElement::Flags>(newMaskUint);
|
||||
|
||||
if (newMask != this->wordFlags) {
|
||||
this->wordFlags = newMask;
|
||||
|
||||
this->wordFlagsChanged.invoke();
|
||||
}
|
||||
}
|
||||
|
||||
void SettingManager::saveSnapshot()
|
||||
{
|
||||
rapidjson::Document *d = new rapidjson::Document(rapidjson::kObjectType);
|
||||
@@ -125,7 +74,7 @@ void SettingManager::saveSnapshot()
|
||||
Log("hehe: {}", pajlada::Settings::SettingManager::stringify(*d));
|
||||
}
|
||||
|
||||
void SettingManager::recallSnapshot()
|
||||
void SettingManager::restoreSnapshot()
|
||||
{
|
||||
if (!this->snapshot) {
|
||||
return;
|
||||
@@ -151,77 +100,9 @@ void SettingManager::recallSnapshot()
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<ModerationAction> SettingManager::getModerationActions() const
|
||||
SettingManager *getSettings()
|
||||
{
|
||||
return this->_moderationActions;
|
||||
}
|
||||
|
||||
void SettingManager::updateModerationActions()
|
||||
{
|
||||
auto app = getApp();
|
||||
|
||||
this->_moderationActions.clear();
|
||||
|
||||
static QRegularExpression newLineRegex("(\r\n?|\n)+");
|
||||
static QRegularExpression replaceRegex("[!/.]");
|
||||
static QRegularExpression timeoutRegex("^[./]timeout.* (\\d+)");
|
||||
QStringList list = this->moderationActions.getValue().split(newLineRegex);
|
||||
|
||||
int multipleTimeouts = 0;
|
||||
|
||||
for (QString &str : list) {
|
||||
if (timeoutRegex.match(str).hasMatch()) {
|
||||
multipleTimeouts++;
|
||||
if (multipleTimeouts > 1) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
QString &str = list[i];
|
||||
|
||||
if (str.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
auto timeoutMatch = timeoutRegex.match(str);
|
||||
|
||||
if (timeoutMatch.hasMatch()) {
|
||||
if (multipleTimeouts > 1) {
|
||||
QString line1;
|
||||
QString line2;
|
||||
|
||||
int amount = timeoutMatch.captured(1).toInt();
|
||||
|
||||
if (amount < 60) {
|
||||
line1 = QString::number(amount);
|
||||
line2 = "s";
|
||||
} else if (amount < 60 * 60) {
|
||||
line1 = QString::number(amount / 60);
|
||||
line2 = "m";
|
||||
} else if (amount < 60 * 60 * 24) {
|
||||
line1 = QString::number(amount / 60 / 60);
|
||||
line2 = "h";
|
||||
} else {
|
||||
line1 = QString::number(amount / 60 / 60 / 24);
|
||||
line2 = "d";
|
||||
}
|
||||
|
||||
this->_moderationActions.emplace_back(line1, line2, str);
|
||||
} else {
|
||||
this->_moderationActions.emplace_back(app->resources->buttonTimeout, str);
|
||||
}
|
||||
} else if (str.startsWith("/ban ")) {
|
||||
this->_moderationActions.emplace_back(app->resources->buttonBan, str);
|
||||
} else {
|
||||
QString xD = str;
|
||||
|
||||
xD.replace(replaceRegex, "");
|
||||
|
||||
this->_moderationActions.emplace_back(xD.mid(0, 2), xD.mid(2, 2), str);
|
||||
}
|
||||
}
|
||||
return &SettingManager::getInstance();
|
||||
}
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "controllers/highlights/HighlightPhrase.hpp"
|
||||
#include "controllers/moderationactions/ModerationAction.hpp"
|
||||
#include "messages/MessageElement.hpp"
|
||||
#include "singletons/helper/ChatterinoSetting.hpp"
|
||||
#include "singletons/helper/ModerationAction.hpp"
|
||||
|
||||
#include <pajlada/settings/setting.hpp>
|
||||
#include <pajlada/settings/settinglistener.hpp>
|
||||
@@ -14,19 +14,10 @@ void _actuallyRegisterSetting(std::weak_ptr<pajlada::Settings::ISettingData> set
|
||||
|
||||
class SettingManager
|
||||
{
|
||||
using BoolSetting = ChatterinoSetting<bool>;
|
||||
using FloatSetting = ChatterinoSetting<float>;
|
||||
using IntSetting = ChatterinoSetting<int>;
|
||||
using StringSetting = ChatterinoSetting<std::string>;
|
||||
using QStringSetting = ChatterinoSetting<QString>;
|
||||
|
||||
public:
|
||||
SettingManager();
|
||||
|
||||
~SettingManager() = delete;
|
||||
|
||||
chatterino::MessageElement::Flags getWordFlags();
|
||||
bool isIgnoredEmote(const QString &emote);
|
||||
public:
|
||||
static SettingManager &getInstance();
|
||||
|
||||
void initialize();
|
||||
void load();
|
||||
@@ -94,7 +85,6 @@ public:
|
||||
BoolSetting enableTwitchIgnoredUsers = {"/ignore/enableTwitchIgnoredUsers", true};
|
||||
|
||||
/// Moderation
|
||||
QStringSetting moderationActions = {"/moderation/actions", "/ban {user}\n/timeout {user} 300"};
|
||||
QStringSetting timeoutAction = {"/moderation/timeoutAction", "Disable"};
|
||||
|
||||
/// Highlighting
|
||||
@@ -128,23 +118,15 @@ public:
|
||||
IntSetting startUpNotification = {"/misc/startUpNotification", 0};
|
||||
QStringSetting currentVersion = {"/misc/currentVersion", ""};
|
||||
|
||||
void updateWordTypeMask();
|
||||
|
||||
void saveSnapshot();
|
||||
void recallSnapshot();
|
||||
|
||||
std::vector<ModerationAction> getModerationActions() const;
|
||||
pajlada::Signals::NoArgSignal wordFlagsChanged;
|
||||
void restoreSnapshot();
|
||||
|
||||
private:
|
||||
std::vector<ModerationAction> _moderationActions;
|
||||
std::unique_ptr<rapidjson::Document> snapshot;
|
||||
|
||||
void updateModerationActions();
|
||||
|
||||
chatterino::MessageElement::Flags wordFlags = chatterino::MessageElement::Default;
|
||||
|
||||
pajlada::Settings::SettingListener wordFlagsListener;
|
||||
};
|
||||
|
||||
SettingManager *getSettings();
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -59,6 +59,66 @@ void WindowManager::showAccountSelectPopup(QPoint point)
|
||||
WindowManager::WindowManager()
|
||||
{
|
||||
qDebug() << "init WindowManager";
|
||||
|
||||
auto settings = getSettings();
|
||||
|
||||
this->wordFlagsListener.addSetting(settings->showTimestamps);
|
||||
this->wordFlagsListener.addSetting(settings->showBadges);
|
||||
this->wordFlagsListener.addSetting(settings->enableBttvEmotes);
|
||||
this->wordFlagsListener.addSetting(settings->enableEmojis);
|
||||
this->wordFlagsListener.addSetting(settings->enableFfzEmotes);
|
||||
this->wordFlagsListener.addSetting(settings->enableTwitchEmotes);
|
||||
this->wordFlagsListener.cb = [this](auto) {
|
||||
this->updateWordTypeMask(); //
|
||||
};
|
||||
}
|
||||
|
||||
MessageElement::Flags WindowManager::getWordFlags()
|
||||
{
|
||||
return this->wordFlags;
|
||||
}
|
||||
|
||||
void WindowManager::updateWordTypeMask()
|
||||
{
|
||||
using MEF = MessageElement::Flags;
|
||||
auto settings = getSettings();
|
||||
|
||||
// text
|
||||
auto flags = MEF::Text | MEF::Text;
|
||||
|
||||
// timestamp
|
||||
if (settings->showTimestamps) {
|
||||
flags |= MEF::Timestamp;
|
||||
}
|
||||
|
||||
// emotes
|
||||
flags |= settings->enableTwitchEmotes ? MEF::TwitchEmoteImage : MEF::TwitchEmoteText;
|
||||
flags |= settings->enableFfzEmotes ? MEF::FfzEmoteImage : MEF::FfzEmoteText;
|
||||
flags |= settings->enableBttvEmotes ? MEF::BttvEmoteImage : MEF::BttvEmoteText;
|
||||
flags |= settings->enableEmojis ? MEF::EmojiImage : MEF::EmojiText;
|
||||
|
||||
// bits
|
||||
flags |= MEF::BitsAmount;
|
||||
flags |= settings->enableGifAnimations ? MEF::BitsAnimated : MEF::BitsStatic;
|
||||
|
||||
// badges
|
||||
flags |= settings->showBadges ? MEF::Badges : MEF::None;
|
||||
|
||||
// username
|
||||
flags |= MEF::Username;
|
||||
|
||||
// misc
|
||||
flags |= MEF::AlwaysShow;
|
||||
flags |= MEF::Collapsed;
|
||||
|
||||
// update flags
|
||||
MessageElement::Flags newFlags = static_cast<MessageElement::Flags>(flags);
|
||||
|
||||
if (newFlags != this->wordFlags) {
|
||||
this->wordFlags = newFlags;
|
||||
|
||||
this->wordFlagsChanged.invoke();
|
||||
}
|
||||
}
|
||||
|
||||
void WindowManager::layoutChannelViews(Channel *channel)
|
||||
|
||||
@@ -44,6 +44,11 @@ public:
|
||||
static float getUiScaleValue();
|
||||
static float getUiScaleValue(int scale);
|
||||
|
||||
MessageElement::Flags getWordFlags();
|
||||
void updateWordTypeMask();
|
||||
|
||||
pajlada::Signals::NoArgSignal wordFlagsChanged;
|
||||
|
||||
private:
|
||||
bool initialized = false;
|
||||
|
||||
@@ -56,6 +61,9 @@ private:
|
||||
|
||||
void encodeNodeRecusively(SplitContainer::Node *node, QJsonObject &obj);
|
||||
|
||||
MessageElement::Flags wordFlags = MessageElement::Default;
|
||||
pajlada::Settings::SettingListener wordFlagsListener;
|
||||
|
||||
public:
|
||||
static void encodeChannel(IndirectChannel channel, QJsonObject &obj);
|
||||
static IndirectChannel decodeChannel(const QJsonObject &obj);
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <QString>
|
||||
#include <pajlada/settings.hpp>
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
void _registerSetting(std::weak_ptr<pajlada::Settings::ISettingData> setting);
|
||||
@@ -41,4 +44,10 @@ public:
|
||||
using pajlada::Settings::Setting<Type>::operator const Type;
|
||||
};
|
||||
|
||||
using BoolSetting = ChatterinoSetting<bool>;
|
||||
using FloatSetting = ChatterinoSetting<float>;
|
||||
using IntSetting = ChatterinoSetting<int>;
|
||||
using StringSetting = ChatterinoSetting<std::string>;
|
||||
using QStringSetting = ChatterinoSetting<QString>;
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -77,7 +77,7 @@ void LoggingChannel::openLogFile()
|
||||
this->appendLine(this->generateOpeningString(now));
|
||||
}
|
||||
|
||||
void LoggingChannel::addMessage(std::shared_ptr<chatterino::Message> message)
|
||||
void LoggingChannel::addMessage(std::shared_ptr<Message> message)
|
||||
{
|
||||
QDateTime now = QDateTime::currentDateTime();
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ class LoggingChannel : boost::noncopyable
|
||||
|
||||
public:
|
||||
~LoggingChannel();
|
||||
void addMessage(std::shared_ptr<chatterino::Message> message);
|
||||
void addMessage(std::shared_ptr<Message> message);
|
||||
|
||||
private:
|
||||
void openLogFile();
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
#include "ModerationAction.hpp"
|
||||
|
||||
#include "singletons/ResourceManager.hpp"
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
ModerationAction::ModerationAction(chatterino::Image *_image, const QString &_action)
|
||||
: _isImage(true)
|
||||
, image(_image)
|
||||
, action(_action)
|
||||
{
|
||||
}
|
||||
|
||||
ModerationAction::ModerationAction(const QString &_line1, const QString &_line2,
|
||||
const QString &_action)
|
||||
: _isImage(false)
|
||||
, image(nullptr)
|
||||
, line1(_line1)
|
||||
, line2(_line2)
|
||||
, action(_action)
|
||||
{
|
||||
}
|
||||
|
||||
bool ModerationAction::isImage() const
|
||||
{
|
||||
return this->_isImage;
|
||||
}
|
||||
|
||||
chatterino::Image *ModerationAction::getImage() const
|
||||
{
|
||||
return this->image;
|
||||
}
|
||||
|
||||
const QString &ModerationAction::getLine1() const
|
||||
{
|
||||
return this->line1;
|
||||
}
|
||||
|
||||
const QString &ModerationAction::getLine2() const
|
||||
{
|
||||
return this->line2;
|
||||
}
|
||||
|
||||
const QString &ModerationAction::getAction() const
|
||||
{
|
||||
return this->action;
|
||||
}
|
||||
|
||||
} // namespace chatterino
|
||||
@@ -1,29 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <QString>
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
class Image;
|
||||
|
||||
class ModerationAction
|
||||
{
|
||||
public:
|
||||
ModerationAction(chatterino::Image *image, const QString &action);
|
||||
ModerationAction(const QString &line1, const QString &line2, const QString &action);
|
||||
|
||||
bool isImage() const;
|
||||
chatterino::Image *getImage() const;
|
||||
const QString &getLine1() const;
|
||||
const QString &getLine2() const;
|
||||
const QString &getAction() const;
|
||||
|
||||
private:
|
||||
bool _isImage;
|
||||
chatterino::Image *image;
|
||||
QString line1;
|
||||
QString line2;
|
||||
QString action;
|
||||
};
|
||||
|
||||
} // namespace chatterino
|
||||
Reference in New Issue
Block a user