summaryrefslogtreecommitdiff
path: root/libraries/libvmime-zarafa/zarafa-patches/vmime-contentid-without-at.diff
blob: 97af9290c4a1f96c119d3e7f15c95667f0d87a84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
--- libvmime-0.7.1.orig/src/messageId.cpp	2005-03-27 14:59:12.000000000 +0200
+++ libvmime-0.7.1.patched/src/messageId.cpp	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;