mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Merge pull request #965 from moe-ka/master
Fix for inline whispers being logged
This commit is contained in:
commit
3f41dfeff9
4 changed files with 11 additions and 6 deletions
|
@ -77,7 +77,8 @@ void Channel::addMessage(MessagePtr message,
|
|||
}
|
||||
|
||||
// FOURTF: change this when adding more providers
|
||||
if (this->isTwitchChannel())
|
||||
if (this->isTwitchChannel() &&
|
||||
(!overridingFlags || !overridingFlags->has(MessageFlag::DoNotLog)))
|
||||
{
|
||||
app->logging->addMessage(this->name_, message);
|
||||
}
|
||||
|
|
|
@ -206,11 +206,14 @@ QString CommandController::execCommand(const QString &textNoEmoji,
|
|||
|
||||
app->twitch.server->sendMessage("jtv", text);
|
||||
|
||||
auto overrideFlags = boost::optional<MessageFlags>(messagexD->flags);
|
||||
overrideFlags->set(MessageFlag::DoNotLog);
|
||||
|
||||
if (getSettings()->inlineWhispers)
|
||||
{
|
||||
app->twitch.server->forEachChannel(
|
||||
[&messagexD](ChannelPtr _channel) {
|
||||
_channel->addMessage(messagexD);
|
||||
[&messagexD, overrideFlags](ChannelPtr _channel) {
|
||||
_channel->addMessage(messagexD, overrideFlags);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ enum class MessageFlag : uint16_t {
|
|||
Untimeout = (1 << 10),
|
||||
PubSub = (1 << 11),
|
||||
Subscription = (1 << 12),
|
||||
Notification = (1 << 13),
|
||||
DoNotLog = (1 << 13),
|
||||
AutoMod = (1 << 14),
|
||||
RecentMessage = (1 << 15),
|
||||
};
|
||||
|
|
|
@ -261,12 +261,13 @@ void IrcMessageHandler::handleWhisperMessage(Communi::IrcMessage *message)
|
|||
|
||||
auto overrideFlags = boost::optional<MessageFlags>(_message->flags);
|
||||
overrideFlags->set(MessageFlag::DoNotTriggerNotification);
|
||||
overrideFlags->set(MessageFlag::DoNotLog);
|
||||
|
||||
if (getSettings()->inlineWhispers)
|
||||
{
|
||||
app->twitch.server->forEachChannel(
|
||||
[_message, overrideFlags](ChannelPtr channel) {
|
||||
channel->addMessage(_message, overrideFlags); //
|
||||
[&_message, overrideFlags](ChannelPtr channel) {
|
||||
channel->addMessage(_message, overrideFlags);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue