diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-08 20:30:41 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-08 20:30:41 +0000 |
commit | 21deb54715b6937ac9d4de5e2c4c46fb1b38aa3a (patch) | |
tree | a14f287c3320575fcb1b7831cca0b49fc0a5aeb5 /src/users.cpp | |
parent | 7de28b5b350c97562b4696aaa42a0a64a91d854d (diff) |
WriteWallops() -> userrec::WriteWallops() (originates from a user, so belongs in userrec)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4802 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/users.cpp')
-rw-r--r-- | src/users.cpp | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/src/users.cpp b/src/users.cpp index ec197fd60..31320581d 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -1390,7 +1390,7 @@ void userrec::WriteTo(userrec *dest, const std::string &data) } -void userrec::WriteCommon(char* text, ...) +void userrec::WriteCommon(const char* text, ...) { char textbuffer[MAXBUF]; va_list argsPtr; @@ -1448,7 +1448,7 @@ void userrec::WriteCommon(const std::string &text) * channel, NOT including the source user e.g. for use in QUIT */ -void userrec::WriteCommonExcept(char* text, ...) +void userrec::WriteCommonExcept(const char* text, ...) { char textbuffer[MAXBUF]; va_list argsPtr; @@ -1537,3 +1537,32 @@ void userrec::WriteCommonExcept(const std::string &text) } +void userrec::WriteWallOps(const std::string &text) +{ + /* Does nothing if theyre not opered */ + if ((!*this->oper) && (IS_LOCAL(this))) + return; + + std::string wallop = "WALLOPS :"; + wallop.append(text); + + for (std::vector<userrec*>::const_iterator i = local_users.begin(); i != local_users.end(); i++) + { + userrec* t = *i; + if ((IS_LOCAL(t)) && (t->modes[UM_WALLOPS])) + this->WriteTo(t,wallop); + } +} + +void userrec::WriteWallOps(const char* text, ...) +{ + char textbuffer[MAXBUF]; + va_list argsPtr; + + va_start(argsPtr, text); + vsnprintf(textbuffer, MAXBUF, text, argsPtr); + va_end(argsPtr); + + this->WriteWallOps(std::string(textbuffer)); +} + |