mirror of
https://github.com/bobbimanners/emailler.git
synced 2024-09-30 14:57:08 +00:00
EMAIL: Support for deleting all messages here->end
This commit is contained in:
parent
acfc5d6cf6
commit
5a44a9836e
44
apps/email.c
44
apps/email.c
@ -2232,6 +2232,27 @@ done:
|
|||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Move to the next message, if there is one.
|
||||||
|
* Called by the code that handles down arrow.
|
||||||
|
* Returns 1 if there are more messages below, 0 otherwise
|
||||||
|
*/
|
||||||
|
uint8_t go_to_next_message(void) {
|
||||||
|
if (selection < num_msgs) {
|
||||||
|
prevselection = selection;
|
||||||
|
++selection;
|
||||||
|
update_highlighted();
|
||||||
|
return 1;
|
||||||
|
} else if (first_msg + selection - 1 < total_msgs) {
|
||||||
|
first_msg += MSGS_PER_PAGE;
|
||||||
|
read_email_db(first_msg, 0, 0);
|
||||||
|
selection = 1;
|
||||||
|
email_summary();
|
||||||
|
return 1;
|
||||||
|
} else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Keyboard handler
|
* Keyboard handler
|
||||||
*/
|
*/
|
||||||
@ -2296,16 +2317,7 @@ void keyboard_hdlr(void) {
|
|||||||
case 'j':
|
case 'j':
|
||||||
case 'J':
|
case 'J':
|
||||||
case DOWNARROW:
|
case DOWNARROW:
|
||||||
if (selection < num_msgs) {
|
go_to_next_message();
|
||||||
prevselection = selection;
|
|
||||||
++selection;
|
|
||||||
update_highlighted();
|
|
||||||
} else if (first_msg + selection - 1 < total_msgs) {
|
|
||||||
first_msg += MSGS_PER_PAGE;
|
|
||||||
read_email_db(first_msg, 0, 0);
|
|
||||||
selection = 1;
|
|
||||||
email_summary();
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case RETURN:
|
case RETURN:
|
||||||
case ' ':
|
case ' ':
|
||||||
@ -2327,6 +2339,18 @@ void keyboard_hdlr(void) {
|
|||||||
email_summary_for(selection);
|
email_summary_for(selection);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 0x04: // Ctrl-D
|
||||||
|
if (prompt_okay("Mark deleted from here down - ")) {
|
||||||
|
do {
|
||||||
|
h = get_headers(selection);
|
||||||
|
if (h) {
|
||||||
|
h->status = 'D';
|
||||||
|
write_updated_headers(h, get_db_index());
|
||||||
|
email_summary_for(selection);
|
||||||
|
}
|
||||||
|
} while(go_to_next_message() == 1);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 'u':
|
case 'u':
|
||||||
case 'U':
|
case 'U':
|
||||||
if (h) {
|
if (h) {
|
||||||
|
Loading…
Reference in New Issue
Block a user