diff options
-rw-r--r-- | include/users.h | 14 | ||||
-rw-r--r-- | src/users.cpp | 27 |
2 files changed, 41 insertions, 0 deletions
diff --git a/include/users.h b/include/users.h index a7d1c9250..6f9c6d296 100644 --- a/include/users.h +++ b/include/users.h @@ -170,6 +170,11 @@ class userrec : public connection */ char modes[64]; + /** What snomasks are set on this user. + * This functions the same as the above modes. + */ + char snomasks[64]; + UserChanList chans; /** The server the user is connected to. @@ -267,6 +272,15 @@ class userrec : public connection /* * Create a displayable mode string for this users umodes */ + const char* FormatNoticeMasks(); + + bool IsNoticeMaskSet(unsigned char sm); + + void SetNoticeMask(unsigned char sm, bool value); + + /* + * Create a displayable mode string for this users umodes + */ const char* FormatModes(); bool IsModeSet(unsigned char m); diff --git a/src/users.cpp b/src/users.cpp index f51656a55..b18806016 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -110,6 +110,33 @@ bool DoneClassesAndTypes(const char* tag) return true; } +bool userrec::IsNoticeMaskSet(unsigned char sm) +{ + return (snomasks[sm-65]); +} + +void userrec::SetNoticeMask(unsigned char sm, bool value) +{ + snomasks[sm-65] = value; +} + +const char* userrec::FormatNoticeMasks() +{ + static char data[MAXBUF]; + int offset = 0; + + for (int n = 0; n < 64; n++) + { + if (snomasks[n]) + data[offset++] = n+65; + } + + data[offset] = 0; + return data; +} + + + bool userrec::IsModeSet(unsigned char m) { return (modes[m-65]); |