comparison src/account.c @ 11075:812b285aeccd

[gaim-migrate @ 13085] sf patch #1233654, from Sadrul H C There was an error in the parsing of the status. ("active" and "type" are attributes of a status, rather than children). That is fixed with this patch. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sat, 09 Jul 2005 19:36:24 +0000
parents 2eca9ed49469
children 75be3005640e
comparison
equal deleted inserted replaced
11074:ba630d7a7365 11075:812b285aeccd
402 parse_status(xmlnode *node, GaimAccount *account) 402 parse_status(xmlnode *node, GaimAccount *account)
403 { 403 {
404 gboolean active = FALSE; 404 gboolean active = FALSE;
405 const char *data; 405 const char *data;
406 const char *type; 406 const char *type;
407 xmlnode *child;
408 407
409 /* Get the active/inactive state */ 408 /* Get the active/inactive state */
410 child = xmlnode_get_child(node, "active"); 409 data = xmlnode_get_attrib(node, "active");
411 if ((child != NULL) && ((data = xmlnode_get_data(child)) != NULL)) 410 if (data != NULL)
412 { 411 {
413 if (strcasecmp(data, "true") == 0) 412 if (strcasecmp(data, "true") == 0)
414 active = TRUE; 413 active = TRUE;
415 else if (strcasecmp(data, "false") == 0) 414 else if (strcasecmp(data, "false") == 0)
416 active = FALSE; 415 active = FALSE;
419 } 418 }
420 else 419 else
421 return; 420 return;
422 421
423 /* Get the type of the status */ 422 /* Get the type of the status */
424 child = xmlnode_get_child(node, "type"); 423 type = xmlnode_get_attrib(node, "type");
425 if ((child != NULL) && ((data = xmlnode_get_data(child)) != NULL)) 424 if (type == NULL)
426 {
427 type = data;
428 }
429 else
430 return; 425 return;
431 426
432 /* QQQ: Need to read attributes into a vargs */ 427 /* QQQ: Need to read attributes into a vargs */
433 428
434 /* QQQ: This needs to do a better job of adding attributes and stuff */ 429 /* QQQ: This needs to do a better job of adding attributes and stuff */