From f66c701e85ed9febdd065d0fd5808be3e8af6811 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 21 May 2006 21:55:52 +0200 Subject: Modified oscar.c headers. --- protocols/oscar/oscar.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'protocols/oscar/oscar.c') diff --git a/protocols/oscar/oscar.c b/protocols/oscar/oscar.c index 53da1e27..fecc11c0 100644 --- a/protocols/oscar/oscar.c +++ b/protocols/oscar/oscar.c @@ -1,6 +1,8 @@ /* * gaim * + * Some code copyright (C) 2002-2006, Jelmer Vernooij + * and the BitlBee team. * Some code copyright (C) 1998-1999, Mark Spencer * libfaim code copyright 1998, 1999 Adam Fritzler * -- cgit v1.2.3 From 73cf7fd5f066d3c0720f58af840affa3e61bad12 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Mon, 22 May 2006 11:11:49 +0200 Subject: Trying to fix charset issues with outgoing AIM chat messages. --- protocols/oscar/oscar.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'protocols/oscar/oscar.c') diff --git a/protocols/oscar/oscar.c b/protocols/oscar/oscar.c index fecc11c0..4e75fe0a 100644 --- a/protocols/oscar/oscar.c +++ b/protocols/oscar/oscar.c @@ -2501,6 +2501,7 @@ int oscar_chat_send(struct gaim_connection * gc, int id, char *message) struct chat_connection * ccon; int ret; guint8 len = strlen(message); + guint16 flags; char *s; if(!(ccon = find_oscar_chat(gc, id))) @@ -2509,15 +2510,19 @@ int oscar_chat_send(struct gaim_connection * gc, int id, char *message) for (s = message; *s; s++) if (*s & 128) break; - + + flags = AIM_CHATFLAGS_NOREFLECT; + /* Message contains high ASCII chars, time for some translation! */ if (*s) { s = g_malloc(BUF_LONG); /* Try if we can put it in an ISO8859-1 string first. If we can't, fall back to UTF16. */ if ((ret = do_iconv("UTF-8", "ISO8859-1", message, s, len, BUF_LONG)) >= 0) { + flags |= AIM_CHATFLAGS_ISO_8859_1; len = ret; } else if ((ret = do_iconv("UTF-8", "UNICODEBIG", message, s, len, BUF_LONG)) >= 0) { + flags |= AIM_CHATFLAGS_UNICODE; len = ret; } else { /* OOF, translation failed... Oh well.. */ @@ -2528,7 +2533,7 @@ int oscar_chat_send(struct gaim_connection * gc, int id, char *message) s = message; } - ret = aim_chat_send_im(od->sess, ccon->conn, AIM_CHATFLAGS_NOREFLECT, s, len); + ret = aim_chat_send_im(od->sess, ccon->conn, flags, s, len); if (s != message) { g_free(s); -- cgit v1.2.3 From fc630f9fb47690c30feaf4738727a213d633afc9 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Tue, 23 May 2006 10:31:04 +0200 Subject: Silenced all compiler warnings that appeared after previous commit. --- protocols/oscar/oscar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'protocols/oscar/oscar.c') diff --git a/protocols/oscar/oscar.c b/protocols/oscar/oscar.c index 4e75fe0a..5174f95c 100644 --- a/protocols/oscar/oscar.c +++ b/protocols/oscar/oscar.c @@ -384,7 +384,7 @@ static void oscar_login(struct aim_user *user) { if (g_strcasecmp(user->proto_opt[USEROPT_AUTH], "login.icq.com") != 0 && g_strcasecmp(user->proto_opt[USEROPT_AUTH], "login.oscar.aol.com") != 0) { - serv_got_crap(gc, "Warning: Unknown OSCAR server: `%s'. Please review your configuration if the connection fails."); + serv_got_crap(gc, "Warning: Unknown OSCAR server: `%s'. Please review your configuration if the connection fails.",user->proto_opt[USEROPT_AUTH]); } g_snprintf(buf, sizeof(buf), _("Signon: %s"), gc->username); -- cgit v1.2.3 From 936ded65a76dac7a7af56ef3f1ad6c84a32270c6 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Thu, 25 May 2006 10:57:31 +0200 Subject: Disabling chat charset stuff again for now and fixed the crash-bug. Unfortunately I can't figure out how to generate chat names that don't break old BitlBees. --- protocols/oscar/oscar.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'protocols/oscar/oscar.c') diff --git a/protocols/oscar/oscar.c b/protocols/oscar/oscar.c index 5174f95c..c2716c6b 100644 --- a/protocols/oscar/oscar.c +++ b/protocols/oscar/oscar.c @@ -137,9 +137,9 @@ static char *extract_name(const char *name) { char *tmp; int i, j; char *x = strchr(name, '-'); - if (!x) return NULL; + if (!x) return g_strdup(name); x = strchr(++x, '-'); - if (!x) return NULL; + if (!x) return g_strdup(name); tmp = g_strdup(++x); for (i = 0, j = 0; x[i]; i++) { @@ -2606,9 +2606,9 @@ int oscar_chat_open(struct gaim_connection * gc, char *who) struct oscar_data * od = (struct oscar_data *)gc->proto_data; int ret; static int chat_id = 0; - char * chatname = g_new0(char, strlen(gc->username)+4); + char * chatname; - g_snprintf(chatname, strlen(gc->username) + 4, "%s%d", gc->username, chat_id++); + chatname = g_strdup_printf("%s%d", gc->username, chat_id++); ret = oscar_chat_join(gc, chatname); -- cgit v1.2.3