]> git.deb.at Git - pkg/abook.git/commitdiff
launch_mutt() update
authorJaakko Heinonen <jheinonen@users.sourceforge.net>
Tue, 12 Jun 2001 07:37:30 +0000 (07:37 +0000)
committerJaakko Heinonen <jheinonen@users.sourceforge.net>
Tue, 12 Jun 2001 07:37:30 +0000 (07:37 +0000)
abook.c
edit.c
ui.c

diff --git a/abook.c b/abook.c
index 57db4e46be931493510da3f2e981595020e126ad..2cbbbd1244b3d115e8ce98b2e8ae7a0775c33eb6 100644 (file)
--- a/abook.c
+++ b/abook.c
@@ -284,7 +284,7 @@ make_mailstr(int item)
 
        ret = *database[item][EMAIL] ?
                mkstr("%s <%s>", name, email) :
-               name;
+               strdup(name);
 
        free(name);
        
@@ -298,18 +298,17 @@ launch_mutt(int item)
 
        if( is_valid_item(item) )
                mailstr = make_mailstr(item);
-
-       /*
-        * need to implement for multiple addresses
-        */
-               /*
-       } else {
+       else {
                struct db_enumerator e = init_db_enumerator(ENUM_SELECTED);
+               char *tmp = NULL;
                db_enumerate_items(e) {
                        tmp = mailstr;
-                       mailstr = strconcat(tmp, make_mailstr(e.item);
-                       
-       }*/
+                       mailstr = tmp ?
+                               strconcat(tmp, ",", make_mailstr(e.item), NULL):
+                               strconcat(make_mailstr(e.item), NULL);
+                       free(tmp);
+               }
+       }
 
        cmd = strconcat(options_get_str("mutt_command"), " \'", mailstr,
                                "\'", NULL);
diff --git a/edit.c b/edit.c
index 0d14512d789706b68c7075adcaba717af230711c..643603245b7958cb0198ae44d3ced8e72e949778 100644 (file)
--- a/edit.c
+++ b/edit.c
@@ -381,8 +381,8 @@ edit_loop(int item)
                case 'r': roll_emails(item); break;
                case '?': display_help(HELP_EDITOR); break;
                case 'u': edit_undo(item, RESTORE_ITEM); break;
-               case 'm': launch_mutt(item); break;
-               case 'v': launch_wwwbrowser(item); break;
+               case 'm': launch_mutt(item); clearok(stdscr, 1); break;
+               case 'v': launch_wwwbrowser(item); clearok(stdscr, 1); break;
                case 12 : clearok(stdscr, 1); break; /* ^L (refresh screen) */
                default:  return edit_field(tab, c, item) ? item : -1;
        }
diff --git a/ui.c b/ui.c
index d490fc3b61c56019a41c398a9ed2710095f7ff74..c706963f86e550e26adaf18edcecb7e08257742c 100644 (file)
--- a/ui.c
+++ b/ui.c
@@ -465,7 +465,8 @@ get_commands()
                        case 'Z': move_curitem(MOVE_ITEM_DOWN);
                                break;
 
-                       case 'm': launch_mutt(list_current_item());
+                       case 'm': launch_mutt(selected_items() ?
+                                                 -1 : list_current_item());
                                  refresh_screen();
                                  break;