MCPcopy Create free account
hub / github.com/MailCore/mailcore2 / fillWithInfo

Method fillWithInfo

src/core/provider/MCNetService.cpp:46–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46void NetService::fillWithInfo(HashMap * info)
47{
48 bool ssl = false;
49 bool starttls = false;
50
51 setHostname((String *) info->objectForKey(MCSTR("hostname")));
52 if (info->objectForKey(MCSTR("port")) != NULL) {
53 setPort(((Value *) info->objectForKey(MCSTR("port")))->intValue());
54 }
55 if (info->objectForKey(MCSTR("ssl")) != NULL) {
56 ssl = ((Value *) info->objectForKey(MCSTR("ssl")))->boolValue();
57 }
58 if (info->objectForKey(MCSTR("starttls")) != NULL) {
59 starttls = ((Value *) info->objectForKey(MCSTR("starttls")))->boolValue();
60 }
61 if (ssl) {
62 mConnectionType = ConnectionTypeTLS;
63 }
64 else if (starttls) {
65 mConnectionType = ConnectionTypeStartTLS;
66 }
67 else {
68 mConnectionType = ConnectionTypeClear;
69 }
70}
71
72void NetService::setHostname(String *hostname)
73{

Callers 1

serviceWithInfoMethod · 0.45

Calls 3

objectForKeyMethod · 0.80
boolValueMethod · 0.80
intValueMethod · 0.45

Tested by

no test coverage detected