diff options
-rw-r--r-- | include/users.h | 13 | ||||
-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 |
4 files changed, 3 insertions, 31 deletions
diff --git a/include/users.h b/include/users.h index 5ab791eee..c90d2f265 100644 --- a/include/users.h +++ b/include/users.h @@ -529,19 +529,6 @@ class CoreExport User : public Extensible */ void WriteFrom(User *user, const char* text, ...) CUSTOM_PRINTF(3, 4); - /** Write text to the user provided in the first parameter, appending CR/LF, and prepending THIS user's :nick!user\@host. - * @param dest The user to route the message to - * @param data A std::string to send to the user - */ - void WriteTo(User *dest, const std::string &data); - - /** Write text to the user provided in the first parameter, appending CR/LF, and prepending THIS user's :nick!user\@host. - * @param dest The user to route the message to - * @param data The format string for text to send to the user - * @param ... POD-type format arguments - */ - void WriteTo(User *dest, const char *data, ...) CUSTOM_PRINTF(3, 4); - /** Write to all users that can see this user (including this user in the list if include_self is true), appending CR/LF * @param line A std::string to send to the users * @param include_self Should the message be sent back to the author? 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) |