Diffstat (limited to 'noncore/net/mail/libmailwrapper') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/abstractmail.cpp | 13 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/abstractmail.h | 1 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.cpp | 30 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.h | 1 |
4 files changed, 45 insertions, 0 deletions
diff --git a/noncore/net/mail/libmailwrapper/abstractmail.cpp b/noncore/net/mail/libmailwrapper/abstractmail.cpp index 4b4c728..0280803 100644 --- a/noncore/net/mail/libmailwrapper/abstractmail.cpp +++ b/noncore/net/mail/libmailwrapper/abstractmail.cpp | |||
@@ -124,2 +124,15 @@ void AbstractMail::mvcpAllMails(Folder*fromFolder,const QString&targetFolder,Abs | |||
124 | } | 124 | } |
125 | } | 125 | } |
126 | |||
127 | void AbstractMail::mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) | ||
128 | { | ||
129 | encodedString*st = 0; | ||
130 | st = fetchRawBody(mail); | ||
131 | if (st) { | ||
132 | targetWrapper->storeMessage(st->Content(),st->Length(),targetFolder); | ||
133 | delete st; | ||
134 | } | ||
135 | if (moveit) { | ||
136 | deleteMail(mail); | ||
137 | } | ||
138 | } | ||
diff --git a/noncore/net/mail/libmailwrapper/abstractmail.h b/noncore/net/mail/libmailwrapper/abstractmail.h index 8debaae..f93bab4 100644 --- a/noncore/net/mail/libmailwrapper/abstractmail.h +++ b/noncore/net/mail/libmailwrapper/abstractmail.h | |||
@@ -37,4 +37,5 @@ public: | |||
37 | 37 | ||
38 | virtual void mvcpAllMails(Folder*fromFolder,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | 38 | virtual void mvcpAllMails(Folder*fromFolder,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); |
39 | virtual void mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | ||
39 | 40 | ||
40 | virtual void cleanMimeCache(){}; | 41 | virtual void cleanMimeCache(){}; |
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp index 98634a3..4b633ea 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp | |||
@@ -1057,2 +1057,32 @@ void IMAPwrapper::mvcpAllMails(Folder*fromFolder,const QString&targetFolder,Abst | |||
1057 | } | 1057 | } |
1058 | } | 1058 | } |
1059 | |||
1060 | void IMAPwrapper::mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) | ||
1061 | { | ||
1062 | if (targetWrapper != this) { | ||
1063 | qDebug("Using generic"); | ||
1064 | AbstractMail::mvcpMail(mail,targetFolder,targetWrapper,moveit); | ||
1065 | return; | ||
1066 | } | ||
1067 | mailimap_set *set = 0; | ||
1068 | login(); | ||
1069 | if (!m_imap) { | ||
1070 | return; | ||
1071 | } | ||
1072 | int err = selectMbox(mail.getMbox()); | ||
1073 | if ( err != MAILIMAP_NO_ERROR ) { | ||
1074 | return; | ||
1075 | } | ||
1076 | set = mailimap_set_new_single(mail.getNumber()); | ||
1077 | err = mailimap_copy(m_imap,set,targetFolder.latin1()); | ||
1078 | mailimap_set_free( set ); | ||
1079 | if ( err != MAILIMAP_NO_ERROR ) { | ||
1080 | QString error_msg = tr("error copy mail: %1").arg(m_imap->imap_response); | ||
1081 | Global::statusMessage(error_msg); | ||
1082 | qDebug(error_msg); | ||
1083 | return; | ||
1084 | } | ||
1085 | if (moveit) { | ||
1086 | deleteMail(mail); | ||
1087 | } | ||
1088 | } | ||
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.h b/noncore/net/mail/libmailwrapper/imapwrapper.h index 99986c2..c10f86a 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.h +++ b/noncore/net/mail/libmailwrapper/imapwrapper.h | |||
@@ -33,4 +33,5 @@ public: | |||
33 | virtual void storeMessage(const char*msg,size_t length, const QString&folder); | 33 | virtual void storeMessage(const char*msg,size_t length, const QString&folder); |
34 | virtual void mvcpAllMails(Folder*fromFolder,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | 34 | virtual void mvcpAllMails(Folder*fromFolder,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); |
35 | virtual void mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | ||
35 | 36 | ||
36 | virtual RecBody fetchBody(const RecMail&mail); | 37 | virtual RecBody fetchBody(const RecMail&mail); |