Skip to content

Commit

Permalink
Add support for IPM.ApchPerson message objects
Browse files Browse the repository at this point in the history
  • Loading branch information
Jmcleodfoss committed Jul 22, 2020
1 parent 405cd25 commit 2615fed
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pst/src/main/java/io/github/jmcleodfoss/pst/Folder.java
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,9 @@ public String getNodeText(Object o)
if (o instanceof Folder)
return ((Folder)o).displayName;

if (o instanceof PersonMetadata)
return ((PersonMetadata)o).internetMessageId;

if (o instanceof StickyNote)
return ((StickyNote)o).subject;

Expand Down
13 changes: 13 additions & 0 deletions pst/src/main/java/io/github/jmcleodfoss/pst/IPM.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ class IPM
*/
private static final String OOO_TEMPLATE = "IPM.Note.Rules.OOfTemplate.Microsoft";

/** The string used for person metadata entries.
* This is used in OST 2013 files, and does not seem to be documented anywhere. */
private static final String PERSON_METADATA = "IPM.AbchPerson";

/** The string used for notes posted in a folder.
* @see <a href="https://docs.microsoft.com/en-us/office/vba/outlook/concepts/forms/item-types-and-message-classes">Iten Types and Messages</a>
*/
Expand Down Expand Up @@ -160,6 +164,7 @@ class IPM
knownClasses.add(NOTE);
knownClasses.add(IMC_NOTIFICATION);
knownClasses.add(OOO_TEMPLATE);
knownClasses.add(PERSON_METADATA);
knownClasses.add(POST);
knownClasses.add(STICKYNOTE);
knownClasses.add(RECALL_REPORT);
Expand Down Expand Up @@ -235,6 +240,14 @@ static boolean isNote(String messageClass)
return NOTE.equals(messageClass);
}

/** Is the given message a person metadata object?
* @param messageClass The message class to check.
* @return true if the given message's class is IPM.Note.
*/
static boolean isPersonMetadata(String messageClass)
{
return PERSON_METADATA.equals(messageClass);
}
/** Is the given folder a sticky note?
* @param messageClass The message class to check.
* @return true if the given message's class is IPM.StickyNote.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ static MessageObject factory(TableContext contentsTable, final int row, final Bl
if (IPM.isJournalEntry(messageType))
return new JournalEntry(contentsTable, row, nbt, pstFile);

if (IPM.isPersonMetadata(messageType))
return new PersonMetadata(contentsTable, row, nbt, pstFile);

if (IPM.isStickyNote(messageType))
return new StickyNote(contentsTable, row, nbt, pstFile);

Expand Down

0 comments on commit 2615fed

Please sign in to comment.