I am writing a plug-in for the Notes client using the C API that needs to perform an action when a message is opened. I have registered a callback through the extension manager using EM_NIFOPENNOTE. This all works, but my callback gets called many times for each time I open a message. It also gets called when I’m not opening a message at all (e.g. it gets called many times when I archive a message). I am trying to filter out these calls so that I only do my processing once, when the message is displayed.
I know how to access the name of the form that is being used, so I can filter out some of the calls by checking for things like ‘Memo’ and ‘Reply’, but this seems like a hack.
I would expect the OpenFlags to contain some useful information. Unfortunately from the documentation I don’t see how any of these flags mean what I am after. More importantly, why are only some of the flags published? By doing a lot of debugging, it appears to me that the unpublished flag 0x0010 is only set when the message is being displayed (including in the preview pane). Is this what this flag means? Why isn’t it documented?
As something of an aside, am I even going about this correctly? Is there a better way to figure out how to do some processing once per message open?
Many thanks.