summaryrefslogtreecommitdiff
path: root/src/modules/m_customtitle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_customtitle.cpp')
-rw-r--r--src/modules/m_customtitle.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/modules/m_customtitle.cpp b/src/modules/m_customtitle.cpp
index 3386e8cd7..30c0aa4f2 100644
--- a/src/modules/m_customtitle.cpp
+++ b/src/modules/m_customtitle.cpp
@@ -28,7 +28,7 @@ class CommandTitle : public Command
public:
StringExtItem ctitle;
CommandTitle(Module* Creator) : Command(Creator,"TITLE", 2),
- ctitle("ctitle", Creator)
+ ctitle("ctitle", ExtensionItem::EXT_USER, Creator)
{
syntax = "<user> <password>";
}
@@ -70,26 +70,28 @@ class CommandTitle : public Command
};
-class ModuleCustomTitle : public Module
+class ModuleCustomTitle : public Module, public Whois::LineEventListener
{
CommandTitle cmd;
public:
- ModuleCustomTitle() : cmd(this)
+ ModuleCustomTitle()
+ : Whois::LineEventListener(this)
+ , cmd(this)
{
}
// :kenny.chatspike.net 320 Brain Azhrarn :is getting paid to play games.
- ModResult OnWhoisLine(User* user, User* dest, int &numeric, std::string &text) CXX11_OVERRIDE
+ ModResult OnWhoisLine(Whois::Context& whois, Numeric::Numeric& numeric) CXX11_OVERRIDE
{
/* We use this and not OnWhois because this triggers for remote, too */
- if (numeric == 312)
+ if (numeric.GetNumeric() == 312)
{
/* Insert our numeric before 312 */
- const std::string* ctitle = cmd.ctitle.get(dest);
+ const std::string* ctitle = cmd.ctitle.get(whois.GetTarget());
if (ctitle)
{
- ServerInstance->SendWhoisLine(user, dest, 320, "%s :%s", dest->nick.c_str(), ctitle->c_str());
+ whois.SendLine(320, ctitle);
}
}
/* Don't block anything */