Changeset 7e3592e
- Timestamp:
- 2006-07-05T18:34:31Z (18 years ago)
- Branches:
- master
- Children:
- 75a4b85
- Parents:
- 5b52a48
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
storage.c
r5b52a48 r7e3592e 70 70 71 71 storage = storage_init_single(primary); 72 if (storage == NULL )72 if (storage == NULL && storage->save == NULL) 73 73 return NULL; 74 74 -
storage_text.c
r5b52a48 r7e3592e 28 28 #include "crypting.h" 29 29 30 /* DO NOT USE THIS FUNCTION IN NEW CODE. This31 * function is here merely because the save/load code still uses32 * ids rather than names */33 static struct prpl *find_protocol_by_id(int id)34 {35 switch (id) {36 case 0: case 1: case 3: return find_protocol("oscar");37 case 4: return find_protocol("msn");38 case 2: return find_protocol("yahoo");39 case 8: return find_protocol("jabber");40 default: break;41 }42 return NULL;43 }44 45 static int find_protocol_id(const char *name)46 {47 if (!strcmp(name, "oscar")) return 1;48 if (!strcmp(name, "msn")) return 4;49 if (!strcmp(name, "yahoo")) return 2;50 if (!strcmp(name, "jabber")) return 8;51 52 return -1;53 }54 55 56 30 static void text_init (void) 57 31 { … … 70 44 FILE *fp; 71 45 user_t *ru = user_find( irc, ROOT_NICK ); 46 account_t *acc, *acc_lookup[9]; 72 47 73 48 if( irc->status & USTATUS_IDENTIFIED ) … … 80 55 fscanf( fp, "%32[^\n]s", s ); 81 56 82 if (checkpass (password, s) != 0)57 if( checkpass( password, s ) != 0 ) 83 58 { 84 59 fclose( fp ); … … 100 75 fclose( fp ); 101 76 77 /* Build a list with the first listed account of every protocol 78 number. So if the user had nicks defined for a second account on 79 the same IM network, those nicks will be added to the wrong 80 account, and the user should rename those buddies again. But at 81 least from now on things will be saved properly. */ 82 memset( acc_lookup, 0, sizeof( acc_lookup ) ); 83 for( acc = irc->accounts; acc; acc = acc->next ) 84 { 85 if( acc_lookup[0] == NULL && strcmp( acc->prpl->name, "oscar" ) == 0 ) 86 acc_lookup[0] = acc_lookup[1] = acc_lookup[3] = acc; 87 else if( acc_lookup[2] == NULL && strcmp( acc->prpl->name, "yahoo" ) == 0 ) 88 acc_lookup[2] = acc; 89 else if( acc_lookup[4] == NULL && strcmp( acc->prpl->name, "msn" ) == 0 ) 90 acc_lookup[4] = acc; 91 else if( acc_lookup[8] == NULL && strcmp( acc->prpl->name, "jabber" ) == 0 ) 92 acc_lookup[8] = acc; 93 } 94 102 95 g_snprintf( s, 511, "%s%s%s", global.conf->configdir, my_nick, ".nicks" ); 103 96 fp = fopen( s, "r" ); … … 105 98 while( fscanf( fp, "%s %d %s", s, &proto, nick ) > 0 ) 106 99 { 107 struct prpl *prpl; 108 109 prpl = find_protocol_by_id(proto); 110 111 if (!prpl) 100 if( ( acc = acc_lookup[proto] ) == NULL ) 112 101 continue; 113 102 114 103 http_decode( s ); 115 // FIXME!!!! nick_set( irc, s, prpl, nick );104 nick_set( acc, s, nick ); 116 105 } 117 106 fclose( fp ); -
storage_xml.c
r5b52a48 r7e3592e 382 382 } 383 383 384 g_snprintf( path, sizeof( path ) - 2, "%s%s%s", global.conf->configdir, irc->nick, ".xml" ); 384 path2 = g_strdup( irc->nick ); 385 nick_lc( path2 ); 386 g_snprintf( path, sizeof( path ) - 2, "%s%s%s", global.conf->configdir, path2, ".xml" ); 387 g_free( path2 ); 385 388 386 389 if( !overwrite && access( path, F_OK ) != -1 )
Note: See TracChangeset
for help on using the changeset viewer.