summaryrefslogtreecommitdiff
path: root/degesch.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2016-01-31 20:06:45 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2016-01-31 21:43:23 +0100
commit10a264ec3d189ba0fc00e4c6f7b0e7e4a8043aff (patch)
treef6c260517176021690268a8e88d9bb4c5a409d6c /degesch.c
parent2ec6258ff38747b72f55a0d19370dd5841e3be02 (diff)
downloadxK-10a264ec3d189ba0fc00e4c6f7b0e7e4a8043aff.tar.gz
xK-10a264ec3d189ba0fc00e4c6f7b0e7e4a8043aff.tar.xz
xK-10a264ec3d189ba0fc00e4c6f7b0e7e4a8043aff.zip
kike: add support for IRCv3.2 server-time
Diffstat (limited to 'degesch.c')
-rw-r--r--degesch.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/degesch.c b/degesch.c
index 59a5675..26f0065 100644
--- a/degesch.c
+++ b/degesch.c
@@ -3144,6 +3144,7 @@ log_formatter (struct app_context *ctx,
// Move the formatter inside
struct buffer_line *line = buffer_line_new (f);
line->flags = flags;
+ // TODO: allow providing custom time (IRCv3.2 server-time)
line->when = time (NULL);
buffer_pop_excess_lines (ctx, buffer);
@@ -5474,6 +5475,7 @@ irc_handle_cap (struct server *s, const struct irc_message *msg)
const char *cap = v.vector[i];
if (!strcasecmp_ascii (cap, "multi-prefix")
|| !strcasecmp_ascii (cap, "invite-notify")
+ || !strcasecmp_ascii (cap, "server-time")
|| !strcasecmp_ascii (cap, "echo-message"))
str_vector_add (&chosen, cap);
}
@@ -6827,6 +6829,9 @@ irc_process_numeric (struct server *s,
static void
irc_process_message (const struct irc_message *msg, struct server *s)
{
+ // TODO: make use of IRCv3.2 server-time (with fallback to unixtime_msec())
+ // -> change all calls to log_{server,nick,outcoming,ctcp}*() to take
+ // an extra argument specifying time
struct irc_handler key = { .name = msg->command };
struct irc_handler *handler = bsearch (&key, g_irc_handlers,
N_ELEMENTS (g_irc_handlers), sizeof key, irc_handler_cmp_by_name);