mozilla / releases-comm-central

EXPERIMENTAL - copy of comm-central for forking on github
160 stars 96 forks source link

Email from trash folder is not returned by browser.messages.query in thunderbird webextension #40

Open sourov06 opened 3 years ago

sourov06 commented 3 years ago

I tried to build an extension for thunderbird. For this extension I need to get all email within a particular date. For that reason I called following

let messageList = await browser.messages.query({ fromDate: fromDate, toDate: toDate });

That code works perfectly but it does not return any email from trash. For my extension I need emails from trash too.even I tried to get email from trash folder by specifying trash folder in query list as below:

let selectedFolder = {accountId: this.selectedAccount.trashFolder.accountId, path: this.selectedAccount.trashFolder.path, type: 'trash'}
let trashMessageList = await browser.messages.query({ fromDate: fromDate, toDate: toDate, folder: selectedFolder });

Even that code does not return result but if I run browser.messages.list It returns result perfectly. What am I doing wrong here? is there any solution for that?