mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
added setting to show unhandled irc commands
This commit is contained in:
parent
765a75f158
commit
07133166d9
5 changed files with 33 additions and 16 deletions
|
@ -32,6 +32,7 @@ enum class MessageFlag : uint32_t {
|
||||||
RecentMessage = (1 << 15),
|
RecentMessage = (1 << 15),
|
||||||
Whisper = (1 << 16),
|
Whisper = (1 << 16),
|
||||||
HighlightedWhisper = (1 << 17),
|
HighlightedWhisper = (1 << 17),
|
||||||
|
Debug = (1 << 18),
|
||||||
};
|
};
|
||||||
using MessageFlags = FlagsEnum<MessageFlag>;
|
using MessageFlags = FlagsEnum<MessageFlag>;
|
||||||
|
|
||||||
|
|
|
@ -269,6 +269,10 @@ void MessageLayout::updateBuffer(QPixmap *buffer, int /*messageIndex*/,
|
||||||
{
|
{
|
||||||
backgroundColor = QColor("#404040");
|
backgroundColor = QColor("#404040");
|
||||||
}
|
}
|
||||||
|
else if (this->message_->flags.has(MessageFlag::Debug))
|
||||||
|
{
|
||||||
|
backgroundColor = QColor("#4A273D");
|
||||||
|
}
|
||||||
|
|
||||||
painter.fillRect(buffer->rect(), backgroundColor);
|
painter.fillRect(buffer->rect(), backgroundColor);
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,11 @@
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|
||||||
|
#include "messages/Message.hpp"
|
||||||
#include "messages/MessageBuilder.hpp"
|
#include "messages/MessageBuilder.hpp"
|
||||||
#include "providers/irc/Irc2.hpp"
|
#include "providers/irc/Irc2.hpp"
|
||||||
#include "providers/irc/IrcChannel2.hpp"
|
#include "providers/irc/IrcChannel2.hpp"
|
||||||
|
#include "singletons/Settings.hpp"
|
||||||
#include "util/QObjectRef.hpp"
|
#include "util/QObjectRef.hpp"
|
||||||
|
|
||||||
namespace chatterino {
|
namespace chatterino {
|
||||||
|
@ -233,14 +235,15 @@ void IrcServer::readConnectionMessageReceived(Communi::IrcMessage *message)
|
||||||
case Communi::IrcMessage::Notice:
|
case Communi::IrcMessage::Notice:
|
||||||
return;
|
return;
|
||||||
|
|
||||||
default:;
|
default:
|
||||||
}
|
if (getSettings()->showUnhandledIrcMessages)
|
||||||
|
{
|
||||||
#ifdef QT_DEBUG
|
|
||||||
MessageBuilder builder;
|
MessageBuilder builder;
|
||||||
|
|
||||||
builder.emplace<TimestampElement>();
|
builder.emplace<TimestampElement>();
|
||||||
builder.emplace<TextElement>(message->toData(), MessageElementFlag::Text);
|
builder.emplace<TextElement>(message->toData(),
|
||||||
|
MessageElementFlag::Text);
|
||||||
|
builder->flags.set(MessageFlag::Debug);
|
||||||
|
|
||||||
auto msg = builder.release();
|
auto msg = builder.release();
|
||||||
|
|
||||||
|
@ -249,7 +252,8 @@ void IrcServer::readConnectionMessageReceived(Communi::IrcMessage *message)
|
||||||
if (auto shared = weak.lock())
|
if (auto shared = weak.lock())
|
||||||
shared->addMessage(msg);
|
shared->addMessage(msg);
|
||||||
}
|
}
|
||||||
#endif
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace chatterino
|
} // namespace chatterino
|
||||||
|
|
|
@ -211,7 +211,12 @@ public:
|
||||||
|
|
||||||
QStringSetting cachePath = {"/cache/path", ""};
|
QStringSetting cachePath = {"/cache/path", ""};
|
||||||
|
|
||||||
|
/// Debug
|
||||||
|
BoolSetting showUnhandledIrcMessages = {"/debug/showUnhandledIrcMessages",
|
||||||
|
false};
|
||||||
|
|
||||||
/// UI
|
/// UI
|
||||||
|
// Purely QOL settings are here (like last item in a list).
|
||||||
IntSetting lastSelectChannelTab = {"/ui/lastSelectChannelTab", 0};
|
IntSetting lastSelectChannelTab = {"/ui/lastSelectChannelTab", 0};
|
||||||
IntSetting lastSelectIrcConn = {"/ui/lastSelectIrcConn", 0};
|
IntSetting lastSelectIrcConn = {"/ui/lastSelectIrcConn", 0};
|
||||||
|
|
||||||
|
|
|
@ -422,6 +422,9 @@ void GeneralPage::initLayout(SettingsLayout &layout)
|
||||||
layout.addCheckbox("Load message history on connect",
|
layout.addCheckbox("Load message history on connect",
|
||||||
s.loadTwitchMessageHistoryOnConnect);
|
s.loadTwitchMessageHistoryOnConnect);
|
||||||
|
|
||||||
|
layout.addCheckbox("Show unhandled irc messages",
|
||||||
|
s.showUnhandledIrcMessages);
|
||||||
|
|
||||||
layout.addTitle("Cache");
|
layout.addTitle("Cache");
|
||||||
layout.addDescription(
|
layout.addDescription(
|
||||||
"Files that are used often (such as emotes) are saved to disk to "
|
"Files that are used often (such as emotes) are saved to disk to "
|
||||||
|
|
Loading…
Reference in a new issue