src/protocols/oscar/icq.c

changeset 4625
f5b87130e1c4
parent 4624
8bf85f27e60c
child 4664
1f5d72a07e64
equal deleted inserted replaced
4624:8bf85f27e60c 4625:f5b87130e1c4
145 aim_tx_enqueue(sess, fr); 145 aim_tx_enqueue(sess, fr);
146 146
147 /* Keep track of this request and the ICQ number and request ID */ 147 /* Keep track of this request and the ICQ number and request ID */
148 info = (struct aim_icq_info *)calloc(1, sizeof(struct aim_icq_info)); 148 info = (struct aim_icq_info *)calloc(1, sizeof(struct aim_icq_info));
149 info->reqid = snacid; 149 info->reqid = snacid;
150 info->uin = atoi(sess->sn); 150 info->uin = atoi(uin);
151 info->next = sess->icq_info; 151 info->next = sess->icq_info;
152 sess->icq_info = info; 152 sess->icq_info = info;
153 153
154 return 0; 154 return 0;
155 } 155 }
228 228
229 return 0; 229 return 0;
230 } 230 }
231 231
232 static void aim_icq_freeinfo(struct aim_icq_info *info) { 232 static void aim_icq_freeinfo(struct aim_icq_info *info) {
233 int i;
234
233 if (!info) 235 if (!info)
234 return; 236 return;
235 free(info->nick); 237 free(info->nick);
236 free(info->first); 238 free(info->first);
237 free(info->last); 239 free(info->last);
242 free(info->homefax); 244 free(info->homefax);
243 free(info->homeaddr); 245 free(info->homeaddr);
244 free(info->mobile); 246 free(info->mobile);
245 free(info->homezip); 247 free(info->homezip);
246 free(info->personalwebpage); 248 free(info->personalwebpage);
249 if (info->email2)
250 for (i = 0; i < info->numaddresses; i++)
251 free(info->email2[i]);
247 free(info->email2); 252 free(info->email2);
248 free(info->workcity); 253 free(info->workcity);
249 free(info->workstate); 254 free(info->workstate);
250 free(info->workphone); 255 free(info->workphone);
251 free(info->workfax); 256 free(info->workfax);
347 info->homefax = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); 352 info->homefax = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
348 info->homeaddr = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); 353 info->homeaddr = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
349 info->mobile = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); 354 info->mobile = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
350 info->homezip = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); 355 info->homezip = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
351 info->homecountry = aimbs_getle16(&qbs); 356 info->homecountry = aimbs_getle16(&qbs);
352 /* 1 byte timezone */ 357 /* 0x0a 00 02 00 */
353 /* 1 byte hide email flag */ 358 /* 1 byte timezone? */
359 /* 1 byte hide email flag? */
354 } break; 360 } break;
355 361
356 case 0x00dc: { /* personal information */ 362 case 0x00dc: { /* personal information */
357 info->age = aimbs_getle8(&qbs); 363 info->age = aimbs_getle8(&qbs);
358 info->unknown = aimbs_getle8(&qbs); 364 info->unknown = aimbs_getle8(&qbs);
362 info->birthmonth = aimbs_getle8(&qbs); 368 info->birthmonth = aimbs_getle8(&qbs);
363 info->birthday = aimbs_getle8(&qbs); 369 info->birthday = aimbs_getle8(&qbs);
364 info->language1 = aimbs_getle8(&qbs); 370 info->language1 = aimbs_getle8(&qbs);
365 info->language2 = aimbs_getle8(&qbs); 371 info->language2 = aimbs_getle8(&qbs);
366 info->language3 = aimbs_getle8(&qbs); 372 info->language3 = aimbs_getle8(&qbs);
367 } break; 373 /* 0x00 00 01 00 00 01 00 00 00 00 00 */
368 374 } break;
369 /* XXX - Look into the webpage thing for this, too */ 375
370 case 0x00d2: { /* work information */ 376 case 0x00d2: { /* work information */
371 info->workcity = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); 377 info->workcity = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
372 info->workstate = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); 378 info->workstate = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
373 info->workphone = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); 379 info->workphone = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
374 info->workfax = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); 380 info->workfax = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
376 info->workzip = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); 382 info->workzip = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
377 info->workcountry = aimbs_getle16(&qbs); 383 info->workcountry = aimbs_getle16(&qbs);
378 info->workcompany = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); 384 info->workcompany = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
379 info->workdivision = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); 385 info->workdivision = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
380 info->workposition = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); 386 info->workposition = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
381 aim_bstream_advance(&qbs, 2); /* Number of webpage addresses? */ 387 aim_bstream_advance(&qbs, 2); /* 0x01 00 */
382 info->workwebpage = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); 388 info->workwebpage = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
383 } break; 389 } break;
384 390
385 case 0x00e6: { /* additional personal information */ 391 case 0x00e6: { /* additional personal information */
386 info->info = aimbs_getstr(&qbs, aimbs_getle16(&qbs)-1); 392 info->info = aimbs_getstr(&qbs, aimbs_getle16(&qbs)-1);
387 } break; 393 } break;
388 394
389 /* XXX - Find out the structure of this. Probably make a 2d array of strings */
390 case 0x00eb: { /* email address(es) */ 395 case 0x00eb: { /* email address(es) */
396 int i;
391 info->numaddresses = aimbs_getle16(&qbs); 397 info->numaddresses = aimbs_getle16(&qbs);
392 info->email2 = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); 398 info->email2 = (char **)calloc(info->numaddresses, sizeof(char *));
399 for (i = 0; i < info->numaddresses; i++) {
400 info->email2[i] = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
401 if (i+1 != info->numaddresses)
402 aim_bstream_advance(&qbs, 1); /* 0x00 */
403 }
393 } break; 404 } break;
394 405
395 case 0x00f0: { /* personal interests */ 406 case 0x00f0: { /* personal interests */
396 } break; 407 } break;
397 408
398 case 0x00fa: { /* past background and current organizations */ 409 case 0x00fa: { /* past background and current organizations */
399 } break; 410 } break;
400 411
401 case 0x010e: { /* unknown */ 412 case 0x010e: { /* unknown */
413 /* 0x00 00 */
402 } break; 414 } break;
403 415
404 case 0x019a: { /* simple info */ 416 case 0x019a: { /* simple info */
405 aim_bstream_advance(&qbs, 2); 417 aim_bstream_advance(&qbs, 2);
406 info->uin = aimbs_getle32(&qbs); 418 info->uin = aimbs_getle32(&qbs);

mercurial