mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Merge pull request #979 from hemirt/whispers
do not disable whispers on clears and timeouts
This commit is contained in:
commit
97faec15e0
|
@ -154,8 +154,9 @@ void Channel::addOrReplaceTimeout(MessagePtr message)
|
|||
for (int i = 0; i < snapshotLength; i++)
|
||||
{
|
||||
auto &s = snapshot[i];
|
||||
if (s->flags.hasNone({MessageFlag::Timeout, MessageFlag::Untimeout}) &&
|
||||
s->loginName == message->timeoutUser)
|
||||
if (s->loginName == message->timeoutUser &&
|
||||
s->flags.hasNone({MessageFlag::Timeout, MessageFlag::Untimeout,
|
||||
MessageFlag::Whisper}))
|
||||
{
|
||||
// FOURTF: disabled for now
|
||||
// PAJLADA: Shitty solution described in Message.hpp
|
||||
|
@ -179,7 +180,8 @@ void Channel::disableAllMessages()
|
|||
for (int i = 0; i < snapshotLength; i++)
|
||||
{
|
||||
auto &message = snapshot[i];
|
||||
if (message->flags.hasAny({MessageFlag::System, MessageFlag::Timeout}))
|
||||
if (message->flags.hasAny({MessageFlag::System, MessageFlag::Timeout,
|
||||
MessageFlag::Whisper}))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace chatterino {
|
|||
|
||||
struct Message;
|
||||
using MessagePtr = std::shared_ptr<const Message>;
|
||||
enum class MessageFlag : uint16_t;
|
||||
enum class MessageFlag : uint32_t;
|
||||
using MessageFlags = FlagsEnum<MessageFlag>;
|
||||
|
||||
class Channel : public std::enable_shared_from_this<Channel>
|
||||
|
|
|
@ -208,6 +208,7 @@ QString CommandController::execCommand(const QString &textNoEmoji,
|
|||
}
|
||||
|
||||
b->flags.set(MessageFlag::DoNotTriggerNotification);
|
||||
b->flags.set(MessageFlag::Whisper);
|
||||
auto messagexD = b.release();
|
||||
|
||||
app->twitch.server->whispersChannel->addMessage(messagexD);
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
namespace chatterino {
|
||||
class MessageElement;
|
||||
|
||||
enum class MessageFlag : uint16_t {
|
||||
enum class MessageFlag : uint32_t {
|
||||
None = 0,
|
||||
System = (1 << 0),
|
||||
Timeout = (1 << 1),
|
||||
|
@ -30,6 +30,7 @@ enum class MessageFlag : uint16_t {
|
|||
DoNotLog = (1 << 13),
|
||||
AutoMod = (1 << 14),
|
||||
RecentMessage = (1 << 15),
|
||||
Whisper = (1 << 16)
|
||||
};
|
||||
using MessageFlags = FlagsEnum<MessageFlag>;
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ class QPainter;
|
|||
|
||||
namespace chatterino {
|
||||
|
||||
enum class MessageFlag : uint16_t;
|
||||
enum class MessageFlag : uint32_t;
|
||||
using MessageFlags = FlagsEnum<MessageFlag>;
|
||||
|
||||
struct Margin {
|
||||
|
|
|
@ -321,6 +321,7 @@ void IrcMessageHandler::handleWhisperMessage(Communi::IrcMessage *message)
|
|||
|
||||
if (!builder.isIgnored())
|
||||
{
|
||||
builder->flags.set(MessageFlag::Whisper);
|
||||
MessagePtr _message = builder.build();
|
||||
|
||||
app->twitch.server->lastUserThatWhisperedMe.set(builder.userName);
|
||||
|
|
|
@ -25,7 +25,7 @@ using ChannelPtr = std::shared_ptr<Channel>;
|
|||
struct Message;
|
||||
using MessagePtr = std::shared_ptr<const Message>;
|
||||
|
||||
enum class MessageFlag : uint16_t;
|
||||
enum class MessageFlag : uint32_t;
|
||||
using MessageFlags = FlagsEnum<MessageFlag>;
|
||||
|
||||
class MessageLayout;
|
||||
|
|
Loading…
Reference in a new issue