Skip to content

Commit 20b3ee0

Browse files
committed
mod_webmail: Update counts when messages in other mailboxes are read.
Include message flags in personal update set, so that if messages are read in a folder besides the selected one, we get updated and reflect the new unread count immediately. Previously, this was only done for the currently selected folder, so it was common for users to click on a different folder showing an unread count, only for that to get updated at that point to reflect all the messages read in the interim. By updating these counts in real time we provide a better user experience.
1 parent 6d43670 commit 20b3ee0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/mod_webmail.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,12 +1130,12 @@ static int client_list_command(struct imap_client *client, struct mailimap *imap
11301130
/* We just want notifications when something happens, having an untagged FETCH sent to us isn't that important.
11311131
* We can wake up and do some work if really needed. */
11321132
if (dynstr.buf) {
1133-
snprintf(cmd, sizeof(cmd), "NOTIFY SET (SELECTED-DELAYED (MessageNew MessageExpunge FlagChange)) %s(personal (MessageNew MessageExpunge)) (mailboxes%s (MessageNew MessageExpunge))",
1133+
snprintf(cmd, sizeof(cmd), "NOTIFY SET (SELECTED-DELAYED (MessageNew MessageExpunge FlagChange)) %s(personal (MessageNew MessageExpunge FlagChange)) (mailboxes%s (MessageNew MessageExpunge))",
11341134
numother <= OTHER_USERS_WATCHALL_THRESHOLD ? "(subtree \"Other Users\" (MessageNew MessageExpunge FlagChange))" : "",
11351135
dynstr.buf);
11361136
FREE(dynstr.buf);
11371137
} else {
1138-
snprintf(cmd, sizeof(cmd), "NOTIFY SET (SELECTED-DELAYED (MessageNew MessageExpunge FlagChange)) (personal (MessageNew MessageExpunge))%s", numother ? " (subtree \"Other Users\" (MessageNew MessageExpunge))" : "");
1138+
snprintf(cmd, sizeof(cmd), "NOTIFY SET (SELECTED-DELAYED (MessageNew MessageExpunge FlagChange)) (personal (MessageNew MessageExpunge FlagChange))%s", numother ? " (subtree \"Other Users\" (MessageNew MessageExpunge))" : "");
11391139
}
11401140
res = mailimap_custom_command(imap, cmd);
11411141
if (MAILIMAP_ERROR(res)) {

0 commit comments

Comments
 (0)