Skip to content

Commit

Permalink
fix(message-upload): Fix message upload if uploading to a child folde…
Browse files Browse the repository at this point in the history
…r of Inbox using MS Graph API
  • Loading branch information
andris9 committed Jan 8, 2025
1 parent bafcd1c commit 2c14b5e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/email-client/outlook-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -1692,7 +1692,7 @@ class OutlookClient extends BaseClient {
return {
mailboxId: mailbox.id,
path: []
.concat(parentFolder?.path || [])
.concat(parentFolder?.pathName || [])
.concat(mailbox.displayName)
.join('/'),
created: true
Expand Down Expand Up @@ -2069,6 +2069,8 @@ class OutlookClient extends BaseClient {

path = [].concat(path || []).join('/');

console.log('RESOLVING FOLDER', { path, options });

let cachedListing = await this.getCachedMailboxListing();
let mailboxListing = cachedListing || (await this.getMailboxListing());

Expand Down Expand Up @@ -2100,7 +2102,7 @@ class OutlookClient extends BaseClient {
if (/^inbox$/i.test(pathParts[0])) {
let inboxFolder = mailboxListing.find(entry => entry.specialUse === '\\Inbox');
if (inboxFolder) {
pathParts[0] = inboxFolder.path;
pathParts[0] = inboxFolder.pathName;
}
}
path = pathParts.join('/');
Expand Down

0 comments on commit 2c14b5e

Please sign in to comment.