summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>2013-05-12 18:07:22 +0000
committermichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>2013-05-12 18:07:22 +0000
commit5f8158ffa61beb5eb48af8285d6219b9bac99ea6 (patch)
tree1237687933c57a8f04741858be80ba2421c79e61
parent029f98657907a18d64b33d08b6f3577d2561a4c3 (diff)
- Remove entering_umode and change_umode callbacks in preparation for the
modular usermode subsystem git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@2023 82007160-df01-0410-b94d-b575c5fd34c7
-rw-r--r--include/s_user.h4
-rw-r--r--modules/m_svsmode.c8
-rw-r--r--src/s_user.c49
3 files changed, 17 insertions, 44 deletions
diff --git a/include/s_user.h b/include/s_user.h
index 135c4ed..af05c67 100644
--- a/include/s_user.h
+++ b/include/s_user.h
@@ -31,9 +31,7 @@
struct Client;
-extern struct Callback *entering_umode_cb;
-extern struct Callback *umode_cb;
-extern unsigned int user_modes[];
+extern const unsigned int user_modes[];
extern void assemble_umode_buffer(void);
extern void set_user_mode(struct Client *, struct Client *, const int, char *[]);
diff --git a/modules/m_svsmode.c b/modules/m_svsmode.c
index 0344d84..503ea21 100644
--- a/modules/m_svsmode.c
+++ b/modules/m_svsmode.c
@@ -144,7 +144,13 @@ ms_svsmode(struct Client *client_p, struct Client *source_p,
break;
default:
if ((flag = user_modes[(unsigned char)*m]))
- execute_callback(umode_cb, client_p, target_p, what, flag);
+ {
+ if (what == MODE_ADD)
+ AddUMode(target_p, flag);
+ else
+ DelUMode(target_p, flag);
+ }
+
break;
}
}
diff --git a/src/s_user.c b/src/s_user.c
index 6ec163e..ad342cd 100644
--- a/src/s_user.c
+++ b/src/s_user.c
@@ -53,9 +53,6 @@
#include "watch.h"
-struct Callback *entering_umode_cb = NULL;
-struct Callback *umode_cb = NULL;
-
static char umode_buffer[IRCD_BUFSIZE];
static void user_welcome(struct Client *);
@@ -80,7 +77,7 @@ static dlink_list support_list = { NULL, NULL, 0 };
MessageFile *isupportFile;
/* memory is cheap. map 0-255 to equivalent mode */
-unsigned int user_modes[256] =
+const unsigned int user_modes[256] =
{
/* 0x00 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x0F */
/* 0x10 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x1F */
@@ -798,32 +795,6 @@ report_and_set_user_flags(struct Client *source_p, const struct MaskItem *conf)
}
}
-/* change_simple_umode()
- *
- * this callback can be hooked to allow special handling of
- * certain usermodes
- */
-static void *
-change_simple_umode(va_list args)
-{
- struct Client *client_p;
- struct Client *source_p;
- int what;
- unsigned int flag;
-
- client_p = va_arg(args, struct Client *);
- source_p = va_arg(args, struct Client *);
- what = va_arg(args, int);
- flag = va_arg(args, unsigned int);
-
- if (what == MODE_ADD)
- AddUMode(source_p, flag);
- else
- DelUMode(source_p, flag);
-
- return NULL;
-}
-
/* set_user_mode()
*
* added 15/10/91 By Darren Reed.
@@ -872,8 +843,6 @@ set_user_mode(struct Client *client_p, struct Client *source_p,
return;
}
- execute_callback(entering_umode_cb, client_p, source_p);
-
/* find flags already set for user */
setflags = source_p->umodes;
@@ -925,8 +894,8 @@ set_user_mode(struct Client *client_p, struct Client *source_p,
break;
- /* we may not get these,
- * but they shouldnt be in default
+ /*
+ * We may not get these, but they shouldnt be in default
*/
case 'r':
case ' ' :
@@ -940,11 +909,14 @@ set_user_mode(struct Client *client_p, struct Client *source_p,
{
if (MyConnect(source_p) && !HasUMode(source_p, UMODE_OPER) &&
(ConfigFileEntry.oper_only_umodes & flag))
- {
badflag = 1;
- }
else
- execute_callback(umode_cb, client_p, source_p, what, flag);
+ {
+ if (what == MODE_ADD)
+ AddUMode(source_p, flag);
+ else
+ DelUMode(source_p, flag);
+ }
}
else
{
@@ -1275,9 +1247,6 @@ init_uid(void)
* -Dianora
*/
memcpy(new_uid + IRC_MAXSID, "AAAAA@", IRC_MAXUID);
-
- entering_umode_cb = register_callback("entering_umode", NULL);
- umode_cb = register_callback("changing_umode", change_simple_umode);
}
/*