X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=blobdiff_plain;f=ircd%2Fs_user.c;fp=ircd%2Fs_user.c;h=60144878d25c049b891de1092960fc78262bca20;hp=96d88a15e3db5ab173052a8a5c78159063c90e8f;hb=0c50183c885701a84e7369ca05739fec052b7ecc;hpb=96f1ae9c934d475960c2aa6b3b4f1336c37833c2 diff --git a/ircd/s_user.c b/ircd/s_user.c index 96d88a1..6014487 100644 --- a/ircd/s_user.c +++ b/ircd/s_user.c @@ -589,6 +589,7 @@ static const struct UserMode { { FLAG_WEBIRC, 'W' }, { FLAG_SEE_IDLETIME,'t' }, { FLAG_SECURITY_SERV,'D' }, + { FLAG_KEEPCONN_ENABLED, 'K' }, { FLAG_HIDDENHOST, 'x' }, { FLAG_NOTCONN, 'Z' } }; @@ -1135,7 +1136,7 @@ int set_user_mode(struct Client *cptr, struct Client *sptr, int parc, char buf[BUFSIZE]; int prop = 0; int do_host_hiding = 0; - char* account = NULL, *fakehost = NULL; + char* account = NULL, *fakehost = NULL, *keepconn = NULL; struct Membership *chan; what = MODE_ADD; @@ -1307,6 +1308,16 @@ int set_user_mode(struct Client *cptr, struct Client *sptr, int parc, else ClearWebIRC(sptr); break; + case 'K': + if (what == MODE_ADD) { + if(*(p + 1) == 0) + break; + keepconn = *(++p); + SetKeepConnEnabled(sptr); + } else { + ClearKeepConnEnabled(sptr); + } + break; case 'r': if (*(p + 1) && (what == MODE_ADD)) { account = *(++p); @@ -1383,6 +1394,8 @@ int set_user_mode(struct Client *cptr, struct Client *sptr, int parc, ClearHiddenOper(sptr); if (!FlagHas(&setflags, FLAG_OVERRIDECC) && IsOverrideCC(sptr) && !HasPriv(sptr, PRIV_UMODE_OVERRIDECC)) ClearOverrideCC(sptr); + if (!FlagHas(&setflags, FLAG_KEEPCONN_ENABLED) && IsKeepConnEnabled(sptr) && !HasPriv(sptr, PRIV_SET_KEEPCONN)) + ClearKeepConnEnabled(sptr); /* Opers are able to fake the webirc usermode only if FEAT_FAKE_WEBIRC is true. */ if (!FlagHas(&setflags, FLAG_WEBIRC) && IsWebIRC(sptr) && !(feature_bool(FEAT_FAKE_WEBIRC) && IsOper(sptr))) ClearWebIRC(sptr); @@ -1443,6 +1456,9 @@ int set_user_mode(struct Client *cptr, struct Client *sptr, int parc, if (!FlagHas(&setflags, FLAG_FAKEHOST) && IsFakeHost(sptr)) { ircd_strncpy(cli_user(sptr)->fakehost, fakehost, HOSTLEN); } + if (!FlagHas(&setflags, FLAG_KEEPCONN_ENABLED) && IsKeepConnEnabled(sptr)) { + sptr->keepconn = atoi(keepconn); + } if (IsRegistered(sptr)) { if(do_host_hiding)