comparison src/main.c @ 6036:547ba881bc7e

[gaim-migrate @ 6486] Fix the --login=[NAME] command line argument. Fix the password prompt when signing on an account with no password set. I made some similar changes that probably fix problems with the filectl plugin, using gaim-remote to sign on an account, and signing on an account via perl script. (The change is calling gaim_account_connect() instead of serv_login().) Fix a silly compiler warning. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sat, 05 Jul 2003 22:24:57 +0000
parents 272c761c52e3
children 3a40666c08b4
comparison
equal deleted inserted replaced
6035:8c44020a958e 6036:547ba881bc7e
228 { 228 {
229 GaimAccount *account; 229 GaimAccount *account;
230 const char *username = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(name)->entry)); 230 const char *username = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(name)->entry));
231 const char *password = gtk_entry_get_text(GTK_ENTRY(pass)); 231 const char *password = gtk_entry_get_text(GTK_ENTRY(pass));
232 232
233 if (!strlen(username)) { 233 if (*username == '\0') {
234 gaim_notify_error(NULL, NULL, _("Please enter your login."), NULL); 234 gaim_notify_error(NULL, NULL, _("Please enter your login."), NULL);
235 return; 235 return;
236 } 236 }
237 237
238 /* if there is more than one user of the same name, then fuck 238 /* if there is more than one user of the same name, then fuck
244 account = gaim_account_new(username, "prpl-oscar"); 244 account = gaim_account_new(username, "prpl-oscar");
245 245
246 gaim_account_set_remember_password(account, TRUE); 246 gaim_account_set_remember_password(account, TRUE);
247 } 247 }
248 248
249 gaim_account_set_password(account, password); 249 gaim_account_set_password(account, (*password != '\0') ? password : NULL);
250 250
251 gaim_account_connect(account); 251 gaim_account_connect(account);
252 } 252 }
253 253
254 /* <name> is a comma-separated list of names, or NULL 254 /* <name> is a comma-separated list of names, or NULL
269 for (n = names; *n != NULL; n++) { 269 for (n = names; *n != NULL; n++) {
270 account = gaim_accounts_find(*n, -1); 270 account = gaim_accounts_find(*n, -1);
271 if (account) { /* found a user */ 271 if (account) { /* found a user */
272 if (gaim_account_get_remember_password(account)) { 272 if (gaim_account_get_remember_password(account)) {
273 retval = 0; 273 retval = 0;
274 serv_login(account); 274 gaim_account_connect(account);
275 } 275 }
276 } 276 }
277 } 277 }
278 g_strfreev(names); 278 g_strfreev(names);
279 } else { /* no name given, use default */ 279 } else { /* no name given, use default */
280 account = (GaimAccount *)gaim_accounts_get_all()->data; 280 account = (GaimAccount *)gaim_accounts_get_all()->data;
281 281
282 if (gaim_account_get_remember_password(account)) { 282 if (gaim_account_get_remember_password(account)) {
283 retval = 0; 283 retval = 0;
284 serv_login(account); 284 gaim_account_connect(account);
285 } 285 }
286 } 286 }
287 287
288 return retval; 288 return retval;
289 } 289 }