aboutsummaryrefslogtreecommitdiff
path: root/kike.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-06-07 00:53:11 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2015-06-07 01:23:52 +0200
commitfc09c392c9bceb9750888d1455d8246ba01ee7a8 (patch)
tree088fcdaabf167110fb671c70f0eb005a29c2ee9b /kike.c
parentf8d26c2f18644a560e04961716c561153f16242d (diff)
downloadxK-fc09c392c9bceb9750888d1455d8246ba01ee7a8.tar.gz
xK-fc09c392c9bceb9750888d1455d8246ba01ee7a8.tar.xz
xK-fc09c392c9bceb9750888d1455d8246ba01ee7a8.zip
kike: implement RPL_CREATIONTIME
Since it's trivial.
Diffstat (limited to 'kike.c')
-rw-r--r--kike.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kike.c b/kike.c
index a197c5c..5c3dfd9 100644
--- a/kike.c
+++ b/kike.c
@@ -404,6 +404,7 @@ struct channel
unsigned modes; ///< Channel modes
char *key; ///< Channel key
long user_limit; ///< User limit or -1
+ time_t created; ///< Creation time
char *topic; ///< Channel topic
@@ -669,6 +670,7 @@ irc_channel_create (struct server_context *ctx, const char *name)
struct channel *chan = channel_new ();
chan->ctx = ctx;
chan->name = xstrdup (name);
+ chan->created = time (NULL);
str_map_set (&ctx->channels, name, chan);
return chan;
}
@@ -1714,6 +1716,8 @@ irc_handle_mode (const struct irc_message *msg, struct client *c)
{
char *mode = channel_get_mode (chan, channel_get_user (chan, c));
irc_send_reply (c, IRC_RPL_CHANNELMODEIS, target, mode);
+ irc_send_reply (c, IRC_RPL_CREATIONTIME,
+ target, (long long) chan->created);
free (mode);
}
else