projects
/
ircu2.10.12-pk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Provide /stats F to report even defaulted feature values.
[ircu2.10.12-pk.git]
/
ircd
/
ircd_features.c
diff --git
a/ircd/ircd_features.c
b/ircd/ircd_features.c
index 0ffad1a201728cc2d4c607ca9966fa22c5e2a46a..baaa2bd0e146c1763d735681c8bf57bffed8060c 100644
(file)
--- a/
ircd/ircd_features.c
+++ b/
ircd/ircd_features.c
@@
-41,6
+41,7
@@
#include "s_bsd.h"
#include "s_debug.h"
#include "s_misc.h"
#include "s_bsd.h"
#include "s_debug.h"
#include "s_misc.h"
+#include "s_stats.h"
#include "send.h"
#include "struct.h"
#include "sys.h" /* FALSE bleah */
#include "send.h"
#include "struct.h"
#include "sys.h" /* FALSE bleah */
@@
-207,6
+208,17
@@
feature_log_get(struct Client* from, const char* const* fields, int count)
}
}
}
}
+/** Update whether #me is a hub or not.
+ */
+static void
+feature_notify_hub(void)
+{
+ if (feature_bool(FEAT_HUB))
+ SetHub(&me);
+ else
+ ClearHub(&me);
+}
+
/** Sets a feature to the given value.
* @param[in] from Client trying to set parameters.
* @param[in] fields Array of parameters to set.
/** Sets a feature to the given value.
* @param[in] from Client trying to set parameters.
* @param[in] fields Array of parameters to set.
@@
-298,7
+310,7
@@
static struct FeatureDesc {
F_S(PROVIDER, FEAT_NULL, 0, 0),
F_B(KILL_IPMISMATCH, FEAT_OPER, 0, 0),
F_B(IDLE_FROM_MSG, 0, 1, 0),
F_S(PROVIDER, FEAT_NULL, 0, 0),
F_B(KILL_IPMISMATCH, FEAT_OPER, 0, 0),
F_B(IDLE_FROM_MSG, 0, 1, 0),
- F_B(HUB, 0, 0,
0
),
+ F_B(HUB, 0, 0,
feature_notify_hub
),
F_B(WALLOPS_OPER_ONLY, 0, 0, 0),
F_B(NODNS, 0, 0, 0),
F_N(RANDOM_SEED, FEAT_NODISP, random_seed_set, 0, 0, 0, 0, 0, 0),
F_B(WALLOPS_OPER_ONLY, 0, 0, 0),
F_B(NODNS, 0, 0, 0),
F_N(RANDOM_SEED, FEAT_NODISP, random_seed_set, 0, 0, 0, 0, 0, 0),
@@
-312,6
+324,7
@@
static struct FeatureDesc {
F_B(ZANNELS, 0, 1, 0),
F_B(LOCAL_CHANNELS, 0, 1, 0),
F_B(TOPIC_BURST, 0, 0, 0),
F_B(ZANNELS, 0, 1, 0),
F_B(LOCAL_CHANNELS, 0, 1, 0),
F_B(TOPIC_BURST, 0, 0, 0),
+ F_B(DISABLE_GLINES, 0, 0, 0),
/* features that probably should not be touched */
F_I(KILLCHASETIMELIMIT, 0, 30, 0),
/* features that probably should not be touched */
F_I(KILLCHASETIMELIMIT, 0, 30, 0),
@@
-388,6
+401,7
@@
static struct FeatureDesc {
F_B(HIS_STATS_x, 0, 1, 0),
F_B(HIS_STATS_y, 0, 1, 0),
F_B(HIS_STATS_z, 0, 1, 0),
F_B(HIS_STATS_x, 0, 1, 0),
F_B(HIS_STATS_y, 0, 1, 0),
F_B(HIS_STATS_z, 0, 1, 0),
+ F_B(HIS_STATS_IAUTH, 0, 1, 0),
F_B(HIS_WHOIS_SERVERNAME, 0, 1, 0),
F_B(HIS_WHOIS_IDLETIME, 0, 1, 0),
F_B(HIS_WHOIS_LOCALCHAN, 0, 1, 0),
F_B(HIS_WHOIS_SERVERNAME, 0, 1, 0),
F_B(HIS_WHOIS_IDLETIME, 0, 1, 0),
F_B(HIS_WHOIS_LOCALCHAN, 0, 1, 0),
@@
-406,6
+420,7
@@
static struct FeatureDesc {
/* Misc. random stuff */
F_S(NETWORK, 0, "UnderNet", 0),
F_S(URL_CLIENTS, 0, "ftp://ftp.undernet.org/pub/irc/clients", 0),
/* Misc. random stuff */
F_S(NETWORK, 0, "UnderNet", 0),
F_S(URL_CLIENTS, 0, "ftp://ftp.undernet.org/pub/irc/clients", 0),
+ F_S(URLREG, 0, "http://cservice.undernet.org/live/", 0),
#undef F_S
#undef F_B
#undef F_S
#undef F_B
@@
-587,6
+602,9
@@
feature_set(struct Client* from, const char* const* fields, int count)
if (change && feat->notify) /* call change notify function */
(*feat->notify)();
if (change && feat->notify) /* call change notify function */
(*feat->notify)();
+
+ if (from)
+ return feature_get(from, fields, count);
}
return 0;
}
return 0;
@@
-650,6
+668,9
@@
feature_reset(struct Client* from, const char* const* fields, int count)
if (change && feat->notify) /* call change notify function */
(*feat->notify)();
if (change && feat->notify) /* call change notify function */
(*feat->notify)();
+
+ if (from)
+ return feature_get(from, fields, count);
}
return 0;
}
return 0;
@@
-799,6
+820,8
@@
feature_init(void)
void
feature_report(struct Client* to, const struct StatDesc* sd, char* param)
{
void
feature_report(struct Client* to, const struct StatDesc* sd, char* param)
{
+ char changed;
+ int report;
int i;
for (i = 0; features[i].type; i++) {
int i;
for (i = 0; features[i].type; i++) {
@@
-807,33
+830,36
@@
feature_report(struct Client* to, const struct StatDesc* sd, char* param)
(features[i].flags & FEAT_OPER && !IsAnOper(to)))
continue; /* skip this one */
(features[i].flags & FEAT_OPER && !IsAnOper(to)))
continue; /* skip this one */
+ changed = (features[i].flags & FEAT_MARK) ? 'F' : 'f';
+ report = (features[i].flags & FEAT_MARK) || sd->sd_funcdata;
+
switch (features[i].flags & FEAT_MASK) {
case FEAT_NONE:
if (features[i].report) /* let the callback handle this */
switch (features[i].flags & FEAT_MASK) {
case FEAT_NONE:
if (features[i].report) /* let the callback handle this */
- (*features[i].report)(to,
features[i].flags & FEAT_MARK ? 1 : 0
);
+ (*features[i].report)(to,
report
);
break;
case FEAT_INT: /* Report an F-line with integer values */
break;
case FEAT_INT: /* Report an F-line with integer values */
- if (
features[i].flags & FEAT_MARK
) /* it's been changed */
- send_reply(to, SND_EXPLICIT | RPL_STATSFLINE, "
F
%s %d",
- features[i].type, features[i].v_int);
+ if (
report
) /* it's been changed */
+ send_reply(to, SND_EXPLICIT | RPL_STATSFLINE, "
%c
%s %d",
+
changed,
features[i].type, features[i].v_int);
break;
case FEAT_BOOL: /* Report an F-line with boolean values */
break;
case FEAT_BOOL: /* Report an F-line with boolean values */
- if (
features[i].flags & FEAT_MARK
) /* it's been changed */
- send_reply(to, SND_EXPLICIT | RPL_STATSFLINE, "
F
%s %s",
- features[i].type, features[i].v_int ? "TRUE" : "FALSE");
+ if (
report
) /* it's been changed */
+ send_reply(to, SND_EXPLICIT | RPL_STATSFLINE, "
%c
%s %s",
+
changed,
features[i].type, features[i].v_int ? "TRUE" : "FALSE");
break;
case FEAT_STR: /* Report an F-line with string values */
break;
case FEAT_STR: /* Report an F-line with string values */
- if (
features[i].flags & FEAT_MARK
) { /* it's been changed */
+ if (
report
) { /* it's been changed */
if (features[i].v_str)
if (features[i].v_str)
- send_reply(to, SND_EXPLICIT | RPL_STATSFLINE, "
F
%s %s",
- features[i].type, features[i].v_str);
+ send_reply(to, SND_EXPLICIT | RPL_STATSFLINE, "
%c
%s %s",
+
changed,
features[i].type, features[i].v_str);
else /* Actually, F:<type> would reset it; you want F:<type>: */
else /* Actually, F:<type> would reset it; you want F:<type>: */
- send_reply(to, SND_EXPLICIT | RPL_STATSFLINE, "
F
%s",
- features[i].type);
+ send_reply(to, SND_EXPLICIT | RPL_STATSFLINE, "
%c
%s",
+
changed,
features[i].type);
}
break;
}
}
break;
}