diff options
-rw-r--r-- | include/message.h | 1 | ||||
-rw-r--r-- | include/users.h | 2 | ||||
-rw-r--r-- | src/helperfuncs.cpp | 4 | ||||
-rw-r--r-- | src/message.cpp | 10 | ||||
-rw-r--r-- | src/users.cpp | 5 |
5 files changed, 9 insertions, 13 deletions
diff --git a/include/message.h b/include/message.h index 2c85de6f6..dd653e33b 100644 --- a/include/message.h +++ b/include/message.h @@ -35,7 +35,6 @@ void Blocking(int s); void NonBlocking(int s); int CleanAndResolve (char *resolvedHost, const char *unresolvedHost, bool forward); int c_count(userrec* u); -bool hasumode(userrec* user, char mode); void ChangeName(userrec* user, const char* gecos); void ChangeDisplayedHost(userrec* user, const char* host); int isident(const char* n); diff --git a/include/users.h b/include/users.h index b1f784bb3..2b3f74742 100644 --- a/include/users.h +++ b/include/users.h @@ -268,6 +268,8 @@ class userrec : public connection * Create a displayable mode string for this users umodes */ const char* FormatModes(); + + bool HasMode(unsigned char m); /** Returns true if a user is invited to a channel. */ diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index c190aff4e..77a74c32c 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -1045,7 +1045,7 @@ void WriteMode(const char* modes, int flags, const char* text, ...) for (int n = 0; n < modelen; n++) { - if (!hasumode(t,modes[n])) + if (!t->modes[modes[n]-65]) { send_to_user = false; break; @@ -1058,7 +1058,7 @@ void WriteMode(const char* modes, int flags, const char* text, ...) for (int n = 0; n < modelen; n++) { - if (hasumode(t,modes[n])) + if (t->modes[modes[n]-65]) { send_to_user = true; break; diff --git a/src/message.cpp b/src/message.cpp index 5106bffba..03bd5fd41 100644 --- a/src/message.cpp +++ b/src/message.cpp @@ -198,16 +198,6 @@ int c_count(userrec* u) } -bool hasumode(userrec* user, unsigned char mode) -{ - if (user) - { - return user->modes[mode-65]; - } - else return false; -} - - void ChangeName(userrec* user, const char* gecos) { if (user->fd > -1) diff --git a/src/users.cpp b/src/users.cpp index 48ce0054b..40594c8a9 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -110,6 +110,11 @@ bool DoneClassesAndTypes(const char* tag) return true; } +bool userrec::HasMode(unsigned char m) +{ + return (modes[m-65]); +} + const char* userrec::FormatModes() { static char data[MAXBUF]; |