blob: 3cf3276be181d1c741fb7980df7feed40cbd66c1 (
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
33
34
35
36
37
38
39
|
#include "cc.hpp"
namespace smtp::message::builder
{
Cc::Cc( manage::MailsSet const& mail_to )
: mMailTo( mail_to )
{
}
std::string Cc::Get() const
{
std::string result;
if( mBase )
{
result = mBase->Get();
}
if( mMailTo.empty() )
{
return result;
}
for( const auto& cc : mMailTo )
{
if( !IsFirstElement( cc ) )
{
result += "Cc: " + cc + "\r\n";
}
}
return result;
}
bool Cc::IsFirstElement( std::string const& cc ) const
{
return cc == *mMailTo.begin();
}
}
|