# HG changeset patch # User Mark Doliner # Date 1107302838 0 # Node ID 3b66a8f25bad348f428acc0ca372db2ef2899d68 # Parent cdeb727d1de3f7c26e047181682f0e7d17ef8408 [gaim-migrate @ 11947] sf patch #1112296, from Magnus Hult Send ICQ offline messages as the user-specified character encoding instead of UCS-2BE. committer: Tailor Script diff -r cdeb727d1de3 -r 3b66a8f25bad src/protocols/oscar/oscar.c --- a/src/protocols/oscar/oscar.c Tue Feb 01 16:13:09 2005 +0000 +++ b/src/protocols/oscar/oscar.c Wed Feb 02 00:07:18 2005 +0000 @@ -511,19 +511,28 @@ } /* - * If we're sending to an ICQ user, and they are advertising the - * Unicode capability, then attempt to send as UCS-2BE. + * If we're sending to an ICQ user, and they are in our + * buddy list, and they are advertising the Unicode + * capability, and they are online, then attempt to send + * as UCS-2BE. */ if ((destsn != NULL) && aim_sn_is_icq(destsn)) userinfo = aim_locate_finduserinfo(od->sess, destsn); - if ((userinfo != NULL) && (userinfo->capabilities & AIM_CAPS_ICQUTF8)) { - *msg = g_convert(from, strlen(from), "UCS-2BE", "UTF-8", NULL, &msglen, NULL); - if (*msg != NULL) { - *charset = AIM_CHARSET_UNICODE; - *charsubset = 0x0000; - *msglen_int = msglen; - return; + if ((userinfo != NULL) && (userinfo->capabilities & AIM_CAPS_ICQUTF8)) + { + GaimBuddy *b; + b = gaim_find_buddy(account, destsn); + if ((b != NULL) && (GAIM_BUDDY_IS_ONLINE(b))) + { + *msg = g_convert(from, strlen(from), "UCS-2BE", "UTF-8", NULL, &msglen, NULL); + if (*msg != NULL) + { + *charset = AIM_CHARSET_UNICODE; + *charsubset = 0x0000; + *msglen_int = msglen; + return; + } } }