#include "command.h"
#include "client.h"

void cmd_mode(struct client* c, struct token* p, int n) {
  if(!n) {
    client_reply_start(c, "461");
    client_puts(c, ":Not enough parameters\r\n");
  }
  else if(p[0].s[0] == '#') {
    client_reply_start(c, "324");
    client_put(c, p[0].s, p[0].len);
    client_puts(c, " +tn \r\n");
  }
  else {
    client_reply_start(c, "221");
    client_puts(c, "+\r\n");
  }
}
