nick *sender=source;
chanindex *cip;
regchan *rcp;
- time_t starttime=getnettime();
-
+ unsigned long interval;
+
if (cargc < 1) {
chanservstdmessage(sender, QM_NOTENOUGHPARAMS, "chanlevhistory");
return CMD_ERROR;
rcp=(regchan*)cip->exts[chanservext];
if (cargc > 1)
- starttime-=durationtolong(cargv[1]);
+ interval=durationtolong(cargv[1]);
else
- starttime-=3600;
-
- csdb_retreivechanlevhistory(sender, rcp, starttime);
+ interval=3600;
+
+ chanservstdmessage(sender, QM_SHOWINGDURATION, "chanlevhistory", longtoduration(interval,1));
+ csdb_retreivechanlevhistory(sender, rcp, getnettime()-interval);
return CMD_OK;
}
if (rcp->regusers[j])
break;
- if (i==REGCHANUSERHASHSIZE) {
+ if (j==REGCHANUSERHASHSIZE) {
cs_log(np, "DELCHAN %s (Cleared chanlev from rollback)", cip->name->content);
chanservsendmessage(np, "Rollback cleared chanlev list, channel deleted.");
rcp=NULL;
#define QM_GIVEOWNERALREADYOWNER 139
#define QM_GIVEOWNERNEEDHASH 140
#define QM_GIVEOWNERWRONGHASH 141
+#define QM_SHOWINGDURATION 142
/* List of privileged operations */
if (rcup->chan->index->channel) {
/* Channel exists */
if ((lp=getnumerichandlefromchanhash(rcup->chan->index->channel->users, np->numeric))) {
-
- /* User is on channel.. */
+ /* User is on channel.. */
+
+ /* Update last use time */
+ rcup->usetime=getnettime();
+
localsetmodeinit(&changes, rcup->chan->index->channel, chanservnick);
if (*lp & CUMODE_OP) {
if (!IsService(np) && (CUIsDeny(rcup) || (CIsBitch(rcup->chan) && !CUHasOpPriv(rcup))))
/* 138*/ "User %s is not a master on %s - you must promote user to master status first.",
/* 139*/ "User %s is already an owner on %s.",
/* 140*/ "WARNING: This command will give COMPLETE control over %s to %s, including the ability to remove you as owner.\nIf you are sure you want to do this, type /msg Q GIVEOWNER %s #%s %s",
- /* 141*/ "Hash value incorrect."
+ /* 141*/ "Hash value incorrect.",
+ /* 142*/ "Showing %s for last %s."
};
void initmessages() {
buf[i*18]=' ';
}
}
-
for (cbp=cp->bans;cbp;cbp=cbp->next) {
controlreply((nick *)sender,"Ban : %s",bantostringdebug(cbp));
patricia_node_t *node;
prefix_t *prefix;
- node = patricia_search_exact(tree, sin, PATRICIA_MAXBITS);
+ node = patricia_search_exact(tree, sin, bitlen);
if (node == NULL) {
prefix = patricia_new_prefix(sin, bitlen);