comparison mcabber/mcabber/main.c @ 1894:c3271ac96173

Display the JID before attempting to connect Display the JID even if a password has been provided, so that it can appear in the status window.
author Mikael Berthe <mikael@lilotux.net>
date Sun, 11 Apr 2010 19:49:52 +0200
parents e6d355e50d7a
children efd7c4c34ff2
comparison
equal deleted inserted replaced
1893:dcefd1732a3c 1894:c3271ac96173
377 g_free(configFile); 377 g_free(configFile);
378 /* Leave if there was an error in the config. file */ 378 /* Leave if there was an error in the config. file */
379 if (ret == -2) 379 if (ret == -2)
380 exit(EXIT_FAILURE); 380 exit(EXIT_FAILURE);
381 381
382 /* Display configuration settings */
383 {
384 const char *p;
385 if ((p = settings_opt_get("server")) != NULL)
386 scr_log_print(LPRINT_NORMAL, "Server: %s", p);
387 if ((p = settings_opt_get("jid")) != NULL)
388 scr_log_print(LPRINT_NORMAL, "User JID: %s", p);
389 }
390
382 /* If no password is stored, we ask for it before entering 391 /* If no password is stored, we ask for it before entering
383 ncurses mode -- unless the username is unknown. */ 392 ncurses mode -- unless the username is unknown. */
384 if (settings_opt_get("jid") && !settings_opt_get("password")) { 393 if (settings_opt_get("jid") && !settings_opt_get("password")) {
385 const char *p; 394 char *pwd = ask_password("your Jabber password");
386 char *pwd;
387 p = settings_opt_get("server");
388 if (p)
389 printf("Server: %s\n", p);
390 p = settings_opt_get("jid");
391 if (p)
392 printf("User JID: %s\n", p);
393
394 pwd = ask_password("your Jabber password");
395 settings_set(SETTINGS_TYPE_OPTION, "password", pwd); 395 settings_set(SETTINGS_TYPE_OPTION, "password", pwd);
396 g_free(pwd); 396 g_free(pwd);
397 } 397 }
398 398
399 /* Initialize PGP system 399 /* Initialize PGP system