void OnUserPostMessage(User* user, const MessageTarget& target, const MessageDetails& details) CXX11_OVERRIDE
{
- if (!cap.get(user))
+ if (!cap.get(user) || !details.echo)
return;
// Caps are only set on local users
LocalUser* const localuser = static_cast<LocalUser*>(user);
- const std::string& text = details.echooriginal ? details.originaltext : details.text;
+ const std::string& text = details.echo_original ? details.original_text : details.text;
+ const ClientProtocol::TagMap& tags = details.echo_original ? details.tags_in : details.tags_out;
if (target.type == MessageTarget::TYPE_USER)
{
User* destuser = target.Get<User>();
ClientProtocol::Messages::Privmsg privmsg(ClientProtocol::Messages::Privmsg::nocopy, user, destuser, text, details.type);
- privmsg.AddTags(details.tags_in);
+ privmsg.AddTags(tags);
localuser->Send(ServerInstance->GetRFCEvents().privmsg, privmsg);
}
else if (target.type == MessageTarget::TYPE_CHANNEL)
{
Channel* chan = target.Get<Channel>();
ClientProtocol::Messages::Privmsg privmsg(ClientProtocol::Messages::Privmsg::nocopy, user, chan, text, details.type, target.status);
- privmsg.AddTags(details.tags_in);
+ privmsg.AddTags(tags);
localuser->Send(ServerInstance->GetRFCEvents().privmsg, privmsg);
}
else
{
const std::string* servername = target.Get<std::string>();
ClientProtocol::Messages::Privmsg privmsg(ClientProtocol::Messages::Privmsg::nocopy, user, *servername, text, details.type);
- privmsg.AddTags(details.tags_in);
+ privmsg.AddTags(tags);
localuser->Send(ServerInstance->GetRFCEvents().privmsg, privmsg);
}
}
void OnUserMessageBlocked(User* user, const MessageTarget& target, const MessageDetails& details) CXX11_OVERRIDE
{
// Prevent spammers from knowing that their spam was blocked.
- if (details.echooriginal)
+ if (details.echo_original)
OnUserPostMessage(user, target, details);
}
Version GetVersion() CXX11_OVERRIDE
{
- return Version("Provides the echo-message IRCv3.2 extension", VF_VENDOR);
+ return Version("Provides the echo-message IRCv3 extension", VF_VENDOR);
}
};