Skip to content
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

Allow to tag sent messages with same tags as message being replied to #581

Closed
wants to merge 3 commits into from

Conversation

larskotthoff
Copy link
Contributor

@larskotthoff larskotthoff commented Oct 20, 2018

This PR introduces special values to accounts.<account>.additional_sent_tags, namely * (apply all tags that the message being replied to, if any, has), and -<tag> (to exclude tags from being applied). For example, the option "foo,*,-attachment" applies the tag "foo" and any tags the message being replied to has, except for "attachment".

Copy link
Member

@gauteh gauteh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks good, see inline comment.


if (!parent_mid.empty () &&
find(additional_sent_tags.begin(), additional_sent_tags.end(), "*") != additional_sent_tags.end()) {
notmuch_message_t * parent_msg;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably better to use on_message here, takes care of cleaning up the parent_msg. Might also be better to instantiate a NotmuchMessage on parent_msg, there is already a get_tags function which is more robust. NotmuchMessage should be cheap objects.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I'll have a look at that.

@mxmehl
Copy link
Contributor

mxmehl commented Oct 21, 2018

Interesting approach! #317 goes into a similar direction, especially for initial messages starting a new thread.

Could the work of this PR make realisation of #317 easier?

@gauteh
Copy link
Member

gauteh commented Oct 21, 2018 via email

@gauteh
Copy link
Member

gauteh commented Oct 21, 2018 via email

@larskotthoff
Copy link
Contributor Author

Good idea, I'll add that.

@larskotthoff
Copy link
Contributor Author

I've changed the code to use NotmuchMessage. Turns out that this syntax for the general mail.sent_tags was already supported because I'm doing the processing after merging in those tags.

@gauteh
Copy link
Member

gauteh commented Oct 27, 2018 via email

@larskotthoff
Copy link
Contributor Author

Thanks, done!

@gauteh gauteh closed this Oct 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants