degesch: stub IRC command handlers

This commit is contained in:
Přemysl Eric Janouch 2015-04-17 22:45:58 +02:00
parent 0d63e59beb
commit 511c56d2fc
1 changed files with 71 additions and 2 deletions

View File

@ -1473,6 +1473,48 @@ irc_to_utf8 (struct app_context *ctx, const char *text)
return iconv_xstrdup (ctx->latin1_to_utf8, (char *) text, len, NULL); return iconv_xstrdup (ctx->latin1_to_utf8, (char *) text, len, NULL);
} }
static void
irc_handle_join (struct app_context *ctx, const struct irc_message *msg)
{
// TODO: if the user is us, create a new buffer and activate it.
// TODO: log a message
}
static void
irc_handle_kick (struct app_context *ctx, const struct irc_message *msg)
{
// TODO: remove user from the channel
// TODO: log a message
}
static void
irc_handle_mode (struct app_context *ctx, const struct irc_message *msg)
{
// TODO: parse the mode change and apply it
// TODO: log a message
}
static void
irc_handle_nick (struct app_context *ctx, const struct irc_message *msg)
{
// TODO: rename the user in all relevant channels
// TODO: if it's us, rename ourselves
// TODO: log a message in all relevant channels
}
static void
irc_handle_notice (struct app_context *ctx, const struct irc_message *msg)
{
// TODO: log a message
}
static void
irc_handle_part (struct app_context *ctx, const struct irc_message *msg)
{
// TODO: remove user from the channel
// TODO: log a message
}
static void static void
irc_handle_ping (struct app_context *ctx, const struct irc_message *msg) irc_handle_ping (struct app_context *ctx, const struct irc_message *msg)
{ {
@ -1482,6 +1524,25 @@ irc_handle_ping (struct app_context *ctx, const struct irc_message *msg)
irc_send (ctx, "PONG"); irc_send (ctx, "PONG");
} }
static void
irc_handle_privmsg (struct app_context *ctx, const struct irc_message *msg)
{
// TODO: log a message
}
static void
irc_handle_quit (struct app_context *ctx, const struct irc_message *msg)
{
// TODO: remove user from all channels
// TODO: log a message
}
static void
irc_handle_topic (struct app_context *ctx, const struct irc_message *msg)
{
// TODO: log a message
}
static struct irc_handler static struct irc_handler
{ {
char *name; char *name;
@ -1490,8 +1551,16 @@ static struct irc_handler
g_irc_handlers[] = g_irc_handlers[] =
{ {
// This list needs to stay sorted // This list needs to stay sorted
// TODO: handle as much as we can { "JOIN", irc_handle_join },
{ "PING", irc_handle_ping }, { "KICK", irc_handle_kick },
{ "MODE", irc_handle_mode },
{ "NICK", irc_handle_nick },
{ "NOTICE", irc_handle_notice },
{ "PART", irc_handle_part },
{ "PING", irc_handle_ping },
{ "PRIVMSG", irc_handle_privmsg },
{ "QUIT", irc_handle_quit },
{ "TOPIC", irc_handle_topic },
}; };
static int static int