X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=src%2Fproto-p10.c;h=b59635d16fccce13b42e2818e2db0ee11cc912e9;hb=c6fa4522fbe70e132366f56365e88779003a14b2;hp=bb62c0b5c5c1af6f99b73f975f512245794bc36d;hpb=9904260b83596e5e9a8a15eeaa31a0c9007625f9;p=srvx.git diff --git a/src/proto-p10.c b/src/proto-p10.c index bb62c0b..b59635d 100644 --- a/src/proto-p10.c +++ b/src/proto-p10.c @@ -1651,6 +1651,23 @@ static CMD_FUNC(cmd_svsnick) return 1; } +static CMD_FUNC(cmd_time) +{ + extern int clock_skew; + char buf[MAXLEN]; + struct userNode *who; + time_t when; + + who = GetUserH(origin); + if (!who) + return 0; + + when = time(NULL); + strftime(buf, sizeof(buf), "%a %b %d %Y -- %H:%M %z", localtime(&when)); + irc_numeric(who, 391, "%s %lu %d :%s", self->name, now, clock_skew, buf); + return 1; +} + void free_user(struct userNode *user) { @@ -1790,6 +1807,8 @@ init_parse(void) dict_insert(irc_func_dict, TOK_VERSION, cmd_version); dict_insert(irc_func_dict, CMD_ADMIN, cmd_admin); dict_insert(irc_func_dict, TOK_ADMIN, cmd_admin); + dict_insert(irc_func_dict, CMD_TIME, cmd_time); + dict_insert(irc_func_dict, TOK_TIME, cmd_time); /* In P10, DESTRUCT doesn't do anything except be broadcast to servers. * Apparently to obliterate channels from any servers that think they