Changeset efeec7f for functions.c
- Timestamp:
- Jul 9, 2011, 4:11:45 PM (13 years ago)
- Branches:
- master, release-1.10, release-1.8, release-1.9
- Children:
- a130fc5
- Parents:
- 3eeb6ed
- git-author:
- Jason Gross <jgross@mit.edu> (05/23/11 19:06:48)
- git-committer:
- Jason Gross <jgross@mit.edu> (07/09/11 16:11:45)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
functions.c
r3eeb6ed refeec7f 662 662 } 663 663 664 void owl_function_delete_and_expunge_message(int n) 665 { 666 owl_messagelist *ml = owl_global_get_msglist(&g); 667 owl_view *v = owl_global_get_current_view(&g); 668 int lastmsgid = owl_function_get_curmsg_id(v); 669 670 /* delete and expunge the message */ 671 owl_messagelist_delete_and_expunge_element(ml, n); 672 673 owl_function_redisplay_to_nearest(lastmsgid, v); 674 } 675 676 void owl_function_delete_and_expunge_cur(bool exclaim_success) 677 { 678 int curmsg; 679 const owl_view *v = owl_global_get_current_view(&g); 680 681 /* bail if there's no current message */ 682 if (owl_view_get_size(v) < 1) { 683 owl_function_error("No current message to delete"); 684 return; 685 } 686 687 /* delete the current message */ 688 curmsg = owl_global_get_curmsg(&g); 689 owl_function_delete_and_expunge_message(curmsg); 690 if (exclaim_success) 691 owl_function_makemsg("Message deleted and expunged"); 692 } 693 664 694 /* if move_after is 1, moves after the delete */ 665 695 void owl_function_deletecur(int move_after) … … 1664 1694 } 1665 1695 1696 void owl_function_delete_and_expunge_by_id(int id, bool exclaim_success) 1697 { 1698 const owl_messagelist *ml = owl_global_get_msglist(&g); 1699 int msg = owl_messagelist_get_index_by_id(ml, id); 1700 if (msg < 0) { 1701 owl_function_error("No message with id %d: unable to delete", id); 1702 } else { 1703 owl_function_delete_and_expunge_message(msg); 1704 if (exclaim_success) 1705 owl_function_makemsg("Message deleted and expunged"); 1706 } 1707 } 1708 1666 1709 /* note: this applies to global message list, not to view. 1667 1710 * If flag is 1, deletes. If flag is 0, undeletes. */
Note: See TracChangeset
for help on using the changeset viewer.