Attempt to show ansi chars in messages

This commit is contained in:
Andrew Pamment 2016-04-22 14:36:53 +10:00
parent bf743d1184
commit 973d4e63f4

View File

@ -719,6 +719,7 @@ void read_message(int socket, struct user_record *user, struct msg_headers *msgh
int doquit = 0;
int skip_line = 0;
int chars = 0;
int ansi;
jb = open_jam_base(conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->path);
if (!jb) {
@ -816,8 +817,14 @@ void read_message(int socket, struct user_record *user, struct msg_headers *msgh
s_putstring(socket, "\e[7;1H\e[0J");
}
} else if (body[z] == '\e' && body[z + 1] == '[') {
ansi = z;
while (strchr("ABCDEFGHIGJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", body[z]) == NULL)
z++;
if (body[z] == 'm' || body[z] == 'C') {
strncpy(buffer, &body[ansi], ansi - z);
buffer[ansi-z] = '\0';
s_putstring(socket, buffer);
}
} else {
chars++;
s_putchar(socket, body[z]);