Handle ACTIONs

master
Curtis McEnroe 2018-08-03 19:17:29 -04:00
parent 6ccaf872fc
commit 674e527b33
No known key found for this signature in database
GPG Key ID: CEA2F97ADCFCD77C
1 changed files with 10 additions and 2 deletions

10
chat.c
View File

@ -333,7 +333,12 @@ static void handlePrivmsg(char *prefix, char *params) {
char *user = prift(&prefix); char *user = prift(&prefix);
shift(&params); shift(&params);
char *mesg = shift(&params); char *mesg = shift(&params);
if (mesg[0] == '\1') {
strsep(&mesg, " ");
uiFmt("* \3%d%s\3 %s", color(user), nick, strsep(&mesg, "\1"));
} else {
uiFmt("<\3%d%s\3> %s", color(user), nick, mesg); uiFmt("<\3%d%s\3> %s", color(user), nick, mesg);
}
} }
static void handleNotice(char *prefix, char *params) { static void handleNotice(char *prefix, char *params) {
char *nick = prift(&prefix); char *nick = prift(&prefix);
@ -423,7 +428,10 @@ static void webirc(const char *pass) {
const char *ssh = getenv("SSH_CLIENT"); const char *ssh = getenv("SSH_CLIENT");
if (!ssh) return; if (!ssh) return;
int len = strchrnul(ssh, ' ') - ssh; int len = strchrnul(ssh, ' ') - ssh;
clientFmt("WEBIRC %s %s %.*s %.*s\r\n", pass, client.nick, len, ssh, len, ssh); clientFmt(
"WEBIRC %s %s %.*s %.*s\r\n",
pass, client.nick, len, ssh, len, ssh
);
} }
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {