HiraokaHyperTools / msgreader

35 stars 9 forks source link

Sent property #26

Closed mynpmpackage closed 2 years ago

mynpmpackage commented 2 years ago

Like MailItem.Sent([https://docs.microsoft.com/en-us/office/vba/api/outlook.mailitem.sent]) ,

Could you please help me knowing which msgreader fieldsdata() parsed property represents Sent?. Sometimes this property Sent help me to decide the email is draft when Sent flag is set to false.

Is it possible to add Sent property to https://hiraokahypertools.github.io/msgreader/typedoc/interfaces/MsgReader.FieldsData.html?

Will the PidTagMessageFlags will help us when mfUnsent is not set?

kenjiuno commented 2 years ago

Thanks, messageFlags will be exposed since 1.14.1-alpha.1

mynpmpackage commented 2 years ago

Thank you for exposing. I will check with 1.14.1-alpha.1 and confirm back.

mynpmpackage commented 2 years ago

As usual I am having local server cache issue and it will take few more hours to get the cache updated with 1.14.1-alpha.1 .

For now, I tried with node cli parse command with the emails in draft box and seeing different values and not 8, Do you know why?

Below are the steps I tried.

  1. Tried Re composing email from inbox and saved as Draft
  2. Drag and Dropped email from draft box to file system folder
  3. Executed node cli parse on the copied email in system folder
  4. MessageFlags value is not 8 and it gives different values like 17 or 45 and so on.

sometimes sent email copied to system folder and executing node cli parse not gives 1

Same when I tried draft email which is created and saved by me gives value as 8

kenjiuno commented 2 years ago

messageFlags are bit fields.

2022-01-31_21h14_06

To extract mfUnsent flag, try Bitwise AND operator. Bitwise AND (&) - JavaScript | MDN

mynpmpackage commented 2 years ago

Okay thanks. Does it mean, we have to check parsed messageFlags values with Bitwise AND operator to derive for draft(unsent)? And if 8 then we have consider as draft email?

kenjiuno commented 2 years ago

Although with some coding msgreader can include sent field, imo it'd be cool if we can handle bit flag processing on local code.

// boolean
const sent = (messageFlags & 8) == 0;
const unsent = (messageFlags & 8) != 0;
mynpmpackage commented 2 years ago

Okay, thanks. I will put in local code.

mynpmpackage commented 2 years ago

Verified with alpha it works, could you please release the version 1.14.1.

kenjiuno commented 2 years ago

Ok 1.14.1 is now ready

mynpmpackage commented 2 years ago

Thank You. I am going to use 1.14.1.

Thanks for the quick fix.