53 |
|
#include "watch.h" |
54 |
|
|
55 |
|
|
56 |
– |
struct Callback *entering_umode_cb = NULL; |
57 |
– |
struct Callback *umode_cb = NULL; |
58 |
– |
|
56 |
|
static char umode_buffer[IRCD_BUFSIZE]; |
57 |
|
|
58 |
|
static void user_welcome(struct Client *); |
77 |
|
MessageFile *isupportFile; |
78 |
|
|
79 |
|
/* memory is cheap. map 0-255 to equivalent mode */ |
80 |
< |
unsigned int user_modes[256] = |
80 |
> |
const unsigned int user_modes[256] = |
81 |
|
{ |
82 |
|
/* 0x00 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x0F */ |
83 |
|
/* 0x10 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x1F */ |
795 |
|
} |
796 |
|
} |
797 |
|
|
801 |
– |
/* change_simple_umode() |
802 |
– |
* |
803 |
– |
* this callback can be hooked to allow special handling of |
804 |
– |
* certain usermodes |
805 |
– |
*/ |
806 |
– |
static void * |
807 |
– |
change_simple_umode(va_list args) |
808 |
– |
{ |
809 |
– |
struct Client *client_p; |
810 |
– |
struct Client *source_p; |
811 |
– |
int what; |
812 |
– |
unsigned int flag; |
813 |
– |
|
814 |
– |
client_p = va_arg(args, struct Client *); |
815 |
– |
source_p = va_arg(args, struct Client *); |
816 |
– |
what = va_arg(args, int); |
817 |
– |
flag = va_arg(args, unsigned int); |
818 |
– |
|
819 |
– |
if (what == MODE_ADD) |
820 |
– |
AddUMode(source_p, flag); |
821 |
– |
else |
822 |
– |
DelUMode(source_p, flag); |
823 |
– |
|
824 |
– |
return NULL; |
825 |
– |
} |
826 |
– |
|
798 |
|
/* set_user_mode() |
799 |
|
* |
800 |
|
* added 15/10/91 By Darren Reed. |
843 |
|
return; |
844 |
|
} |
845 |
|
|
875 |
– |
execute_callback(entering_umode_cb, client_p, source_p); |
876 |
– |
|
846 |
|
/* find flags already set for user */ |
847 |
|
setflags = source_p->umodes; |
848 |
|
|
894 |
|
|
895 |
|
break; |
896 |
|
|
897 |
< |
/* we may not get these, |
898 |
< |
* but they shouldnt be in default |
897 |
> |
/* |
898 |
> |
* We may not get these, but they shouldnt be in default |
899 |
|
*/ |
900 |
|
case 'r': |
901 |
|
case ' ' : |
909 |
|
{ |
910 |
|
if (MyConnect(source_p) && !HasUMode(source_p, UMODE_OPER) && |
911 |
|
(ConfigFileEntry.oper_only_umodes & flag)) |
943 |
– |
{ |
912 |
|
badflag = 1; |
945 |
– |
} |
913 |
|
else |
914 |
< |
execute_callback(umode_cb, client_p, source_p, what, flag); |
914 |
> |
{ |
915 |
> |
if (what == MODE_ADD) |
916 |
> |
AddUMode(source_p, flag); |
917 |
> |
else |
918 |
> |
DelUMode(source_p, flag); |
919 |
> |
} |
920 |
|
} |
921 |
|
else |
922 |
|
{ |
1247 |
|
* -Dianora |
1248 |
|
*/ |
1249 |
|
memcpy(new_uid + IRC_MAXSID, "AAAAA@", IRC_MAXUID); |
1278 |
– |
|
1279 |
– |
entering_umode_cb = register_callback("entering_umode", NULL); |
1280 |
– |
umode_cb = register_callback("changing_umode", change_simple_umode); |
1250 |
|
} |
1251 |
|
|
1252 |
|
/* |