aboutsummaryrefslogtreecommitdiff
path: root/src/cmd.c
blob: 89d8c4ca4b981b6cb176b101407a72ed90d1155a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <atari.h>
#include <stdio.h>
#include "irc.h"
#include "addrs.h"
#include "screen.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 scr_print_current("*** You are not on a channel\n");
}

void cmd_execute(void) {
	cmd_command(edit_box);
}