time_t t = getnettime();
/* abusing the ternary operator a bit :( */
- controlreply(sender, "Name: : %s", tg->name->content);
+ controlreply(sender, "Name : %s", tg->name->content);
controlreply(sender, "Trusted for : %s", formatlimit(tg->trustedfor));
controlreply(sender, "Currently using : %d", tg->count);
controlreply(sender, "Clients per user : %s", formatlimit(tg->maxperident));
controlreply(sender, "Flags : %s", formatflags(tg->flags));
- controlreply(sender, "Contact: : %s", tg->contact->content);
+ controlreply(sender, "Contact : %s", tg->contact->content);
controlreply(sender, "Expires in : %s", (tg->expires)?((tg->expires>t)?longtoduration(tg->expires - t, 2):"the past (will be removed during next cleanup)"):"never");
controlreply(sender, "Created by : %s", tg->createdby->content);
- controlreply(sender, "Comment: : %s", tg->comment->content);
- controlreply(sender, "ID: : %u", tg->id);
+ controlreply(sender, "Comment : %s", tg->comment->content);
+ controlreply(sender, "ID : %u", tg->id);
controlreply(sender, "Last used : %s", (tg->count>0)?"(now)":((tg->lastseen>0)?trusts_timetostr(tg->lastseen):"(never)"));
controlreply(sender, "Max usage : %d", tg->maxusage);
controlreply(sender, "Last max reset : %s", tg->lastmaxusereset?trusts_timetostr(tg->lastmaxusereset):"(never)");
outputtree(sender, marker, tg, p2[i], 0, showchildren);
array_free(&parents);
-
- controlreply(sender, "End of list.");
}
static int trusts_cmdtrustlist(void *source, int cargc, char **cargv) {
if(tg) {
displaygroup(sender, tg, showchildren);
+ controlreply(sender, "End of list.");
return CMD_OK;
}
}
displaygroup(sender, th->group, showchildren);
+ controlreply(sender, "End of list.");
return CMD_OK;
}
found = 1;
}
- if(!found)
+ if(found) {
+ controlreply(sender, "End of list.");
+ } else {
controlreply(sender, "No matches found.");
+ }
return CMD_OK;
}
return;
commandsregistered = 1;
- registercontrolhelpcmd("trustlist", NO_RELAY, 2, trusts_cmdtrustlist, "Usage: trustlist [-v] <#id|name|IP|&qid>\nShows trust data for the specified trust group.");
+ registercontrolhelpcmd("trustlist", NO_OPER, 2, trusts_cmdtrustlist, "Usage: trustlist [-v] <#id|name|IP|&qid>\nShows trust data for the specified trust group.");
+ registercontrolhelpcmd("trustlistrelay", NO_RELAY, 2, trusts_cmdtrustlist, "Same as trustlist, but for the relay.");
registercontrolhelpcmd("trustglinesuggest", NO_OPER, 1, trusts_cmdtrustglinesuggest, "Usage: trustglinesuggest <user@host>\nSuggests glines for the specified hostmask.");
registercontrolhelpcmd("trustspew", NO_OPER, 1, trusts_cmdtrustspew, "Usage: trustspew <#id|name>\nShows currently connected users for the specified trust group.");
}
commandsregistered = 0;
deregistercontrolcmd("trustlist", trusts_cmdtrustlist);
+ deregistercontrolcmd("trustlistrelay", trusts_cmdtrustlist);
deregistercontrolcmd("trustglinesuggest", trusts_cmdtrustglinesuggest);
deregistercontrolcmd("trustspew", trusts_cmdtrustspew);
}