summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-08 18:03:30 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-08 18:03:30 +0000
commitfc9e00f49299cb3b402406b5f185d5f4af1e9780 (patch)
tree48b6fe7559ce9ef6f0e46c49618bfe1ddf3d5523 /src
parent1d3147a96ec3193929463830800c97df5f344b53 (diff)
Add userrec::HasMode, fix some typos.
TODO: Make more use of userrec::HasUmode('c') rather than user->modes['c'-65] *oogly* Next - get umode +o working! git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4178 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/helperfuncs.cpp4
-rw-r--r--src/message.cpp10
-rw-r--r--src/users.cpp5
3 files changed, 7 insertions, 12 deletions
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];