Changeset c351434


Ignore:
Timestamp:
2010-07-03T21:32:10Z (9 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
8eb0b76
Parents:
8203da9
Message:

Skip unsupported tags in user configs. (This should make downgrades from
ui-fix for whatever reason less painful.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • storage_xml.c

    r8203da9 rc351434  
    6060        char *given_pass;
    6161        xml_pass_st pass_st;
     62        int unknown_tag;
    6263};
    6364
     
    8788        irc_t *irc = xd->irc;
    8889       
    89         if( g_strcasecmp( element_name, "user" ) == 0 )
     90        if( xd->unknown_tag > 0 )
     91        {
     92                xd->unknown_tag ++;
     93        }
     94        else if( g_strcasecmp( element_name, "user" ) == 0 )
    9095        {
    9196                char *nick = xml_attr( attr_names, attr_values, "nick" );
     
    225230        else
    226231        {
     232                xd->unknown_tag ++;
     233                irc_usermsg( irc, "Warning: Unknown XML tag found in configuration file (%s). "
     234                                  "This may happen when downgrading BitlBee versions. "
     235                                  "This tag will be skipped and the information will be lost "
     236                                  "once you save your settings.", element_name );
     237                /*
    227238                g_set_error( error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
    228239                             "Unkown element: %s", element_name );
     240                */
    229241        }
    230242}
     
    234246        struct xml_parsedata *xd = data;
    235247       
    236         if( g_strcasecmp( element_name, "setting" ) == 0 && xd->current_setting )
     248        if( xd->unknown_tag > 0 )
     249        {
     250                xd->unknown_tag --;
     251        }
     252        else if( g_strcasecmp( element_name, "setting" ) == 0 && xd->current_setting )
    237253        {
    238254                g_free( xd->current_setting );
Note: See TracChangeset for help on using the changeset viewer.