reorganize code so that the rfc822parse.c does not needs lib-crypt nor
[apps/madmutt.git] / query.c
diff --git a/query.c b/query.c
index 1aa7b8a..0b72303 100644 (file)
--- a/query.c
+++ b/query.c
@@ -61,7 +61,7 @@ static address_t *result_to_addr (QUERY * r)
 {
   static address_t *tmp;
 
-  tmp = rfc822_cpy_adr (r->addr);
+  tmp = address_list_dup (r->addr);
 
   if (!tmp->next && !tmp->personal)
     tmp->personal = m_strdup(r->name);
@@ -380,10 +380,7 @@ static void query_menu (char *buf, size_t buflen, QUERY * results, int retbuf)
 
           for (i = 0; i < menu->max; i++)
             if (QueryTable[i].tagged) {
-              address_t *a = result_to_addr (QueryTable[i].data);
-
-              rfc822_append (&naddr, a);
-              address_delete (&a);
+              address_list_append(&naddr, result_to_addr(QueryTable[i].data));
             }
 
           mutt_create_alias (NULL, naddr);
@@ -404,18 +401,15 @@ static void query_menu (char *buf, size_t buflen, QUERY * results, int retbuf)
         /* fall through to OP_MAIL */
 
       case OP_MAIL:
-        msg = mutt_new_header ();
-        msg->env = mutt_new_envelope ();
+        msg = header_new();
+        msg->env = envelope_new();
         if (!menu->tagprefix) {
           msg->env->to = result_to_addr (QueryTable[menu->current].data);
         }
         else {
           for (i = 0; i < menu->max; i++)
             if (QueryTable[i].tagged) {
-              address_t *a = result_to_addr (QueryTable[i].data);
-
-              rfc822_append (&msg->env->to, a);
-              address_delete (&a);
+              address_list_append(&msg->env->to, result_to_addr(QueryTable[i].data));
             }
         }
         ci_send_message (0, msg, NULL, Context, NULL);