}
if (cptr && MyUser(cptr))
send_umode(cptr, sptr, old, ALL_UMODES, 0);
+ if (sptr && sptr != cptr && MyUser(sptr))
+ send_umode(sptr, sptr, old, ALL_UMODES, 0);
}
ClearOverrideCC(sptr);
if (!FlagHas(&setflags, FLAG_KEEPCONN_ENABLED) && IsKeepConnEnabled(sptr) && !HasPriv(sptr, PRIV_SET_KEEPCONN))
ClearKeepConnEnabled(sptr);
+ if(keepconn && !HasPriv(sptr, PRIV_SET_KEEPCONN))
+ keepconn = NULL;
/* 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);
}
if (!FlagHas(&setflags, FLAG_KEEPCONN_ENABLED) && IsKeepConnEnabled(sptr)) {
sptr->keepconn = atoi(keepconn);
+ } else if(keepconn && sptr->keepconn != atoi(keepconn)) {
+ FlagClr(&setflags, FLAG_KEEPCONN_ENABLED);
+ sptr->keepconn = atoi(keepconn);
}
if (IsRegistered(sptr)) {
int flag;
char *m;
int what = MODE_NULL;
- int add_fakehost = 0, add_account = 0;
+ int add_fakehost = 0, add_account = 0, add_keepconn = 0;
/*
* Build a string in umodeBuf to represent the change in the user's
if(!serv_modes || FlagHas(old, flag)) continue;
add_fakehost = 1;
}
+
+ if(flag == FLAG_KEEPCONN_ENABLED) {
+ add_keepconn = 1;
+ }
switch (sendset)
{
while((*m++ = *t++)) ; /* Empty loop */
--m; /* back up over previous nul-termination */
}
+
+ if(add_keepconn) {
+ *m++ = ' ';
+ m += sprintf(m, "%u", sptr->keepconn);
+ }
*m = '\0';
if (*umodeBuf && cptr)