Permalink
Browse files

Properly account for tags when adding/removing them

  • Loading branch information...
1 parent f76b34c commit a57ccb6a2eebb361f37a4b27e25fc2b407722d49 @wereHamster committed Mar 26, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/message.cc
View
6 src/message.cc
@@ -64,11 +64,12 @@ Message::~Message()
void Message::removeTag(std::string tag)
{
notmuch_message_remove_tag(_message, tag.c_str());
+ tags.erase(tag);
}
void Message::removeTagRecursive(std::string tag)
{
- notmuch_message_remove_tag(_message, tag.c_str());
+ removeTag(tag);
for (Message m : replies) {
m.removeTagRecursive(tag);
@@ -78,11 +79,12 @@ void Message::removeTagRecursive(std::string tag)
void Message::addTag(std::string tag)
{
notmuch_message_add_tag(_message, tag.c_str());
+ tags.insert(tag);
}
void Message::addTagRecursive(std::string tag)
{
- notmuch_message_add_tag(_message, tag.c_str());
+ addTag(tag);
for (Message m : replies) {
m.addTagRecursive(tag);

0 comments on commit a57ccb6

Please sign in to comment.