[gaim-migrate @ 11947]

Wed, 02 Feb 2005 00:07:18 +0000

author
Magnus Hult
date
Wed, 02 Feb 2005 00:07:18 +0000
changeset 10565
50678b6fdedb
parent 10564
1ee5ae99711d
child 10566
b681d2b3dec5

[gaim-migrate @ 11947]
sf patch #1112296, from Magnus Hult
Send ICQ offline messages as the user-specified character encoding
instead of UCS-2BE.

committer: Mark Doliner <markdoliner@pidgin.im>

src/protocols/oscar/oscar.c file | annotate | diff | comparison | revisions
--- 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;
+			}
 		}
 	}
 

mercurial