-
-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[wip] new-mail notification observer #4077
Draft
roccoblues
wants to merge
9
commits into
main
Choose a base branch
from
roccoblues/new-mail-notifications
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
flatcap
force-pushed
the
roccoblues/new-mail-notifications
branch
2 times, most recently
from
October 29, 2023 16:28
8339a8c
to
9223077
Compare
flatcap
force-pushed
the
roccoblues/new-mail-notifications
branch
2 times, most recently
from
November 16, 2023 19:45
bed0ede
to
55ad274
Compare
flatcap
force-pushed
the
roccoblues/new-mail-notifications
branch
from
January 27, 2024 01:31
55ad274
to
85427b0
Compare
flatcap
force-pushed
the
roccoblues/new-mail-notifications
branch
3 times, most recently
from
March 29, 2024 01:44
b18cb0d
to
49b3d1a
Compare
flatcap
force-pushed
the
roccoblues/new-mail-notifications
branch
from
April 16, 2024 21:30
49b3d1a
to
e829ddc
Compare
flatcap
force-pushed
the
roccoblues/new-mail-notifications
branch
from
May 8, 2024 20:10
e829ddc
to
2c4b76b
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[This is just a proof-of-concept to see if the general connection works]
Trigger the new-mail logic in a notification observer.
IndexPrivateData
to keep track of the notification status per mailboxNT_MAILBOX_NEW_MAIL
index_mailbox_newmail_observer()
listens toNT_MAILBOX
events and updates the hashhandle_new_mail()
is called in the index loop and triggers the new-mail logicWe need the new notification because
mx_mbox_check()
doesn't updateMailbox->has_new
likemx_mbox_check_stats()
. I still think we should only have one method that does the full check. It would make a lot of things simpler.I intentionally made this minimally invasive, to just show the concept. I think this can be a first step to simplifying things. For example
mutt_mailbox_list()
andmutt_mailbox_notify()
could be removed.I didn't polish the message yet. So for multiple mailboxes where one is the current one you get something like
New mail =INBOX, =neomutt-devel
. But this can easily be changed toNew mail in this mailbox and =neomutt-devel
.Also, is a hash the correct data structure? Is the mailbox path guaranteed to be unique?