Teemu Hautala wrote:
> Hi,
>
> I'm creating a kind of message handling/sorting extension and need to
> find a way to move an arriving message to a set folder. Only way to do
> this that I've found out so far is to mimic the right-click popup menu
> "Move To" function which is something like this:
>
> view.doCommandWithFolder(nsMsgViewCommandType.moveMessages, destMsgFolder);
>
> It works, but it's not really what I want, because it requires selecting
> the message, which also causes it to be marked as read. Also the message
> folder has to be active.
>
> The functionality I need is similar to if I had a filter rule with a
> move to folder action in it. To identify the message I want to move, I
> have it's header through nsIMsgDbHdr interface.
>
> Thanks.
Found a way to do this after all with nsIMsgCopyService:
copyService.CopyMessages(aMessage.folder,
msgArray,
iDestMsgFolder,
true /* isMove */,
null,
msgWindow,
false /* no undo */);