src/oscar.c

changeset 1887
fcc948152c54
parent 1881
bcd5d457cdbb
child 1899
a7dc5427297e
--- a/src/oscar.c	Thu May 24 01:03:40 2001 +0000
+++ b/src/oscar.c	Thu May 24 08:24:48 2001 +0000
@@ -2486,6 +2486,8 @@
 	GSList *bcs = g->buddy_chats;
 	struct conversation *b = NULL;
 	struct chat_connection *c = NULL;
+	char *buf;
+	int i, j;
 
 	while (bcs) {
 		b = (struct conversation *)bcs->data;
@@ -2508,7 +2510,20 @@
 	if (!c)
 		return;
 
-	aim_chat_send_im(odata->sess, c->conn, 0, message, strlen(message));
+	buf = g_malloc(strlen(message) * 4 + 1);
+	for (i = 0, j = 0; i < strlen(message); i++) {
+		if (message[i] == '\n') {
+			buf[j++] = '<';
+			buf[j++] = 'B';
+			buf[j++] = 'R';
+			buf[j++] = '>';
+		} else {
+			buf[j++] = message[i];
+		}
+	}
+	buf[j] = '\0';
+	aim_chat_send_im(odata->sess, c->conn, 0, buf, strlen(buf));
+	g_free(buf);
 }
 
 static char **oscar_list_icon(int uc) {

mercurial