aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2008-06-02 13:39:51 +0800
committerBharath Acharya <abharath@src.gnome.org>2008-06-02 13:39:51 +0800
commitb6442f0191d55e6325e0a111e3513056114fea44 (patch)
tree818d3e013cff5e9fce021d52ca0fc2147660e0e8 /mail
parent48fbd44f442c14639aa923c203b6b9a1c0dfdb1a (diff)
downloadgsoc2013-evolution-b6442f0191d55e6325e0a111e3513056114fea44.tar
gsoc2013-evolution-b6442f0191d55e6325e0a111e3513056114fea44.tar.gz
gsoc2013-evolution-b6442f0191d55e6325e0a111e3513056114fea44.tar.bz2
gsoc2013-evolution-b6442f0191d55e6325e0a111e3513056114fea44.tar.lz
gsoc2013-evolution-b6442f0191d55e6325e0a111e3513056114fea44.tar.xz
gsoc2013-evolution-b6442f0191d55e6325e0a111e3513056114fea44.tar.zst
gsoc2013-evolution-b6442f0191d55e6325e0a111e3513056114fea44.zip
Committing on behalf of Milan Crha <mcrha@redhat.com>
2008-06-02 Milan Crha <mcrha@redhat.com> ** Fix for bug #535749 * message-list.c: (regen_list_exec): Use better condition whether keep cursor_uid in the message list or not on regeneration. svn path=/trunk/; revision=35574
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog7
-rw-r--r--mail/message-list.c26
2 files changed, 26 insertions, 7 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index d99e696db9..0fea6f5750 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,10 @@
+2008-06-02 Milan Crha <mcrha@redhat.com>
+
+ ** Fix for bug #535749
+
+ * message-list.c: (regen_list_exec): Use better condition whether
+ keep cursor_uid in the message list or not on regeneration.
+
2008-06-02 Srinivasa Ragavan <sragavan@novell.com>
** Fix for bug #531836
diff --git a/mail/message-list.c b/mail/message-list.c
index d2cb8000b2..9e5d099202 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -3873,19 +3873,31 @@ regen_list_exec (struct _regen_list_msg *m)
if (expr == NULL) {
uids = camel_folder_get_uids (m->folder);
} else {
- char *tmp_expr = NULL;
+ searchuids = uids = camel_folder_search_by_expression (m->folder, expr, &m->base.ex);
/* If m->changes is not NULL, then it means we are called from folder_changed event,
thus we will keep the selected message to be sure it doesn't disappear because
it no longer belong to our search filter. */
- if (m->changes && m->ml->search && m->ml->cursor_uid) {
- tmp_expr = g_strdup_printf ("(or %s (match-all (uid \"%s\")))", expr, m->ml->cursor_uid);
- expr = tmp_expr;
- }
+ if (m->changes && m->ml->search && m->ml->cursor_uid && uids) {
+ for (i = 0; i < uids->len; i++) {
+ if (g_str_equal (m->ml->cursor_uid, uids->pdata [i]))
+ break;
+ }
- searchuids = uids = camel_folder_search_by_expression (m->folder, expr, &m->base.ex);
+ /* cursor_uid has been filtered out */
+ if (i == uids->len) {
+ gboolean was_deleted = (camel_folder_get_message_flags (m->folder, m->ml->cursor_uid) & CAMEL_MESSAGE_DELETED) != 0;
+
+ /* I would really like to check for CAMEL_MESSAGE_FOLDER_FLAGGED on a message,
+ so I would know whether it was changed locally, and then just check the changes
+ struct whether change came from the server, but with periodical save it doesn't
+ matter. So here just check whether the file was deleted and we show it based
+ on the flag whether we can view deleted messages or not. */
- g_free (tmp_expr);
+ if (!was_deleted || (was_deleted && !m->hidedel))
+ g_ptr_array_add (uids, g_strdup (m->ml->cursor_uid));
+ }
+ }
}
if (camel_exception_is_set (&m->base.ex))