1mail::account::moveMessmaagiels:T:oa(c3cxo)unt Native APImarielf:e:raecnccoeunt::moveMessagesTo(3x)
2
3
4
6 mail::account::copyMessagesTo - Move messages to another folder
7
9 #include <libmail/mail.H>
10
11
12 class myCallback : public mail::callback {
13 public:
14 void success(std::string msg);
15 void fail(std::string msg);
16 };
17
18
19
20 account->moveMessagesTo (const std::vector<size_t> &msgList,
21 mail::folder *copyTo, myCallback &callback);
22
24 mail::account::moveMessagesTo moves messages from the currently-open
25 folder to another folder. msgList specifies a list of messages. Mes‐
26 sages are numbered starting with message #0 and up to one less than
27 mail::account::getFolderIndexSize(3x)() (when mail::account::get‐
28 FolderIndexSize returns 6, the messages are numbered 0 through 5).
29 Only the messages that appear in msgList are processed by this request.
30
31 This is similar to mail::account::copyMessagesTo(3x), except that the
32 messages are removed from the original folder. The application can
33 expect that the mail::account::messagesRemoved function in the cur‐
34 rently opened folder's mail::callback::folder object will be invoked
35 one or more times, as necessary, to reflect the removal of the listed
36 messages from the currently open folder.
37
38 copyTo is a pointer to a mail::folder object, representing the folder
39 where messages are moved to. copyTo may be a folder in another mail
40 account, in which case this function transparently copies the indicated
41 messages using mail::account::removeMessages(3x). Only SMAP and
42 maildir-based mail accounts can move messages directly between folders;
43 for all other accounts the copy/delete implementation will be used
44 automatically.
45
47 The application must wait until callback's success or fail method is
48 invoked. The success method is invoked when this request is succes‐
49 fully processed. The fail method is invoked if this request cannot be
50 processed. The application must not destroy callback until either the
51 success or fail method is invoked.
52
53 Note: callback's fail method may be invoked even after other
54 callback methods were invoked. This indicates that the request
55 was partially completed before the error was encountered.
56
57 Note: Multiple applications may have the same account and folder
58 opened at the same time. It is possible that a message refer‐
59 enced by this request was already deleted by another applica‐
60 tion. Depending on the underlying server implementation this
61 will result in either a failed request, invoking callback.fail,
62 or the request completing (callback.success invoked) but without
63 invoking any callback function that refer to the message.
64
65 Note: If this request is interrupted, for some reason, it is
66 possible that some or all messages have already been copied to
67 the destination folder, but not yet removed from the original
68 folder.
69
71 mail::account::copyMessagesTo(3x), mail::account::open(3x),
72 mail::account::removeMessages(3x).
73
74
75
76 10 April 2006mail::account::moveMessagesTo(3x)