Sophie

Sophie

distrib > Fedora > 13 > i386 > media > updates-src > by-pkgid > e548512dcc847653815f1b7adc710b15 > files > 10

libvmime07-0.7.1-4.fc13.src.rpm

Patch by Zarafa <http://www.zarafa.com/> - enables re-generation of broken content-id's that had no @ sign
in them.

--- libvmime-0.7.1/src/messageId.cpp					2005-03-27 14:59:12.000000000 +0200
+++ libvmime-0.7.1/src/messageId.cpp.contentid-without-at		2007-07-31 14:14:38.827718500 +0200
@@ -102,7 +102,7 @@
 		// Extract left part
 		const string::size_type leftStart = position + (p - pstart);
 
-		while (p < pend && *p != '@') ++p;
+		while (p < pend && *p != '@' && *p != '>') ++p;
 
 		m_left = string(buffer.begin() + leftStart,
 		                buffer.begin() + position + (p - pstart));
@@ -162,6 +162,8 @@
 
 const string messageId::getId() const
 {
+	if (m_right == "")
+		return m_left;
 	return (m_left + '@' + m_right);
 }
 
@@ -177,7 +179,10 @@
 		pos = NEW_LINE_SEQUENCE_LENGTH;
 	}
 
-	os << '<' << m_left << '@' << m_right << '>';
+	os << '<' << m_left;
+	if (m_right != "")
+		os << '@' << m_right;
+	os << '>';
 
 	if (newLinePos)
 		*newLinePos = pos + m_left.length() + m_right.length() + 3;