Skip to content

Commit 05c5a39

Browse files
committed
ews: include ParentFolderId in FindFolder/GetFolder response
Some clients expect the GetFolder request with BaseShape=AllProperties to include the parent folder id. Output it. References: GXF-2252, DESK-3679
1 parent d394c12 commit 05c5a39

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

exch/ews/structures.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3365,6 +3365,18 @@ void tFolderResponseShape::tags(sShape& shape) const
33653365
if (baseShape >= 1)
33663366
for (uint32_t tag : tagsDefault)
33673367
shape.add(tag, sShape::FL_FIELD);
3368+
if (baseShape == 2) {
3369+
/* "tagsAll" is really an _extra_ list (over default), not "all" */
3370+
for (uint32_t tag : tagsAll)
3371+
shape.add(tag, sShape::FL_FIELD);
3372+
3373+
/* XXX
3374+
bool is_root = ... == PRIVATE_FID_ROOT;
3375+
if (is_root)
3376+
for (uint32_t tag : tagsAllRootOnly)
3377+
shape.add(tag, sShape::FL_FIELD);
3378+
*/
3379+
}
33683380
if (AdditionalProperties)
33693381
for (const auto& additional : *AdditionalProperties)
33703382
additional.tags(shape);

exch/ews/structures.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2534,6 +2534,13 @@ struct tFolderResponseShape {
25342534
static constexpr uint32_t tagsStructural[] = {PR_CONTAINER_CLASS, PR_FOLDER_TYPE};
25352535
static constexpr uint32_t tagsIdOnly[] = {PR_ENTRYID, PR_CHANGE_KEY};
25362536
static constexpr uint32_t tagsDefault[] = {PR_DISPLAY_NAME, PR_CONTENT_COUNT, PR_FOLDER_CHILD_COUNT, PR_CONTENT_UNREAD};
2537+
/*
2538+
https://learn.microsoft.com/en-us/exchange/client-developer/web-service-reference/baseshape
2539+
"All" = "all the properties used by the Exchange Business Logic layer", for whatever that means.
2540+
Here, it means tagsDefault + {our extra list}.
2541+
*/
2542+
static constexpr uint32_t tagsAll[] = {PR_PARENT_ENTRYID, PR_CREATION_TIME, PR_LAST_MODIFICATION_TIME, PR_ATTR_HIDDEN, PR_ATTR_READONLY, PR_CONTAINER_FLAGS, PR_RECORD_KEY, PR_STORE_ENTRYID, PR_ACCESS, PR_ACCESS_LEVEL};
2543+
static constexpr uint32_t tagsAllRootOnly[] = {PR_IPM_SUBTREE_ENTRYID, PR_SENTMAIL_ENTRYID};
25372544
};
25382545

25392546
/**

0 commit comments

Comments
 (0)