diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-02-03 17:20:40 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-02-03 17:20:40 +0000 |
commit | 9ebbd138cc41fdd89d32b1bcbd137be4f89afa5e (patch) | |
tree | 1b607f4efa936131b7c0aeb115906567bc19b70a /src/helperfuncs.cpp | |
parent | 0b1c9c3507db83882a897038cdb5e84aded16e14 (diff) |
This probably wont compile atm - add support for prefixed messages
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3046 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/helperfuncs.cpp')
-rw-r--r-- | src/helperfuncs.cpp | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index c6396705c..20dd6cb13 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -484,7 +484,7 @@ void WriteChannelWithServ_NoFormat(char* ServName, chanrec* Ptr, const char* tex /* write formatted text from a source user to all users on a channel except * for the sender (for privmsg etc) */ -void ChanExceptSender(chanrec* Ptr, userrec* user, char* text, ...) +void ChanExceptSender(chanrec* Ptr, userrec* user, char status, char* text, ...) { if ((!Ptr) || (!user) || (!text)) { @@ -497,7 +497,22 @@ void ChanExceptSender(chanrec* Ptr, userrec* user, char* text, ...) vsnprintf(textbuffer, MAXBUF, text, argsPtr); va_end(argsPtr); - std::map<char*,char*> *ulist= Ptr->GetUsers(); + std::map<char*,char*> *ulist; + switch (status) + { + case '@': + Ptr->GetOppedUsers(); + break; + case '%': + Ptr->GetHalfoppedUsers(); + break; + case '+': + Ptr->GetVoicedUsers(); + break; + default: + Ptr->GetUsers(); + break; + } for (std::map<char*,char*>::iterator i = ulist->begin(); i != ulist->end(); i++) { char* o = i->second; @@ -507,14 +522,29 @@ void ChanExceptSender(chanrec* Ptr, userrec* user, char* text, ...) } } -void ChanExceptSender_NoFormat(chanrec* Ptr, userrec* user, const char* text) +void ChanExceptSender_NoFormat(chanrec* Ptr, userrec* user, char status, const char* text) { if ((!Ptr) || (!user) || (!text)) { log(DEFAULT,"*** BUG *** ChanExceptSender was given an invalid parameter"); return; } - std::map<char*,char*> *ulist= Ptr->GetUsers(); + std::map<char*,char*> *ulist; + switch (status) + { + case '@': + Ptr->GetOppedUsers(); + break; + case '%': + Ptr->GetHalfoppedUsers(); + break; + case '+': + Ptr->GetVoicedUsers(); + break; + default: + Ptr->GetUsers(); + break; + } for (std::map<char*,char*>::iterator i = ulist->begin(); i != ulist->end(); i++) { char* o = i->second; |