Description
-
Called when user wants to move message to other
folder.
Return Type
-
None
Syntax
-
object.MoveMessage Owner,
User, Folder, Message,
Destination, Action
The MoveMessage Method syntax has these parts:
object |
An expression evaluating to an object
of type IwodImapNotify. |
Owner |
Required. A wodImapServer
object. |
User |
Required. An ImapUser object.
Reference to user what wants to move the message. |
Folder |
Required. An ImapFolder
object. Reference to folder that contains message that
is to be moved. |
Message |
Required. An ImapMessage
object. Reference to message that should be moved. |
Destination |
Required. An ImapFolder
object. Reference to destination folder that will
receive the message. |
Action |
Required. An ImapActions
enumeration, as described in settings. Return value you
should fill with either Allow or Deny value, depending
if you will allow user to move message or not. |
Settings
-
The settings for Action are:
|
Deny |
0 |
Deny execution of the
action. |
|
Allow |
1 |
Allow to execute
action. |
Remarks
-
NOTE: This method is called only if you
implemented IwodImapNotify interface in your application,
and wodImapServer1.Notification
property has received reference to instance of your
implementation.
This notification method is called when user decides to
move the message from one folder to another. Typical
example would be when user wants to move some message to
Trash folder. You can allow this message by setting
Action = Allow, or deny it.
If you decide you will allow message to be moved, you
should:
1. Remove reference to message from origination folder
2. Add reference to message to destination folder
3. Physically move message from one location to another -
if your code works that way
4. Update (or check) if Message.UID is
set
5. Set Action = Allow
Moving messages is easy because (depending on your code)
you should only move references, not the actual contents.
Don't forget to store Message.Flags
if necessary - they are not changed when you move
message.
Message.UID should be changed when message is moved to new
folder. This will be done automatically by wodImapServer
(using Folder.NextMessageUID
property) but you can also override that setting using some
value from your storage.
|