Skip to content

Commit 7b00131

Browse files
committed
mapi_lib: delete old usercvt functions
1 parent 8cdf41f commit 7b00131

File tree

3 files changed

+4
-29
lines changed

3 files changed

+4
-29
lines changed

include/gromox/usercvt.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ namespace gromox {
1313

1414
using cvt_id2user = ec_error_t (*)(unsigned int, std::string &);
1515
extern GX_EXPORT ec_error_t cvt_essdn_to_username(const char *emaddr, const char *org, cvt_id2user, std::string &);
16-
extern GX_EXPORT ec_error_t cvt_essdn_to_username(const char *emaddr, const char *org, cvt_id2user, char *, size_t);
1716
extern GX_EXPORT ec_error_t cvt_genaddr_to_smtpaddr(const char *atype, const char *emaddr, const char *org, cvt_id2user, std::string &);
18-
extern GX_EXPORT ec_error_t cvt_genaddr_to_smtpaddr(const char *atype, const char *emaddr, const char *org, cvt_id2user, char *, size_t);
1917
/* Only muidEMSAB entryids */
2018
extern GX_EXPORT ec_error_t cvt_emsab_to_essdn(const BINARY *, std::string &);
2119
/* Multiple types of entryids */

lib/mapi/oxcical.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3115,7 +3115,7 @@ static bool oxcical_export_rdate(const char *tzid, bool b_date,
31153115
static void oxcical_export_organizer(const MESSAGE_CONTENT &msg,
31163116
ical_component &com, const char *org_name, cvt_id2user id2user)
31173117
{
3118-
char buf[UADDR_SIZE];
3118+
std::string buf;
31193119
auto str = msg.proplist.get<char>(PR_SENT_REPRESENTING_SMTP_ADDRESS);
31203120
if (str != nullptr) {
31213121
str = msg.proplist.get<char>(PR_SENT_REPRESENTING_ADDRTYPE);
@@ -3127,16 +3127,14 @@ static void oxcical_export_organizer(const MESSAGE_CONTENT &msg,
31273127
str = msg.proplist.get<char>(PR_SENT_REPRESENTING_EMAIL_ADDRESS);
31283128
if (str != nullptr) {
31293129
auto ret = cvt_essdn_to_username(str, org_name,
3130-
std::move(id2user), buf, std::size(buf));
3131-
str = ret == ecSuccess ? buf : nullptr;
3130+
std::move(id2user), buf);
3131+
str = ret == ecSuccess ? buf.c_str() : nullptr;
31323132
}
31333133
}
31343134
}
31353135
if (str == nullptr)
31363136
return;
3137-
char buf1[UADDR_SIZE+10];
3138-
snprintf(buf1, std::size(buf1), "MAILTO:%s", str);
3139-
auto line = &com.append_line("ORGANIZER", buf1);
3137+
auto line = &com.append_line("ORGANIZER", "MAILTO:"s + str);
31403138
str = msg.proplist.get<char>(PR_SENT_REPRESENTING_NAME);
31413139
if (str != nullptr)
31423140
line->append_param("CN", str);

lib/mapi/usercvt.cpp

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,6 @@ ec_error_t cvt_essdn_to_username(const char *idn, const char *org,
4949
return ecServerOOM;
5050
}
5151

52-
ec_error_t cvt_essdn_to_username(const char *idn, const char *org,
53-
cvt_id2user id2user, char *username, size_t ulen)
54-
{
55-
std::string es_result;
56-
auto ret = cvt_essdn_to_username(idn, org, std::move(id2user), es_result);
57-
if (ret == ecSuccess)
58-
gx_strlcpy(username, es_result.c_str(), ulen);
59-
return ret;
60-
}
61-
6252
/**
6353
* ecNullObject is returned to signify that a situation was encountered that is
6454
* equivalent to addrtype not having been present in the first place.
@@ -93,17 +83,6 @@ ec_error_t cvt_genaddr_to_smtpaddr(const char *addrtype, const char *emaddr,
9383
return ecUnknownUser;
9484
}
9585

96-
ec_error_t cvt_genaddr_to_smtpaddr(const char *addrtype, const char *emaddr,
97-
const char *org, cvt_id2user id2user, char *smtpaddr, size_t slen)
98-
{
99-
std::string es_result;
100-
auto ret = cvt_genaddr_to_smtpaddr(addrtype, emaddr, org,
101-
std::move(id2user), es_result);
102-
if (ret == ecSuccess)
103-
gx_strlcpy(smtpaddr, es_result.c_str(), slen);
104-
return ret;
105-
}
106-
10786
static ec_error_t emsab_to_email2(EXT_PULL &ser, const char *org, cvt_id2user id2user,
10887
std::string &smtpaddr)
10988
{

0 commit comments

Comments
 (0)