- else if ((account->type == M_ACCT_TYPE_NNTP) && NntpUser)
- strfcpy (account->user, NntpUser, sizeof (account->user));
+ else if ((account->type == M_ACCT_TYPE_NNTP) && !m_strisempty(NntpUser))
+ m_strcpy(account->user, sizeof(account->user), NntpUser);
+#endif
+ /* prompt (defaults to unix username), copy into account->user */
+ else {
+ snprintf(prompt, sizeof(prompt), _("Username at %s: "), account->host);
+ m_strcpy(account->user, sizeof(account->user), NONULL(Username));
+ if (mutt_get_field_unbuffered(prompt, account->user,
+ sizeof(account->user), 0))
+ return -1;
+ }
+
+ account->flags |= M_ACCT_USER;
+
+ return 0;
+}
+
+int mutt_account_getlogin (ACCOUNT* account)
+{
+ /* already set */
+ if (account->flags & M_ACCT_LOGIN)
+ return 0;
+#ifdef USE_IMAP
+ else if (account->type == M_ACCT_TYPE_IMAP)
+ {
+ if (!m_strisempty(ImapLogin)) {
+ m_strcpy(account->login, sizeof(account->login), ImapLogin);
+ account->flags |= M_ACCT_LOGIN;
+ }
+ }