summaryrefslogtreecommitdiff
path: root/noncore/net/mail/libmailwrapper/abstractmail.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/mail/libmailwrapper/abstractmail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/libmailwrapper/abstractmail.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/noncore/net/mail/libmailwrapper/abstractmail.cpp b/noncore/net/mail/libmailwrapper/abstractmail.cpp
index 592cd5e..741a8e1 100644
--- a/noncore/net/mail/libmailwrapper/abstractmail.cpp
+++ b/noncore/net/mail/libmailwrapper/abstractmail.cpp
@@ -1,9 +1,10 @@
#include "abstractmail.h"
#include "imapwrapper.h"
#include "pop3wrapper.h"
+#include "nntpwrapper.h"
#include "mhwrapper.h"
#include "mboxwrapper.h"
#include "mailtypes.h"
#include <qstring.h>
#include <qfile.h>
@@ -19,12 +20,17 @@ AbstractMail* AbstractMail::getWrapper(IMAPaccount *a)
AbstractMail* AbstractMail::getWrapper(POP3account *a)
{
return new POP3wrapper(a);
}
+AbstractMail* AbstractMail::getWrapper(NNTPaccount *a)
+{
+ return new NNTPwrapper(a);
+}
+
AbstractMail* AbstractMail::getWrapper(const QString&a,const QString&name)
{
return new MHwrapper(a,name);
}
encodedString* AbstractMail::decode_String(const encodedString*text,const QString&enc)
@@ -45,26 +51,26 @@ encodedString* AbstractMail::decode_String(const encodedString*text,const QStrin
} else if (enc.lower()=="binary") {
mimetype = MAILMIME_MECHANISM_BINARY;
}
int err = mailmime_part_parse(text->Content(),text->Length(),&index,mimetype,
&result_text,&target_length);
-
+
encodedString* result = new encodedString();
if (err == MAILIMF_NO_ERROR) {
result->setContent(result_text,target_length);
}
qDebug("Decode string finished");
return result;
}
QString AbstractMail::convert_String(const char*text)
{
size_t index = 0;
char*res = 0;
-
+
/* attention - doesn't work with arm systems! */
int err = mailmime_encoded_phrase_parse("iso-8859-1",
text, strlen(text),&index, "iso-8859-1",&res);
if (err != MAILIMF_NO_ERROR) {
if (res) free(res);
return QString(text);