Changeset 547ea68
- Timestamp:
- 2010-06-27T15:32:12Z (14 years ago)
- Branches:
- master
- Children:
- 134a02c
- Parents:
- 84c3a72
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
root_commands.c
r84c3a72 r547ea68 1019 1019 1020 1020 if( ( ic = irc_channel_new( irc, channel ) ) && 1021 set_setstr( &ic->set, "type", "chat" ) && 1021 1022 set_setstr( &ic->set, "chat_type", "room" ) && 1022 1023 set_setstr( &ic->set, "account", cmd[2] ) && -
storage_xml.c
r84c3a72 r547ea68 175 175 if( ( setting = xml_attr( attr_names, attr_values, "name" ) ) ) 176 176 { 177 /* 178 if( xd->current_chat != NULL ) 179 xd->current_set_head = &xd->current_chat->set; 180 else 181 */ 182 if( xd->current_account != NULL ) 177 if( xd->current_channel != NULL ) 178 xd->current_set_head = &xd->current_channel->set; 179 else if( xd->current_account != NULL ) 183 180 xd->current_set_head = &xd->current_account->set; 184 181 else … … 208 205 } 209 206 } 207 else if( g_strcasecmp( element_name, "channel" ) == 0 ) 208 { 209 char *name, *type; 210 211 name = xml_attr( attr_names, attr_values, "name" ); 212 type = xml_attr( attr_names, attr_values, "type" ); 213 214 if( !name || !type ) 215 { 216 g_set_error( error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, 217 "Missing attributes for %s element", element_name ); 218 return; 219 } 220 221 if( ( xd->current_channel = irc_channel_by_name( irc, name ) ) || 222 ( xd->current_channel = irc_channel_new( irc, name ) ) ) 223 set_setstr( &xd->current_channel->set, "type", type ); 224 } 225 /* Backward compatibility: Keep this around for a while for people 226 switching from BitlBee 1.2.4+. */ 210 227 else if( g_strcasecmp( element_name, "chat" ) == 0 ) 211 228 { … … 225 242 226 243 if( ( ic = irc_channel_new( irc, channel ) ) && 244 set_setstr( &ic->set, "type", "chat" ) && 227 245 set_setstr( &ic->set, "chat_type", "room" ) && 228 246 set_setstr( &ic->set, "account", acc ) && 229 247 set_setstr( &ic->set, "room", handle ) ) 230 248 { 231 /* Nothing else to do for now, really. */ 249 /* Try to pick up some settings where possible. */ 250 xd->current_channel = ic; 232 251 } 233 252 else if( ic ) … … 262 281 xd->current_account = NULL; 263 282 } 264 else if( g_strcasecmp( element_name, "chat" ) == 0 ) 265 { 266 /* xd->current_chat = NULL; */ 283 else if( g_strcasecmp( element_name, "channel" ) == 0 || 284 g_strcasecmp( element_name, "chat" ) == 0 ) 285 { 286 xd->current_channel = NULL; 267 287 } 268 288 } … … 414 434 md5_byte_t pass_md5[21]; 415 435 md5_state_t md5_state; 436 GSList *l; 416 437 417 438 path2 = g_strdup( irc->user->nick ); … … 492 513 } 493 514 515 for( l = irc->channels; l; l = l->next ) 516 { 517 irc_channel_t *ic = l->data; 518 519 if( !xml_printf( fd, 1, "<channel name=\"%s\" type=\"%s\">\n", 520 ic->name, set_getstr( &ic->set, "type" ) ) ) 521 goto write_error; 522 523 for( set = ic->set; set; set = set->next ) 524 if( set->value && strcmp( set->key, "type" ) != 0 ) 525 if( !xml_printf( fd, 2, "<setting name=\"%s\">%s</setting>\n", set->key, set->value ) ) 526 goto write_error; 527 528 if( !xml_printf( fd, 1, "</channel>\n" ) ) 529 goto write_error; 530 } 531 494 532 if( !xml_printf( fd, 0, "</user>\n" ) ) 495 533 goto write_error;
Note: See TracChangeset
for help on using the changeset viewer.