# HG changeset patch # User Mark Doliner # Date 1046417357 0 # Node ID 819ba05f5b1b823b1cb5cdbbd7fae72b4f0e1f94 # Parent a964972cb361b5b7fd2cdcd53a8233abe904084a [gaim-migrate @ 4916] This fixes some problems with gender, in that, if someone specified either male of female, Gaim would always show "Age: Female," which isn't exactly right. Gender?! I don't even know her! I also made bunches of email addresses show up, and made them show up as mailto: links. I guess these will just get passed to your browser. And I fixed the UIN field. That was a dumb mistake. So aliases should update themselves better now. Still not automagically, though. Oh, and I made the day show up as MM/DD/YY instead of DD/MM/YY. For a second there I thought I was in a different country, but I safe and sound now, back in good old 1955. committer: Tailor Script diff -r a964972cb361 -r 819ba05f5b1b src/protocols/oscar/aim.h --- a/src/protocols/oscar/aim.h Fri Feb 28 04:26:37 2003 +0000 +++ b/src/protocols/oscar/aim.h Fri Feb 28 07:29:17 2003 +0000 @@ -1293,7 +1293,7 @@ /* email (0x00eb) */ fu16_t numaddresses; - char *email2; + char **email2; /* we keep track of these in a linked list because we're 1337 */ struct aim_icq_info *next; diff -r a964972cb361 -r 819ba05f5b1b src/protocols/oscar/icq.c --- a/src/protocols/oscar/icq.c Fri Feb 28 04:26:37 2003 +0000 +++ b/src/protocols/oscar/icq.c Fri Feb 28 07:29:17 2003 +0000 @@ -147,7 +147,7 @@ /* Keep track of this request and the ICQ number and request ID */ info = (struct aim_icq_info *)calloc(1, sizeof(struct aim_icq_info)); info->reqid = snacid; - info->uin = atoi(sess->sn); + info->uin = atoi(uin); info->next = sess->icq_info; sess->icq_info = info; @@ -230,6 +230,8 @@ } static void aim_icq_freeinfo(struct aim_icq_info *info) { + int i; + if (!info) return; free(info->nick); @@ -244,6 +246,9 @@ free(info->mobile); free(info->homezip); free(info->personalwebpage); + if (info->email2) + for (i = 0; i < info->numaddresses; i++) + free(info->email2[i]); free(info->email2); free(info->workcity); free(info->workstate); @@ -349,8 +354,9 @@ info->mobile = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); info->homezip = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); info->homecountry = aimbs_getle16(&qbs); - /* 1 byte timezone */ - /* 1 byte hide email flag */ + /* 0x0a 00 02 00 */ + /* 1 byte timezone? */ + /* 1 byte hide email flag? */ } break; case 0x00dc: { /* personal information */ @@ -364,9 +370,9 @@ info->language1 = aimbs_getle8(&qbs); info->language2 = aimbs_getle8(&qbs); info->language3 = aimbs_getle8(&qbs); + /* 0x00 00 01 00 00 01 00 00 00 00 00 */ } break; - /* XXX - Look into the webpage thing for this, too */ case 0x00d2: { /* work information */ info->workcity = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); info->workstate = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); @@ -378,7 +384,7 @@ info->workcompany = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); info->workdivision = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); info->workposition = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); - aim_bstream_advance(&qbs, 2); /* Number of webpage addresses? */ + aim_bstream_advance(&qbs, 2); /* 0x01 00 */ info->workwebpage = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); } break; @@ -386,10 +392,15 @@ info->info = aimbs_getstr(&qbs, aimbs_getle16(&qbs)-1); } break; - /* XXX - Find out the structure of this. Probably make a 2d array of strings */ case 0x00eb: { /* email address(es) */ + int i; info->numaddresses = aimbs_getle16(&qbs); - info->email2 = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); + info->email2 = (char **)calloc(info->numaddresses, sizeof(char *)); + for (i = 0; i < info->numaddresses; i++) { + info->email2[i] = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); + if (i+1 != info->numaddresses) + aim_bstream_advance(&qbs, 1); /* 0x00 */ + } } break; case 0x00f0: { /* personal interests */ @@ -399,6 +410,7 @@ } break; case 0x010e: { /* unknown */ + /* 0x00 00 */ } break; case 0x019a: { /* simple info */ diff -r a964972cb361 -r 819ba05f5b1b src/protocols/oscar/oscar.c --- a/src/protocols/oscar/oscar.c Fri Feb 28 04:26:37 2003 +0000 +++ b/src/protocols/oscar/oscar.c Fri Feb 28 07:29:17 2003 +0000 @@ -3531,14 +3531,23 @@ tmp = buf; buf = g_strconcat(tmp, "\n
Last Name: ", info->last, NULL); g_free(tmp); } if (info->email) { - tmp = buf; buf = g_strconcat(tmp, "\n
Email Address: ", info->email, NULL); g_free(tmp); + 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++) { + tmp = buf; buf = g_strconcat(tmp, "\n
Email Address: email2[i], "\">", info->email2[i], "", NULL); g_free(tmp); + } } if (info->mobile) { - tmp = buf; buf = g_strconcat(tmp, "\n
Mobile: ", info->mobile, NULL); g_free(tmp); + tmp = buf; buf = g_strconcat(tmp, "\n
Mobile Phone: ", info->mobile, NULL); g_free(tmp); + } + if (info->gender) { + tmp = buf; buf = g_strconcat(tmp, "\n
Gender: ", info->gender==1 ? "Female" : "Male", NULL); g_free(tmp); } if (info->birthyear || info->birthmonth || info->birthday) { char date[15]; - snprintf(date, sizeof(date), "%hhd/%hhd/%hd", info->birthday, info->birthmonth, info->birthyear); + snprintf(date, sizeof(date), "%hhd/%hhd/%hd", info->birthmonth, info->birthday, info->birthyear); tmp = buf; buf = g_strconcat(tmp, "\n
Birthday: ", date, NULL); g_free(tmp); } if (info->age) { @@ -3546,9 +3555,6 @@ snprintf(age, sizeof(age), "%hhd", info->age); tmp = buf; buf = g_strconcat(tmp, "\n
Age: ", age, NULL); g_free(tmp); } - if (info->gender) { - tmp = buf; buf = g_strconcat(tmp, "\n
Age: ", info->gender ? "Male" : "Female", NULL); g_free(tmp); - } if (info->personalwebpage) { tmp = buf; buf = g_strconcat(tmp, "\n
Personal Web Page: personalwebpage, "\">", info->personalwebpage, "", NULL); g_free(tmp); }