Commit 2edc1b12 2edc1b1269719370346e304e3d65079e05983397 by Sergey Poznyakoff

Mark message as read and shown

1 parent 82f2f53e
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2000, 2001, 2002, 2003,
3 2005 Free Software Foundation, Inc.
3 4
4 GNU Mailutils is free software; you can redistribute it and/or modify 5 GNU Mailutils is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
...@@ -77,11 +78,8 @@ display_message (message_t mesg, msgset_t *msgset, void *arg) ...@@ -77,11 +78,8 @@ display_message (message_t mesg, msgset_t *msgset, void *arg)
77 78
78 /* Mark enclosing message as read */ 79 /* Mark enclosing message as read */
79 if (mailbox_get_message (mbox, msgset->msg_part[0], &mesg) == 0) 80 if (mailbox_get_message (mbox, msgset->msg_part[0], &mesg) == 0)
80 { 81 util_mark_read (mesg);
81 attribute_t attr; 82
82 message_get_attribute (mesg, &attr);
83 attribute_set_read (attr);
84 }
85 return 0; 83 return 0;
86 } 84 }
87 85
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 1999, 2001 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2001, 2005 Free Software Foundation, Inc.
3 3
4 GNU Mailutils is free software; you can redistribute it and/or modify 4 GNU Mailutils is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
...@@ -28,6 +28,7 @@ mbox0 (msgset_t *mspec, message_t msg, void *data) ...@@ -28,6 +28,7 @@ mbox0 (msgset_t *mspec, message_t msg, void *data)
28 28
29 message_get_attribute (msg, &attr); 29 message_get_attribute (msg, &attr);
30 attribute_set_userflag (attr, MAIL_ATTRIBUTE_MBOXED); 30 attribute_set_userflag (attr, MAIL_ATTRIBUTE_MBOXED);
31 util_mark_read (msg);
31 32
32 cursor = mspec->msg_part[0]; 33 cursor = mspec->msg_part[0];
33 34
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 1999, 2001, 2003 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2001, 2003, 2005 Free Software Foundation, Inc.
3 3
4 GNU Mailutils is free software; you can redistribute it and/or modify 4 GNU Mailutils is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
...@@ -60,6 +60,7 @@ mail_pipe (int argc, char **argv) ...@@ -60,6 +60,7 @@ mail_pipe (int argc, char **argv)
60 if (util_getenv (NULL, "page", Mail_env_boolean, 0) == 0) 60 if (util_getenv (NULL, "page", Mail_env_boolean, 0) == 0)
61 fprintf (tube, "\f\n"); 61 fprintf (tube, "\f\n");
62 } 62 }
63 util_mark_read (msg);
63 } 64 }
64 65
65 msgset_free (list); 66 msgset_free (list);
......
...@@ -103,9 +103,7 @@ mail_print_msg (msgset_t *mspec, message_t mesg, void *data) ...@@ -103,9 +103,7 @@ mail_print_msg (msgset_t *mspec, message_t mesg, void *data)
103 if (out != ofile) 103 if (out != ofile)
104 pclose (out); 104 pclose (out);
105 105
106 message_get_attribute (mesg, &attr); 106 util_mark_read (mesg);
107 attribute_set_read (attr);
108 attribute_set_userflag (attr, MAIL_ATTRIBUTE_SHOWN);
109 107
110 cursor = mspec->msg_part[0]; 108 cursor = mspec->msg_part[0];
111 109
......
...@@ -29,7 +29,6 @@ top0 (msgset_t *mspec, message_t msg, void *data) ...@@ -29,7 +29,6 @@ top0 (msgset_t *mspec, message_t msg, void *data)
29 size_t n; 29 size_t n;
30 off_t off; 30 off_t off;
31 int lines; 31 int lines;
32 attribute_t attr = NULL;
33 32
34 if (util_getenv (&lines, "toplines", Mail_env_number, 1) 33 if (util_getenv (&lines, "toplines", Mail_env_number, 1)
35 || lines < 0) 34 || lines < 0)
...@@ -45,9 +44,8 @@ top0 (msgset_t *mspec, message_t msg, void *data) ...@@ -45,9 +44,8 @@ top0 (msgset_t *mspec, message_t msg, void *data)
45 } 44 }
46 cursor = mspec->msg_part[0]; 45 cursor = mspec->msg_part[0];
47 46
48 message_get_attribute (msg, &attr); 47 util_mark_read (msg);
49 attribute_set_read (attr); 48
50 attribute_set_userflag (attr, MAIL_ATTRIBUTE_SHOWN);
51 return 0; 49 return 0;
52 } 50 }
53 51
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2000, 2001, 2005 Free Software Foundation, Inc.
3 3
4 GNU Mailutils is free software; you can redistribute it and/or modify 4 GNU Mailutils is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
...@@ -28,6 +28,8 @@ undelete0 (msgset_t *mspec, message_t msg, void *data) ...@@ -28,6 +28,8 @@ undelete0 (msgset_t *mspec, message_t msg, void *data)
28 28
29 message_get_attribute (msg, &attr); 29 message_get_attribute (msg, &attr);
30 attribute_unset_deleted (attr); 30 attribute_unset_deleted (attr);
31 util_mark_read (msg);
32
31 if (cursor == 0) 33 if (cursor == 0)
32 cursor = mspec->msg_part[0]; 34 cursor = mspec->msg_part[0];
33 return 0; 35 return 0;
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 1999, 2001 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2001, 2005 Free Software Foundation, Inc.
3 3
4 GNU Mailutils is free software; you can redistribute it and/or modify 4 GNU Mailutils is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
24 static int 24 static int
25 visual0 (msgset_t *mspec, message_t msg, void *data) 25 visual0 (msgset_t *mspec, message_t msg, void *data)
26 { 26 {
27 attribute_t attr = NULL;
28 char *file = mu_tempname (NULL); 27 char *file = mu_tempname (NULL);
29 28
30 util_do_command ("copy %s", file); 29 util_do_command ("copy %s", file);
...@@ -34,8 +33,7 @@ visual0 (msgset_t *mspec, message_t msg, void *data) ...@@ -34,8 +33,7 @@ visual0 (msgset_t *mspec, message_t msg, void *data)
34 free (file); 33 free (file);
35 34
36 /* Mark as read */ 35 /* Mark as read */
37 message_get_attribute (msg, &attr); 36 util_mark_read (msg);
38 attribute_set_read (attr);
39 37
40 cursor = mspec->msg_part[0]; 38 cursor = mspec->msg_part[0];
41 39
......