Changeset 2b14eef for storage_xml.c


Ignore:
Timestamp:
2006-06-20T22:14:46Z (18 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
00ab350
Parents:
9b46b64
Message:

Implemented handling of autoconnect attribute.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • storage_xml.c

    r9b46b64 r2b14eef  
    126126        else if( g_strcasecmp( element_name, "account" ) == 0 )
    127127        {
    128                 char *protocol, *handle, *server, *password;
     128                char *protocol, *handle, *server, *password, *autoconnect;
    129129                struct prpl *prpl = NULL;
    130130               
     
    132132                password = xml_attr( attr_names, attr_values, "password" );
    133133                server = xml_attr( attr_names, attr_values, "server" );
     134                autoconnect = xml_attr( attr_names, attr_values, "autoconnect" );
    134135               
    135136                protocol = xml_attr( attr_names, attr_values, "protocol" );
     
    148149                        if( server )
    149150                                xd->current_account->server = g_strdup( server );
     151                        if( autoconnect )
     152                                /* Return value doesn't matter, since account_add() already sets
     153                                   a default! */
     154                                sscanf( autoconnect, "%d", &xd->current_account->auto_connect );
    150155                }
    151156        }
     
    385390        for( acc = irc->accounts; acc; acc = acc->next )
    386391        {
    387                 if( !xml_printf( fd, "\t<account protocol=\"%s\" handle=\"%s\" password=\"%s\" autoconnect=\"%s\"", acc->prpl->name, acc->user, acc->pass, "yes" ) )
     392                if( !xml_printf( fd, "\t<account protocol=\"%s\" handle=\"%s\" password=\"%s\" autoconnect=\"%d\"", acc->prpl->name, acc->user, acc->pass, acc->auto_connect ) )
    388393                        goto write_error;
    389394                if( acc->server && acc->server[0] && !xml_printf( fd, " server=\"%s\"", acc->server ) )
Note: See TracChangeset for help on using the changeset viewer.