From b7b86e3a26d4bfba9c49f0a24ec030a7b3ebd8a3 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Wed, 11 Feb 2026 13:26:57 -0500 Subject: initial commit --- src/cmd.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/cmd.c (limited to 'src/cmd.c') diff --git a/src/cmd.c b/src/cmd.c new file mode 100644 index 0000000..3c7f482 --- /dev/null +++ b/src/cmd.c @@ -0,0 +1,19 @@ +#include +#include +#include "irc.h" + +void cmd_chan_text(const char *cmd) { + txbuf_set_str("PRIVMSG "); + txbuf_append_str(channel); + txbuf_append_str(" :"); + txbuf_append_str(cmd); + txbuf_send(); +} + +void cmd_command(const char *cmd) { + if(*cmd == '/') + txbuf_send_str(cmd + 1); + else if(channel[0]) + cmd_chan_text(cmd); + else ui_print("*** You are not on a channel\n"); +} -- cgit v1.2.3