Skip to content

Commit

Permalink
reply_view: quote only first part when message have alternative parts
Browse files Browse the repository at this point in the history
  • Loading branch information
mawww authored and Maxime Coste committed Oct 3, 2011
1 parent 8f5ac4d commit 7fd1c34
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/reply_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ ReplyView::ReplyView(const std::string & messageId, const View::Geometry & geome
GMimeObject * part = g_mime_message_get_mime_part(originalMessage);

std::vector<std::shared_ptr<MessagePart>> parts;
processMimePart(part, std::back_inserter(parts));
processMimePart(part, std::back_inserter(parts), true);

MessagePartTextVisitor<std::ostream_iterator<std::string>> visitor(
std::ostream_iterator<std::string>(messageContentStream, "\n> "));
Expand Down
7 changes: 6 additions & 1 deletion src/util.hh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ template <typename Type>
};

template <class OutputIterator>
void processMimePart(GMimeObject * part, OutputIterator destination)
void processMimePart(GMimeObject * part, OutputIterator destination,
bool onlyFirstForAlternative = false)
{
GMimeContentType * contentType = g_mime_object_get_content_type(part);

Expand Down Expand Up @@ -92,7 +93,11 @@ template <class OutputIterator>

for (auto subpart = subpartsWithPriority.begin();
subpart != subpartsWithPriority.end(); ++subpart)
{
processMimePart(subpart->first, destination);
if (onlyFirstForAlternative)
break;
}
}
else if (g_mime_content_type_is_type(contentType, "multipart", "*"))
{
Expand Down

0 comments on commit 7fd1c34

Please sign in to comment.