Merge pull request #965 from moe-ka/master

Fix for inline whispers being logged
This commit is contained in:
pajlada 2019-03-02 09:37:09 +01:00 committed by GitHub
commit 3f41dfeff9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 6 deletions

View file

@ -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);
}

View file

@ -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);
});
}

View file

@ -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),
};

View file

@ -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);
});
}
}