[Users] Messages not marked as read in UI
Olaf Hering
olaf at aepfle.de
Wed Nov 15 17:28:14 CET 2017
On Tue, May 02, Olaf Hering wrote:
> When setting a conversation to ignore the UI us not fully updated:
>
> Gmail IMAP folder, folder view set to threaded, all conversations collapsed, sorted by date, ascending.
> Regular poll interval finds new messages in a folder, all new messages are part of a new conversation.
> Shift+g to jump to this folder.
> The new first mail in conversation is selected and opened.
> Select Message->Mark->Ignore conversation.
> The folder is marked as read in the folder list on the left side, no new messages anymore.
> The conversation in message list is still selected, but still marked as unread/bold.
> Shift+p to move to previous conversation, but the new conversation still marked as unread/bold.
>
> To actually show it as read: either wait for the next poll interval or select another folder, then move back.
Today I tried to get to the root of this bug. I'm not familiar with the
code. To me it looks like summary_ignore_thread iterates through all
selected messages. The first message calls summary_ignore_thread_func,
which clears NEW/UNREAD. Then summary_set_row_marks is called. This
function calls summary_have_unread_children in case the row is collapsed
and has childred, which I think is all true. As a result style is set to
bold_style, which I think is used to draw the first message.
It seems to work if first all messages are marked as unread, and after
that if all messages are drawn:
diff --git a/src/summaryview.c b/src/summaryview.c
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -7674,9 +7674,8 @@ static gint summary_cmp_by_score(GtkCMCList *clist,
return summary_cmp_by_date(clist, ptr1, ptr2);
}
-static void summary_ignore_thread_func(GtkCMCTree *ctree, GtkCMCTreeNode *row, gpointer data)
+static void summary_ignore_thread_func_mark_unread(GtkCMCTree *ctree, GtkCMCTreeNode *row, gpointer data)
{
- SummaryView *summaryview = (SummaryView *) data;
MsgInfo *msginfo;
msginfo = gtk_cmctree_node_get_row_data(ctree, row);
@@ -7685,6 +7684,18 @@ static void summary_ignore_thread_func(GtkCMCTree *ctree, GtkCMCTreeNode *row, g
summary_msginfo_unset_flags(msginfo, MSG_WATCH_THREAD, 0);
summary_msginfo_change_flags(msginfo, MSG_IGNORE_THREAD, 0, MSG_NEW | MSG_UNREAD, 0);
+ debug_print("Message %d is marked as ignore thread\n",
+ msginfo->msgnum);
+}
+
+static void summary_ignore_thread_func_set_row(GtkCMCTree *ctree, GtkCMCTreeNode *row, gpointer data)
+{
+ SummaryView *summaryview = (SummaryView *) data;
+ MsgInfo *msginfo;
+
+ msginfo = gtk_cmctree_node_get_row_data(ctree, row);
+ cm_return_if_fail(msginfo);
+
summary_set_row_marks(summaryview, row);
debug_print("Message %d is marked as ignore thread\n",
msginfo->msgnum);
@@ -7699,7 +7710,12 @@ void summary_ignore_thread(SummaryView *summaryview)
START_LONG_OPERATION(summaryview, FALSE);
for (cur = GTK_CMCLIST(ctree)->selection; cur != NULL && cur->data != NULL; cur = cur->next)
gtk_cmctree_pre_recursive(ctree, GTK_CMCTREE_NODE(cur->data),
- GTK_CMCTREE_FUNC(summary_ignore_thread_func),
+ GTK_CMCTREE_FUNC(summary_ignore_thread_func_mark_unread),
+ summaryview);
+
+ for (cur = GTK_CMCLIST(ctree)->selection; cur != NULL && cur->data != NULL; cur = cur->next)
+ gtk_cmctree_pre_recursive(ctree, GTK_CMCTREE_NODE(cur->data),
+ GTK_CMCTREE_FUNC(summary_ignore_thread_func_set_row),
summaryview);
END_LONG_OPERATION(summaryview);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.claws-mail.org/pipermail/users/attachments/20171115/ad347082/attachment.sig>
More information about the Users
mailing list