diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-04-02 12:44:12 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-04-02 12:44:12 +0200 |
commit | a6e68c0d346395630dee9dc69211a284360b6c62 (patch) | |
tree | 1d6c28eb611182fa38ac6061c886695bd1d5f6cd /src | |
parent | 02e935ec7502b70fe85c9676bf8ddf0c15d9337e (diff) |
Remove User::WriteTo() functions; use User::WriteFrom() instead
The removed functions were rarely used and all they did was to call User::WriteFrom() with swapped arguments. On call sites, WriteTo() hardly offers any readability improvement over WriteFrom().
Diffstat (limited to 'src')
-rw-r--r-- | src/coremods/core_privmsg.cpp | 2 | ||||
-rw-r--r-- | src/coremods/core_wallops.cpp | 2 | ||||
-rw-r--r-- | src/users.cpp | 17 |
3 files changed, 3 insertions, 18 deletions
diff --git a/src/coremods/core_privmsg.cpp b/src/coremods/core_privmsg.cpp index 0cca56771..fbabc4a5c 100644 --- a/src/coremods/core_privmsg.cpp +++ b/src/coremods/core_privmsg.cpp @@ -229,7 +229,7 @@ CmdResult MessageCommandBase::HandleMessage(const std::vector<std::string>& para if (IS_LOCAL(dest)) { // direct write, same server - user->WriteTo(dest, "%s %s :%s", MessageTypeString[mt], dest->nick.c_str(), text); + dest->WriteFrom(user, "%s %s :%s", MessageTypeString[mt], dest->nick.c_str(), text); } FOREACH_MOD(OnUserMessage, (user, dest, TYPE_USER, text, 0, except_list, mt)); diff --git a/src/coremods/core_wallops.cpp b/src/coremods/core_wallops.cpp index 276da51dc..5dfb79b67 100644 --- a/src/coremods/core_wallops.cpp +++ b/src/coremods/core_wallops.cpp @@ -59,7 +59,7 @@ CmdResult CommandWallops::Handle (const std::vector<std::string>& parameters, Us { User* t = *i; if (t->IsModeSet(wallopsmode)) - user->WriteTo(t,wallop); + t->WriteFrom(user, wallop); } return CMD_SUCCESS; diff --git a/src/users.cpp b/src/users.cpp index a52c392fc..40147b37d 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -695,7 +695,7 @@ bool User::ChangeNick(const std::string& newnick, bool force, time_t newts) if (InUse->registered != REG_ALL) { /* force the camper to their UUID, and ask them to re-send a NICK. */ - InUse->WriteTo(InUse, "NICK %s", InUse->uuid.c_str()); + InUse->WriteFrom(InUse, "NICK %s", InUse->uuid.c_str()); InUse->WriteNumeric(ERR_NICKNAMEINUSE, "%s :Nickname overruled.", InUse->nick.c_str()); ServerInstance->Users->clientlist.erase(InUse->nick); @@ -908,21 +908,6 @@ void User::WriteFrom(User *user, const char* text, ...) this->WriteFrom(user, textbuffer); } - -/* write text to an destination user from a source user (e.g. user privmsg) */ - -void User::WriteTo(User *dest, const char *data, ...) -{ - std::string textbuffer; - VAFORMAT(textbuffer, data, data); - this->WriteTo(dest, textbuffer); -} - -void User::WriteTo(User *dest, const std::string &data) -{ - dest->WriteFrom(this, data); -} - void User::WriteCommon(const char* text, ...) { if (this->registered != REG_ALL || quitting) |