]> granicus.if.org Git - neomutt/commitdiff
nntp: reuse connection
authorRichard Russon <rich@flatcap.org>
Tue, 30 Oct 2018 12:00:44 +0000 (12:00 +0000)
committerRichard Russon <rich@flatcap.org>
Tue, 30 Oct 2018 23:55:16 +0000 (23:55 +0000)
nntp/nntp.c

index f8585fef0f61a058c0ab71e61a3f26806b03bfd3..e78356a7ceccf83d7e5b2d5de1b237453b9e452b 100644 (file)
@@ -2423,8 +2423,14 @@ static int nntp_mbox_open(struct Context *ctx)
 
   url.path = strchr(url.path, '\0');
   url_tostring(&url, server, sizeof(server), 0);
-  adata = nntp_select_server(ctx->mailbox, server, true);
+  if (ctx->mailbox && ctx->mailbox->account)
+    adata = ctx->mailbox->account->adata;
+
+  if (!adata)
+    adata = nntp_select_server(ctx->mailbox, server, true);
+
   url_free(&url);
+
   if (!adata)
     return -1;
   CurrentNewsSrv = adata;