comparison src/protocols/oscar/oscar.c @ 10565:3b66a8f25bad

[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 <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Wed, 02 Feb 2005 00:07:18 +0000
parents 3e2cd3fe8897
children 54f7939df8e3
comparison
equal deleted inserted replaced
10564:cdeb727d1de3 10565:3b66a8f25bad
509 *msglen_int = msglen; 509 *msglen_int = msglen;
510 return; 510 return;
511 } 511 }
512 512
513 /* 513 /*
514 * If we're sending to an ICQ user, and they are advertising the 514 * If we're sending to an ICQ user, and they are in our
515 * Unicode capability, then attempt to send as UCS-2BE. 515 * buddy list, and they are advertising the Unicode
516 * capability, and they are online, then attempt to send
517 * as UCS-2BE.
516 */ 518 */
517 if ((destsn != NULL) && aim_sn_is_icq(destsn)) 519 if ((destsn != NULL) && aim_sn_is_icq(destsn))
518 userinfo = aim_locate_finduserinfo(od->sess, destsn); 520 userinfo = aim_locate_finduserinfo(od->sess, destsn);
519 521
520 if ((userinfo != NULL) && (userinfo->capabilities & AIM_CAPS_ICQUTF8)) { 522 if ((userinfo != NULL) && (userinfo->capabilities & AIM_CAPS_ICQUTF8))
521 *msg = g_convert(from, strlen(from), "UCS-2BE", "UTF-8", NULL, &msglen, NULL); 523 {
522 if (*msg != NULL) { 524 GaimBuddy *b;
523 *charset = AIM_CHARSET_UNICODE; 525 b = gaim_find_buddy(account, destsn);
524 *charsubset = 0x0000; 526 if ((b != NULL) && (GAIM_BUDDY_IS_ONLINE(b)))
525 *msglen_int = msglen; 527 {
526 return; 528 *msg = g_convert(from, strlen(from), "UCS-2BE", "UTF-8", NULL, &msglen, NULL);
529 if (*msg != NULL)
530 {
531 *charset = AIM_CHARSET_UNICODE;
532 *charsubset = 0x0000;
533 *msglen_int = msglen;
534 return;
535 }
527 } 536 }
528 } 537 }
529 538
530 /* 539 /*
531 * If this is AIM then attempt to send as ISO-8859-1. If this is 540 * If this is AIM then attempt to send as ISO-8859-1. If this is