make whispers not disabled on clear

This commit is contained in:
hemirt 2019-03-20 20:46:20 +01:00
parent 3f41dfeff9
commit 1a1d0f305c
7 changed files with 9 additions and 5 deletions

View file

@ -179,7 +179,8 @@ void Channel::disableAllMessages()
for (int i = 0; i < snapshotLength; i++) for (int i = 0; i < snapshotLength; i++)
{ {
auto &message = snapshot[i]; auto &message = snapshot[i];
if (message->flags.hasAny({MessageFlag::System, MessageFlag::Timeout})) if (message->flags.hasAny({MessageFlag::System, MessageFlag::Timeout,
MessageFlag::Whisper}))
{ {
continue; continue;
} }

View file

@ -15,7 +15,7 @@ namespace chatterino {
struct Message; struct Message;
using MessagePtr = std::shared_ptr<const Message>; using MessagePtr = std::shared_ptr<const Message>;
enum class MessageFlag : uint16_t; enum class MessageFlag : uint32_t;
using MessageFlags = FlagsEnum<MessageFlag>; using MessageFlags = FlagsEnum<MessageFlag>;
class Channel : public std::enable_shared_from_this<Channel> class Channel : public std::enable_shared_from_this<Channel>

View file

@ -200,6 +200,7 @@ QString CommandController::execCommand(const QString &textNoEmoji,
} }
b->flags.set(MessageFlag::DoNotTriggerNotification); b->flags.set(MessageFlag::DoNotTriggerNotification);
b->flags.set(MessageFlag::Whisper);
auto messagexD = b.release(); auto messagexD = b.release();
app->twitch.server->whispersChannel->addMessage(messagexD); app->twitch.server->whispersChannel->addMessage(messagexD);

View file

@ -12,7 +12,7 @@
namespace chatterino { namespace chatterino {
class MessageElement; class MessageElement;
enum class MessageFlag : uint16_t { enum class MessageFlag : uint32_t {
None = 0, None = 0,
System = (1 << 0), System = (1 << 0),
Timeout = (1 << 1), Timeout = (1 << 1),
@ -30,6 +30,7 @@ enum class MessageFlag : uint16_t {
DoNotLog = (1 << 13), DoNotLog = (1 << 13),
AutoMod = (1 << 14), AutoMod = (1 << 14),
RecentMessage = (1 << 15), RecentMessage = (1 << 15),
Whisper = (1 << 16)
}; };
using MessageFlags = FlagsEnum<MessageFlag>; using MessageFlags = FlagsEnum<MessageFlag>;

View file

@ -14,7 +14,7 @@ class QPainter;
namespace chatterino { namespace chatterino {
enum class MessageFlag : uint16_t; enum class MessageFlag : uint32_t;
using MessageFlags = FlagsEnum<MessageFlag>; using MessageFlags = FlagsEnum<MessageFlag>;
struct Margin { struct Margin {

View file

@ -248,6 +248,7 @@ void IrcMessageHandler::handleWhisperMessage(Communi::IrcMessage *message)
if (!builder.isIgnored()) if (!builder.isIgnored())
{ {
builder->flags.set(MessageFlag::Whisper);
MessagePtr _message = builder.build(); MessagePtr _message = builder.build();
app->twitch.server->lastUserThatWhisperedMe.set(builder.userName); app->twitch.server->lastUserThatWhisperedMe.set(builder.userName);

View file

@ -25,7 +25,7 @@ using ChannelPtr = std::shared_ptr<Channel>;
struct Message; struct Message;
using MessagePtr = std::shared_ptr<const Message>; using MessagePtr = std::shared_ptr<const Message>;
enum class MessageFlag : uint16_t; enum class MessageFlag : uint32_t;
using MessageFlags = FlagsEnum<MessageFlag>; using MessageFlags = FlagsEnum<MessageFlag>;
class MessageLayout; class MessageLayout;