diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2015-04-17 22:45:58 +0200 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2015-04-17 22:53:35 +0200 |
commit | 511c56d2fc933c8cbcbc46c1c1cdc338986194bd (patch) | |
tree | 074d4954a4f5fa4a2707bd51dd51d8eeec81c523 | |
parent | 0d63e59beb5d1dd1f6b47f1c61a356f89eae77ee (diff) | |
download | xK-511c56d2fc933c8cbcbc46c1c1cdc338986194bd.tar.gz xK-511c56d2fc933c8cbcbc46c1c1cdc338986194bd.tar.xz xK-511c56d2fc933c8cbcbc46c1c1cdc338986194bd.zip |
degesch: stub IRC command handlers
-rw-r--r-- | degesch.c | 73 |
1 files changed, 71 insertions, 2 deletions
@@ -1474,6 +1474,48 @@ irc_to_utf8 (struct app_context *ctx, const char *text) } 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 irc_handle_ping (struct app_context *ctx, const struct irc_message *msg) { if (msg->params.len) @@ -1482,6 +1524,25 @@ irc_handle_ping (struct app_context *ctx, const struct irc_message *msg) 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 { char *name; @@ -1490,8 +1551,16 @@ static struct irc_handler g_irc_handlers[] = { // This list needs to stay sorted - // TODO: handle as much as we can - { "PING", irc_handle_ping }, + { "JOIN", irc_handle_join }, + { "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 |