aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_ircv3_chghost.cpp
diff options
context:
space:
mode:
authorGravatar Peter Powell2018-08-13 20:17:46 +0100
committerGravatar Peter Powell2018-08-13 21:51:11 +0100
commit58a0a7e01422e62de1565a8eb0a1febdc463d04d (patch)
tree8861789deefe9df3524690de8ccd11e5366f1f2e /src/modules/m_ircv3_chghost.cpp
parentAdd an accessor for the last mode change list to ModeParser. (diff)
Implement IRCv3 message tag support.
Co-authored-by: Attila Molnar <attilamolnar@hush.com>
Diffstat (limited to 'src/modules/m_ircv3_chghost.cpp')
-rw-r--r--src/modules/m_ircv3_chghost.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/modules/m_ircv3_chghost.cpp b/src/modules/m_ircv3_chghost.cpp
index 0a9e055b4..aa53612cb 100644
--- a/src/modules/m_ircv3_chghost.cpp
+++ b/src/modules/m_ircv3_chghost.cpp
@@ -24,17 +24,21 @@
class ModuleIRCv3ChgHost : public Module
{
Cap::Capability cap;
+ ClientProtocol::EventProvider protoevprov;
void DoChgHost(User* user, const std::string& ident, const std::string& host)
{
- std::string line(1, ':');
- line.append(user->GetFullHost()).append(" CHGHOST ").append(ident).append(1, ' ').append(host);
- IRCv3::WriteNeighborsWithCap(user, line, cap);
+ ClientProtocol::Message msg("CHGHOST", user);
+ msg.PushParamRef(ident);
+ msg.PushParamRef(host);
+ ClientProtocol::Event protoev(protoevprov, msg);
+ IRCv3::WriteNeighborsWithCap(user, protoev, cap);
}
public:
ModuleIRCv3ChgHost()
: cap(this, "chghost")
+ , protoevprov(this, "CHGHOST")
{
}