# HG changeset patch # User Mark Doliner # Date 1046677435 0 # Node ID 94635db7c6af3be8e8d306cc87d3ff70a1838306 # Parent 951204c08b13ea7ae05a8c38b1fd3eb67d1e05da [gaim-migrate @ 4951] I introduced a bug with my extended ICQ info that caused AIM unicode messages to get dropped. This fixes that. I am such a clumsy American. Oh, thanks a bunch to cool people for helping me test this. committer: Tailor Script diff -r 951204c08b13 -r 94635db7c6af src/protocols/oscar/bstream.c --- a/src/protocols/oscar/bstream.c Sun Mar 02 23:47:37 2003 +0000 +++ b/src/protocols/oscar/bstream.c Mon Mar 03 07:43:55 2003 +0000 @@ -231,15 +231,9 @@ return NULL; } - if (ob[0] == '\0') { - free(ob); - return NULL; - } - ob[len] = '\0'; - return ob; -} + return ob;} faim_internal int aimbs_putraw(aim_bstream_t *bs, const fu8_t *v, int len) { diff -r 951204c08b13 -r 94635db7c6af src/protocols/oscar/oscar.c --- a/src/protocols/oscar/oscar.c Sun Mar 02 23:47:37 2003 +0000 +++ b/src/protocols/oscar/oscar.c Mon Mar 03 07:43:55 2003 +0000 @@ -2016,7 +2016,7 @@ if (!args->msg || !args->msglen) return 1; - + tmp = g_convert(args->msg, args->msglen, "UTF-8", "UCS-2BE", NULL, &convlen, &err); if (err) { debug_printf("Unicode IM conversion: %s\n", err->message); @@ -3520,26 +3520,27 @@ g_snprintf(who, sizeof(who), "%lu", info->uin); buf = g_strdup_printf("UIN: %s", who); - if (info->nick) { + if (info->nick && info->nick[0]) { tmp = buf; buf = g_strconcat(tmp, "\n
Nick: ", info->nick, NULL); g_free(tmp); serv_got_alias(gc, who, info->nick); } - if (info->first) { + if (info->first && info->first[0]) { tmp = buf; buf = g_strconcat(tmp, "\n
First Name: ", info->first, NULL); g_free(tmp); } - if (info->last) { + if (info->last && info->last[0]) { tmp = buf; buf = g_strconcat(tmp, "\n
Last Name: ", info->last, NULL); g_free(tmp); } - if (info->email) { + if (info->email && info->email[0]) { tmp = buf; buf = g_strconcat(tmp, "\n
Email Address: email, "\">", info->email, "", NULL); g_free(tmp); } if (info->numaddresses && info->email2) { int i; for (i = 0; i < info->numaddresses; i++) { + if (info->email2[i] && info->email2[i][0]) tmp = buf; buf = g_strconcat(tmp, "\n
Email Address: email2[i], "\">", info->email2[i], "", NULL); g_free(tmp); } } - if (info->mobile) { + if (info->mobile && info->mobile[0]) { tmp = buf; buf = g_strconcat(tmp, "\n
Mobile Phone: ", info->mobile, NULL); g_free(tmp); } if (info->gender) { @@ -3559,57 +3560,57 @@ snprintf(age, sizeof(age), "%hhd", info->age); tmp = buf; buf = g_strconcat(tmp, "\n
Age: ", age, NULL); g_free(tmp); } - if (info->personalwebpage) { + if (info->personalwebpage && info->personalwebpage[0]) { tmp = buf; buf = g_strconcat(tmp, "\n
Personal Web Page: personalwebpage, "\">", info->personalwebpage, "", NULL); g_free(tmp); } - if (info->info) { + if (info->info && info->info[0]) { tmp = buf; buf = g_strconcat(tmp, "
Additional Information:
", info->info, NULL); g_free(tmp); } tmp = buf; buf = g_strconcat(tmp, "
\n", NULL); g_free(tmp); - if (info->homeaddr || info->homecity || info->homestate || info->homezip) { + if ((info->homeaddr && (info->homeaddr[0])) || (info->homecity && info->homecity[0]) || (info->homestate && info->homestate[0]) || (info->homezip && info->homezip[0])) { tmp = buf; buf = g_strconcat(tmp, "Home Address:", NULL); g_free(tmp); - if (info->homeaddr) { + if (info->homeaddr && info->homeaddr[0]) { tmp = buf; buf = g_strconcat(tmp, "\n
Address: ", info->homeaddr, NULL); g_free(tmp); } - if (info->homecity) { + if (info->homecity && info->homecity[0]) { tmp = buf; buf = g_strconcat(tmp, "\n
City: ", info->homecity, NULL); g_free(tmp); } - if (info->homestate) { + if (info->homestate && info->homestate[0]) { tmp = buf; buf = g_strconcat(tmp, "\n
State: ", info->homestate, NULL); g_free(tmp); } - if (info->homezip) { + if (info->homezip && info->homezip[0]) { tmp = buf; buf = g_strconcat(tmp, "\n
Zip Code: ", info->homezip, NULL); g_free(tmp); } tmp = buf; buf = g_strconcat(tmp, "\n
\n", NULL); g_free(tmp); } - if (info->workaddr || info->workcity || info->workstate || info->workzip) { + if ((info->workaddr && info->workaddr[0]) || (info->workcity && info->workcity[0]) || (info->workstate && info->workstate[0]) || (info->workzip && info->workzip[0])) { tmp = buf; buf = g_strconcat(tmp, "Work Address:", NULL); g_free(tmp); - if (info->workaddr) { + if (info->workaddr && info->workaddr[0]) { tmp = buf; buf = g_strconcat(tmp, "\n
Address: ", info->workaddr, NULL); g_free(tmp); } - if (info->workcity) { + if (info->workcity && info->workcity[0]) { tmp = buf; buf = g_strconcat(tmp, "\n
City: ", info->workcity, NULL); g_free(tmp); } - if (info->workstate) { + if (info->workstate && info->workstate[0]) { tmp = buf; buf = g_strconcat(tmp, "\n
State: ", info->workstate, NULL); g_free(tmp); } - if (info->workzip) { + if (info->workzip && info->workzip[0]) { tmp = buf; buf = g_strconcat(tmp, "\n
Zip Code: ", info->workzip, NULL); g_free(tmp); } tmp = buf; buf = g_strconcat(tmp, "\n
\n", NULL); g_free(tmp); } - if (info->workcompany || info->workdivision || info->workposition || info->workwebpage) { + if ((info->workcompany && info->workcompany[0]) || (info->workdivision && info->workdivision[0]) || (info->workposition && info->workposition[0]) || (info->workwebpage && info->workwebpage[0])) { tmp = buf; buf = g_strconcat(tmp, "Work Information:", NULL); g_free(tmp); - if (info->workcompany) { + if (info->workcompany && info->workcompany[0]) { tmp = buf; buf = g_strconcat(tmp, "\n
Company: ", info->workcompany, NULL); g_free(tmp); } - if (info->workdivision) { + if (info->workdivision && info->workdivision[0]) { tmp = buf; buf = g_strconcat(tmp, "\n
Division: ", info->workdivision, NULL); g_free(tmp); } - if (info->workposition) { + if (info->workposition && info->workposition[0]) { tmp = buf; buf = g_strconcat(tmp, "\n
Position: ", info->workposition, NULL); g_free(tmp); } - if (info->workwebpage) { + if (info->workwebpage && info->workwebpage[0]) { tmp = buf; buf = g_strconcat(tmp, "\n
Web Page: workwebpage, "\">", info->workwebpage, "", NULL); g_free(tmp); } tmp = buf; buf = g_strconcat(tmp, "\n
\n", NULL); g_free(tmp);