Skip to content

Commit f6af1d5

Browse files
committed
ews: improve types of variables
PT_BOOLEAN requires use of uint8_t (not 32).
1 parent de1442a commit f6af1d5

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

exch/ews/context.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2026,7 +2026,7 @@ void EWSContext::toContent(const std::string& dir, tCalendarItem& item, sShape&
20262026
auto addrType = deconst("SMTP");
20272027
shape.write(TAGGED_PROPVAL{PR_SENT_REPRESENTING_ADDRTYPE, addrType});
20282028
shape.write(TAGGED_PROPVAL{PR_SENDER_ADDRTYPE, addrType});
2029-
auto uint0 = construct<uint32_t>(0);
2029+
auto uint0 = construct<uint8_t>(0);
20302030
auto uint1 = construct<uint32_t>(1);
20312031
auto uint5 = construct<uint32_t>(5);
20322032
shape.write(NtMeetingType, TAGGED_PROPVAL{PT_LONG, uint1});
@@ -2218,7 +2218,7 @@ void EWSContext::toContent(const std::string& dir, tItem& item, sShape& shape, M
22182218
if (item.Subject)
22192219
shape.write(TAGGED_PROPVAL{PR_SUBJECT, deconst(item.Subject->c_str())});
22202220

2221-
auto now = EWSContext::construct<uint64_t>(rop_util_current_nttime());
2221+
auto now = EWSContext::construct<mapitime_t>(rop_util_current_nttime());
22222222
shape.write(TAGGED_PROPVAL{PR_CREATION_TIME, now});
22232223
shape.write(TAGGED_PROPVAL{PR_LOCAL_COMMIT_TIME, now});
22242224

@@ -2406,8 +2406,8 @@ void EWSContext::updated(const std::string& dir, const sMessageEntryId& mid, sSh
24062406
if (!m_plugin.exmdb.allocate_cn(dir.c_str(), &changeNum))
24072407
throw DispatchError(E3084);
24082408
uint64_t localCommitTime = rop_util_current_nttime();
2409-
shape.write(TAGGED_PROPVAL{PR_LOCAL_COMMIT_TIME, construct<uint64_t>(localCommitTime)});
2410-
shape.write(TAGGED_PROPVAL{PR_LAST_MODIFICATION_TIME, construct<uint64_t>(localCommitTime)});
2409+
shape.write(TAGGED_PROPVAL{PR_LOCAL_COMMIT_TIME, construct<mapitime_t>(localCommitTime)});
2410+
shape.write(TAGGED_PROPVAL{PR_LAST_MODIFICATION_TIME, construct<mapitime_t>(localCommitTime)});
24112411

24122412
std::string displayName;
24132413
if (mysql_adaptor_get_user_displayname(m_auth_info.username,

exch/ews/requests.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,6 @@ void process(mCreateItemRequest&& request, XMLElement* response, const EWSContex
249249
|| request.SendMeetingInvitations == Enum::SendToAllAndSaveCopy;
250250

251251
data.ResponseMessages.reserve(request.Items.size());
252-
auto proptrue = 1;
253252
for (sItem &item : request.Items) try {
254253
if (!hasAccess)
255254
throw EWSError::AccessDenied(E3130);
@@ -268,16 +267,17 @@ void process(mCreateItemRequest&& request, XMLElement* response, const EWSContex
268267
sentitems.folderId, &newMid))
269268
throw EWSError::InternalServerError(E3132);
270269
BOOL result;
271-
uint64_t messageId = *(*content).proplist.get<uint64_t>(PidTagMid);
270+
auto messageId = *content->proplist.get<const uint64_t>(PidTagMid);
272271
if (!ctx.plugin().exmdb.movecopy_message(dir.c_str(), CP_ACP,
273272
messageId, sentitems.folderId, newMid, false, &result)
274273
|| !result)
275274
throw EWSError::InternalServerError(E3301);
276275
const char* username = ctx.effectiveUser(sentitems);
277276
auto now = EWSContext::construct<uint64_t>(rop_util_current_nttime());
277+
static constexpr uint8_t proptrue = 1;
278278
TAGGED_PROPVAL props[] = {
279279
{PR_MESSAGE_CLASS, deconst("IPM.Schedule.Meeting.Request")},
280-
{PR_RESPONSE_REQUESTED, &proptrue},
280+
{PR_RESPONSE_REQUESTED, deconst(&proptrue)},
281281
{PR_CLIENT_SUBMIT_TIME, now},
282282
{PR_MESSAGE_DELIVERY_TIME, now},
283283
};

0 commit comments

Comments
 (0)