Skip to content

Commit ae86da4

Browse files
committed
exmdb: avoid forced PR_LAST_MODIFICATION_TIME value on write_message RPC
Let an importer provide its own modtimes.
1 parent 98a94fd commit ae86da4

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

exch/exmdb/message.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1588,8 +1588,8 @@ static ec_error_t message_rectify_message(const MESSAGE_CONTENT *src,
15881588
auto &dprop = dst->proplist;
15891589

15901590
dprop.count = 0;
1591-
/* 13 in this function, and at least 2 more in the caller.. */
1592-
dprop.ppropval = cu_alloc<TAGGED_PROPVAL>(sprop.count + 20);
1591+
/* 14 in this function, and at least 2 more in the caller.. */
1592+
dprop.ppropval = cu_alloc<TAGGED_PROPVAL>(sprop.count + 21);
15931593
if (dprop.ppropval == nullptr)
15941594
return ecServerOOM;
15951595
for (unsigned int i = 0; i < sprop.count; ++i) {
@@ -1697,6 +1697,13 @@ static ec_error_t message_rectify_message(const MESSAGE_CONTENT *src,
16971697
if (pvalue != nullptr)
16981698
dprop.emplace_back(PR_LAST_MODIFIER_ENTRYID, pvalue);
16991699
}
1700+
if (!sprop.has(PR_LAST_MODIFICATION_TIME)) {
1701+
auto v = cu_alloc<mapitime_t>();
1702+
if (v == nullptr)
1703+
return ecServerOOM;
1704+
*v = rop_util_current_nttime();
1705+
dprop.emplace_back(PR_LAST_MODIFICATION_TIME, v);
1706+
}
17001707
auto old_cvindex = sprop.get<BINARY>(PR_CONVERSATION_INDEX);
17011708
auto new_cvid = cu_alloc<BINARY>();
17021709
if (new_cvid == nullptr)

lib/mapi/oxcmail.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2550,8 +2550,8 @@ MESSAGE_CONTENT *oxcmail_import(const char *charset, const char *str_zone,
25502550
} else {
25512551
mime_enum.nttime_stamp = *ts;
25522552
}
2553-
if (pmsg->proplist.set(PR_CREATION_TIME, &mime_enum.nttime_stamp) != 0 ||
2554-
pmsg->proplist.set(PR_LAST_MODIFICATION_TIME, &mime_enum.nttime_stamp) != 0)
2553+
if (pmsg->proplist.set(PR_CREATION_TIME, &mime_enum.nttime_stamp) != 0
2554+
/* pmsg->proplist.set(PR_LAST_MODIFICATION_TIME, &mime_enum.nttime_stamp) != 0 */)
25552555
return imp_null;
25562556

25572557
auto head_ct = phead->content_type;

0 commit comments

Comments
 (0)