X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/6d3e983251db74a580b84724fdfefc35e286faad..fdbbf311ef10d7458bb3c313be02000a75f0972a:/src/s_user.c diff --git a/src/s_user.c b/src/s_user.c index 185b76e..c64d50f 100644 --- a/src/s_user.c +++ b/src/s_user.c @@ -73,7 +73,7 @@ int user_modes[256] = { UMODE_DEAF, /* D */ 0, /* E */ 0, /* F */ - 0, /* G */ + UMODE_SCALLERID, /* G */ 0, /* H */ 0, /* I */ 0, /* J */ @@ -109,7 +109,7 @@ int user_modes[256] = { 0, /* m */ 0, /* n */ UMODE_OPER, /* o */ - 0, /* p */ + UMODE_OVERRIDE, /* p */ 0, /* q */ 0, /* r */ UMODE_SERVNOTICE, /* s */ @@ -583,7 +583,7 @@ register_local_user(struct Client *client_p, struct Client *source_p, const char * from a remote connect. */ int -introduce_client(struct Client *client_p, struct Client *source_p, struct User *user, struct ConfItem *aconf, const char *nick, int use_euid) +introduce_client(struct Client *client_p, struct Client *source_p, struct User *user, const char *nick, int use_euid) { static char ubuf[12]; struct Client *identifyservice_p; @@ -591,6 +591,7 @@ introduce_client(struct Client *client_p, struct Client *source_p, struct User * hook_data_umode_changed hdata; hook_data_client hdata2; char sockhost[HOSTLEN]; + struct ConfItem *aconf; if(MyClient(source_p)) send_umode(source_p, source_p, 0, 0, ubuf); @@ -710,7 +711,7 @@ introduce_client(struct Client *client_p, struct Client *source_p, struct User * if(aconf->autojoin != NULL) { - user_join(client_p, source_p, aconf->autojoin, NULL, 0); + user_join(client_p, source_p, aconf->autojoin, NULL); } } @@ -1137,6 +1138,12 @@ user_mode(struct Client *client_p, struct Client *source_p, int parc, const char source_p->umodes &= ~UMODE_ADMIN; } + if(MyConnect(source_p) && (source_p->umodes & UMODE_OVERRIDE) && (!IsOperOverride(source_p))) + { + sendto_one_notice(source_p, ":*** You need oper and the override flag for +p"); + source_p->umodes &= ~UMODE_OVERRIDE; + } + /* let modules providing usermodes know that we've changed our usermode --nenolod */ hdata.client = source_p; hdata.oldumodes = setflags; @@ -1288,10 +1295,11 @@ user_welcome(struct Client *source_p) * side effects - opers up source_p using aconf for reference */ int -oper_up(struct Client *source_p, struct oper_conf *oper_p, struct ConfItem *aconf) +oper_up(struct Client *source_p, struct oper_conf *oper_p) { unsigned int old = source_p->umodes, oldsnomask = source_p->snomask; hook_data_umode_changed hdata; + struct ConfItem *aconf; SetOper(source_p); @@ -1362,7 +1370,7 @@ oper_up(struct Client *source_p, struct oper_conf *oper_p, struct ConfItem *acon * Plus this is post-umode being set so you'll pass +I $o or +O. * Hence why we're making this a normal clean join. --jdhore */ - user_join(&me, source_p, aconf->autojoin_opers, NULL, 0); + user_join(&me, source_p, aconf->autojoin_opers, NULL); } return (1); @@ -1433,7 +1441,7 @@ change_nick_user_host(struct Client *target_p, const char *nick, const char *use struct membership *mscptr; int changed = irccmp(target_p->name, nick); int changed_case = strcmp(target_p->name, nick); - int do_qjm = irccmp(target_p->username, user) || irccmp(target_p->host, host); + int do_qjm = irccmp(target_p->username, user) || (irccmp(target_p->host, host) && ConfigChannel.cycle_host_change); char mode[10], modeval[NICKLEN * 2 + 2], reason[256], *mptr; va_list ap; @@ -1462,6 +1470,13 @@ change_nick_user_host(struct Client *target_p, const char *nick, const char *use chptr = mscptr->chptr; mptr = mode; + if(is_owner(mscptr)) + { + *mptr++ = 'a'; + strcat(modeval, nick); + strcat(modeval, " "); + } + if(is_chanop(mscptr)) { *mptr++ = 'o'; @@ -1469,6 +1484,13 @@ change_nick_user_host(struct Client *target_p, const char *nick, const char *use strcat(modeval, " "); } + if(is_halfop(mscptr)) + { + *mptr++ = 'h'; + strcat(modeval, nick); + strcat(modeval, " "); + } + if(is_voiced(mscptr)) { *mptr++ = 'v';