Mercurial > pidgin
comparison src/main.c @ 6231:1fc158d6ebdb
[gaim-migrate @ 6724]
New accounts added using the login window are now correctly saved.
You can now use gaim -l to sign on accounts on prpls with no passwords
or with optional passwords.
committer: Tailor Script <tailor@pidgin.im>
| author | Mark Doliner <mark@kingant.net> |
|---|---|
| date | Sat, 19 Jul 2003 18:15:06 +0000 |
| parents | 16e384bb7fbf |
| children | 3565ee7a5dd3 |
comparison
equal
deleted
inserted
replaced
| 6230:0fef71e24ad5 | 6231:1fc158d6ebdb |
|---|---|
| 151 * the second one */ | 151 * the second one */ |
| 152 | 152 |
| 153 account = gaim_accounts_find(username, -1); | 153 account = gaim_accounts_find(username, -1); |
| 154 if (!account) { | 154 if (!account) { |
| 155 account = gaim_account_new(username, "prpl-oscar"); | 155 account = gaim_account_new(username, "prpl-oscar"); |
| 156 | |
| 157 gaim_account_set_remember_password(account, TRUE); | 156 gaim_account_set_remember_password(account, TRUE); |
| 157 gaim_accounts_add(account); | |
| 158 } | 158 } |
| 159 | 159 |
| 160 gaim_account_set_password(account, (*password != '\0') ? password : NULL); | 160 gaim_account_set_password(account, (*password != '\0') ? password : NULL); |
| 161 | 161 |
| 162 gaim_account_connect(account); | 162 gaim_account_connect(account); |
| 178 if (name !=NULL) { /* list of names given */ | 178 if (name !=NULL) { /* list of names given */ |
| 179 names = g_strsplit(name, ",", 32); | 179 names = g_strsplit(name, ",", 32); |
| 180 for (n = names; *n != NULL; n++) { | 180 for (n = names; *n != NULL; n++) { |
| 181 account = gaim_accounts_find(*n, -1); | 181 account = gaim_accounts_find(*n, -1); |
| 182 if (account) { /* found a user */ | 182 if (account) { /* found a user */ |
| 183 if (gaim_account_get_remember_password(account)) { | 183 retval = 0; |
| 184 retval = 0; | 184 gaim_account_connect(account); |
| 185 gaim_account_connect(account); | |
| 186 } | |
| 187 } | 185 } |
| 188 } | 186 } |
| 189 g_strfreev(names); | 187 g_strfreev(names); |
| 190 } else { /* no name given, use default */ | 188 } else { /* no name given, use default */ |
| 191 account = (GaimAccount *)gaim_accounts_get_all()->data; | 189 account = (GaimAccount *)gaim_accounts_get_all()->data; |
| 192 | 190 retval = 0; |
| 193 if (gaim_account_get_remember_password(account)) { | 191 gaim_account_connect(account); |
| 194 retval = 0; | |
| 195 gaim_account_connect(account); | |
| 196 } | |
| 197 } | 192 } |
| 198 | 193 |
| 199 return retval; | 194 return retval; |
| 200 } | 195 } |
| 201 | 196 |
| 455 { | 450 { |
| 456 GaimAccount *account; | 451 GaimAccount *account; |
| 457 | 452 |
| 458 account = gaim_accounts_find(name, -1); | 453 account = gaim_accounts_find(name, -1); |
| 459 | 454 |
| 460 if (account == NULL) /* new user */ | 455 if (account == NULL) { /* new user */ |
| 461 account = gaim_account_new(name, "prpl-oscar"); | 456 account = gaim_account_new(name, "prpl-oscar"); |
| 457 gaim_accounts_add(account); | |
| 458 } | |
| 462 | 459 |
| 463 /* Place it as the first user. */ | 460 /* Place it as the first user. */ |
| 464 gaim_accounts_reorder(account, 0); | 461 gaim_accounts_reorder(account, 0); |
| 465 } | 462 } |
| 466 | 463 |
