diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-02-25 17:26:09 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-02-25 17:26:09 +0000 |
commit | c2623e318f29550baba29adaeb227baa8c3ba483 (patch) | |
tree | 23a3157d4a057dbc833893954e768f481663c89b /src | |
parent | d56e1a1d586d61cfee2cdb8f6e8ecd71428385d8 (diff) |
m_customtitle: Don't route TITLE command, route metadata only
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11150 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/m_customtitle.cpp | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/src/modules/m_customtitle.cpp b/src/modules/m_customtitle.cpp index 4cfbeb715..d34e0dfe0 100644 --- a/src/modules/m_customtitle.cpp +++ b/src/modules/m_customtitle.cpp @@ -43,9 +43,6 @@ class CommandTitle : public Command CmdResult Handle(const std::vector<std::string> ¶meters, User* user) { - if (!IS_LOCAL(user)) - return CMD_LOCALONLY; - char TheHost[MAXBUF]; char TheIP[MAXBUF]; @@ -79,22 +76,14 @@ class CommandTitle : public Command if (!vhost.empty()) user->ChangeDisplayedHost(vhost.c_str()); - if (!ServerInstance->ULine(user->server)) - // Ulines set TITLEs silently - ServerInstance->SNO->WriteToSnoMask('A', "%s used TITLE to set custom title '%s'",user->nick.c_str(),title.c_str()); - user->WriteServ("NOTICE %s :Custom title set to '%s'",user->nick.c_str(), title.c_str()); - return CMD_SUCCESS; + return CMD_LOCALONLY; } } - if (!ServerInstance->ULine(user->server)) - // Ulines also fail TITLEs silently - ServerInstance->SNO->WriteToSnoMask('A', "Failed TITLE attempt by %s!%s@%s using login '%s'", user->nick.c_str(), user->ident.c_str(), user->host.c_str(), parameters[0].c_str()); - user->WriteServ("NOTICE %s :Invalid title credentials",user->nick.c_str()); - return CMD_SUCCESS; + return CMD_LOCALONLY; } }; @@ -191,12 +180,16 @@ class ModuleCustomTitle : public Module if ((target_type == TYPE_USER) && (extname == "ctitle")) { User* dest = (User*)target; - // if they dont already have an ctitle field, accept the remote server's std::string* text; - if (!dest->GetExt("ctitle", text)) + if (dest->GetExt("ctitle", text)) + { + dest->Shrink("ctitle"); + delete text; + } + if (!extdata.empty()) { - std::string* ntext = new std::string(extdata); - dest->Extend("ctitle",ntext); + text = new std::string(extdata); + dest->Extend("ctitle", text); } } } |