Changeset 1baaef8 for protocols/jabber/io.c
- Timestamp:
- 2007-07-30T19:12:06Z (17 years ago)
- Branches:
- master
- Children:
- 82135c7
- Parents:
- 85023c6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/io.c
r85023c6 r1baaef8 436 436 { 437 437 struct im_connection *ic = data; 438 struct xt_node *c;439 char *s, *type = NULL, *text = NULL;440 438 int allow_reconnect = TRUE; 441 442 for( c = node->children; c; c = c->next ) 443 { 444 if( !( s = xt_find_attr( c, "xmlns" ) ) || 445 strcmp( s, XMLNS_STREAM_ERROR ) != 0 ) 446 continue; 447 448 if( strcmp( c->name, "text" ) != 0 ) 449 { 450 type = c->name; 451 } 452 /* Only use the text if it doesn't have an xml:lang attribute, 453 if it's empty or if it's set to something English. */ 454 else if( !( s = xt_find_attr( c, "xml:lang" ) ) || 455 !*s || strncmp( s, "en", 2 ) == 0 ) 456 { 457 text = c->text; 458 } 459 } 439 struct jabber_error *err; 440 441 err = jabber_error_parse( node, XMLNS_STREAM_ERROR ); 460 442 461 443 /* Tssk... */ 462 if( type == NULL )444 if( err->code == NULL ) 463 445 { 464 446 imcb_error( ic, "Unknown stream error reported by server" ); 465 447 imc_logout( ic, allow_reconnect ); 448 jabber_error_free( err ); 466 449 return XT_ABORT; 467 450 } … … 470 453 should turn off auto-reconnect to make sure we won't get some nasty 471 454 infinite loop! */ 472 if( strcmp( type, "conflict" ) == 0 )455 if( strcmp( err->code, "conflict" ) == 0 ) 473 456 { 474 457 imcb_error( ic, "Account and resource used from a different location" ); … … 477 460 else 478 461 { 479 imcb_error( ic, "Stream error: %s%s%s", type, text ? ": " : "", text ? text : "" ); 480 } 481 462 imcb_error( ic, "Stream error: %s%s%s", err->code, err->text ? ": " : "", 463 err->text ? err->text : "" ); 464 } 465 466 jabber_error_free( err ); 482 467 imc_logout( ic, allow_reconnect ); 483 468
Note: See TracChangeset
for help on using the changeset viewer.