diff options
Diffstat (limited to 'src/messageId.cpp')
| -rw-r--r-- | src/messageId.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/messageId.cpp b/src/messageId.cpp index db59ab6a..72cda2a0 100644 --- a/src/messageId.cpp +++ b/src/messageId.cpp @@ -118,7 +118,7 @@ void messageId::parse(const string& buffer, const string::size_type position, // 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)); @@ -178,6 +178,9 @@ ref <messageId> messageId::parseNext(const string& buffer, const string::size_ty const string messageId::getId() const { + if (m_right.empty()) + return m_left; + return (m_left + '@' + m_right); } @@ -193,7 +196,9 @@ void messageId::generate(utility::outputStream& os, const string::size_type maxL 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; |
