Import madtty, use it to deal with colors from now on as it needs to know what is...
[apps/madmutt.git] / alias.cpkg
index c4e739e..10e2d8c 100644 (file)
@@ -29,7 +29,7 @@
 
 #include <lib-sys/unix.h>
 
-#include <lib-ui/curses.h>
+#include <lib-ui/lib-ui.h>
 #include <lib-ui/enter.h>
 #include <lib-ui/menu.h>
 
@@ -144,15 +144,6 @@ alias_t *Aliases;
 
 #define RSORT(x) (SortAlias & SORT_REVERSE) ? -x : x
 
-static struct mapping_t AliasHelp[] = {
-    {N_("Exit"), OP_EXIT},
-    {N_("Del"), OP_DELETE},
-    {N_("Undel"), OP_UNDELETE},
-    {N_("Select"), OP_GENERIC_SELECT_ENTRY},
-    {N_("Help"), OP_HELP},
-    {NULL, OP_NULL}
-};
-
 static void mutt_alias_menu(char *, size_t, alias_t *);
 
 const address_t *alias_lookup(const char *s)
@@ -207,10 +198,10 @@ int mutt_addr_is_user(address_t *addr)
     if (!addr->mailbox)
         return 0;
 
-    if (!ascii_strcasecmp(addr->mailbox, MCore.username)
-    ||  string_is_address(addr->mailbox, MCore.username, MCore.shorthost)
-    ||  string_is_address(addr->mailbox, MCore.username, mutt_fqdn(0))
-    ||  string_is_address(addr->mailbox, MCore.username, mutt_fqdn(1))
+    if (!ascii_strcasecmp(addr->mailbox, mod_core.username)
+    ||  string_is_address(addr->mailbox, mod_core.username, mod_core.shorthost)
+    ||  string_is_address(addr->mailbox, mod_core.username, mutt_fqdn(0))
+    ||  string_is_address(addr->mailbox, mod_core.username, mutt_fqdn(1))
     ||  (MAlias.from && !ascii_strcasecmp(MAlias.from->mailbox, addr->mailbox)))
     {
         return 1;
@@ -445,7 +436,7 @@ static address_t *mutt_expand_aliases_r(address_t *a, string_list_t **expn)
 
                 if (pw) {
                     char namebuf[STRING];
-                    mutt_gecos_name(namebuf, sizeof(namebuf), pw, MCore.gecos_mask);
+                    mutt_gecos_name(namebuf, sizeof(namebuf), pw, mod_core.gecos_mask);
                     m_strreplace(&pop->personal, namebuf);
                 }
             }
@@ -454,7 +445,7 @@ static address_t *mutt_expand_aliases_r(address_t *a, string_list_t **expn)
         last = address_list_append(last, pop);
     }
 
-    if (MCore.use_domain) {
+    if (mod_core.use_domain) {
         /* now qualify all local addresses */
         rfc822_qualify(head, mutt_fqdn(1));
     }
@@ -616,9 +607,8 @@ alias_format_str(char *dest, ssize_t destlen, char op, const char *src,
 
 static void alias_entry(char *s, ssize_t slen, MUTTMENU *m, int num)
 {
-    m_strformat(s, slen, COLS - SW, MAlias.alias_format, alias_format_str,
-                ((alias_t **)m->data)[num],
-                option(OPTARROWCURSOR) ? M_FORMAT_ARROWCURSOR : 0);
+    m_strformat(s, slen, getmaxx(main_w), MAlias.alias_format, alias_format_str,
+                ((alias_t **)m->data)[num], 0);
 }
 
 static int alias_tag (MUTTMENU * menu, int n, int m)
@@ -673,7 +663,6 @@ void mutt_alias_menu (char *buf, size_t buflen, alias_t * aliases)
   int t = -1;
   int i, done = 0;
   int op;
-  char helpstr[STRING];
 
   int omax;
 
@@ -691,8 +680,6 @@ void mutt_alias_menu (char *buf, size_t buflen, alias_t * aliases)
   menu->tag = alias_tag;
   menu->menu = MENU_ALIAS;
   menu->title = _("Aliases");
-  menu->help = mutt_compile_help(helpstr, sizeof(helpstr),
-                                 MENU_ALIAS, AliasHelp);
 
 new_aliases: