I'm fed up with stupid defines when C can come up with *way* betted: bit-fields.
[apps/madmutt.git] / nntp / nntp.c
index f5e7132..1f4462a 100644 (file)
@@ -40,13 +40,13 @@ void nntp_sync_sidebar (NNTP_DATA* data) {
    * mailboxes command ;-((( FIXME
    */
   buf[0] = '\0';
    * mailboxes command ;-((( FIXME
    */
   buf[0] = '\0';
-  snprintf (buf, sizeof (buf), "nntp%s://%s%s%s%s/%s",
-            (data->nserv->conn->account.flags & M_ACCT_SSL) ? "s" : "",
-            NONULL (data->nserv->conn->account.user),
-            *data->nserv->conn->account.pass ? ":" : "",
-            *data->nserv->conn->account.pass ? data->nserv->conn->account.pass : "",
-            data->nserv->conn->account.host,
-            data->group);
+  snprintf(buf, sizeof (buf), "nntp%s://%s%s%s%s/%s",
+           data->nserv->conn->account.has_ssl ? "s" : "",
+           NONULL(data->nserv->conn->account.user),
+           *data->nserv->conn->account.pass ? ":" : "",
+           *data->nserv->conn->account.pass ? data->nserv->conn->account.pass : "",
+           data->nserv->conn->account.host,
+           data->group);
 
   /* bail out if group not found via mailboxes */
   if ((i = buffy_lookup (buf)) < 0)
 
   /* bail out if group not found via mailboxes */
   if ((i = buffy_lookup (buf)) < 0)
@@ -71,8 +71,8 @@ static int nntp_auth (NNTP_SERVER * serv)
   char buf[STRING];
   unsigned char flags = conn->account.flags;
 
   char buf[STRING];
   unsigned char flags = conn->account.flags;
 
-  if (mutt_account_getuser (&conn->account) || !conn->account.user[0] ||
-      mutt_account_getpass (&conn->account) || !conn->account.pass[0]) {
+  if (mutt_account_getuser(&conn->account) || !conn->account.user[0] ||
+      mutt_account_getpass(&conn->account) || !conn->account.pass[0]) {
     conn->account.flags = flags;
     return -2;
   }
     conn->account.flags = flags;
     return -2;
   }
@@ -152,7 +152,7 @@ static int nntp_connect_and_auth (NNTP_SERVER * serv)
   if (mutt_socket_readln (buf, sizeof (buf), conn) < 0)
     return nntp_connect_error (serv);
 
   if (mutt_socket_readln (buf, sizeof (buf), conn) < 0)
     return nntp_connect_error (serv);
 
-  if (!(conn->account.flags & M_ACCT_USER) && m_strncmp("480", buf, 3)) {
+  if (!conn->account.has_user && m_strncmp("480", buf, 3)) {
     serv->status = NNTP_OK;
     return 0;
   }
     serv->status = NNTP_OK;
     return 0;
   }