Allow to tag sent messages with same tags as message being replied to by larskotthoff · Pull Request #581 · astroidmail/astroid · GitHub
Skip to content

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

Closed
larskotthoff wants to merge 3 commits into
astroidmail:masterfrom
larskotthoff:master
Closed

Allow to tag sent messages with same tags as message being replied to#581
larskotthoff wants to merge 3 commits into
astroidmail:masterfrom
larskotthoff:master

Conversation

@larskotthoff

@larskotthoff larskotthoff commented Oct 20, 2018

Copy link
Copy Markdown
Contributor

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".

@gauteh gauteh left a comment

Copy link
Copy Markdown
Member

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.

Comment thread src/db.cc

Copy link
Copy Markdown
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
Copy Markdown
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

mxmehl commented Oct 21, 2018

Copy link
Copy Markdown
Contributor

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

gauteh commented Oct 21, 2018 via email

Copy link
Copy Markdown
Member

@gauteh

gauteh commented Oct 21, 2018 via email

Copy link
Copy Markdown
Member

@larskotthoff

Copy link
Copy Markdown
Contributor Author

Good idea, I'll add that.

@larskotthoff

Copy link
Copy Markdown
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

gauteh commented Oct 27, 2018 via email

Copy link
Copy Markdown
Member

@larskotthoff

Copy link
Copy Markdown
Contributor Author

@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