summaryrefslogtreecommitdiff
path: root/noncore/unsupported/mailit/emailhandler.cpp
authorgroucho <groucho>2003-04-28 08:31:24 (UTC)
committer groucho <groucho>2003-04-28 08:31:24 (UTC)
commit63d3f7ca039d93612abaa4a65fc00b337c42ec9d (patch) (side-by-side diff)
treeea4a08e00d5a229f20c3e4150f707a2ac8f9e882 /noncore/unsupported/mailit/emailhandler.cpp
parentc3b703405fe77fbe16596ebd7d814a6e463f9243 (diff)
downloadopie-63d3f7ca039d93612abaa4a65fc00b337c42ec9d.zip
opie-63d3f7ca039d93612abaa4a65fc00b337c42ec9d.tar.gz
opie-63d3f7ca039d93612abaa4a65fc00b337c42ec9d.tar.bz2
- bug fixes in the parser (from header)
- bug fixes in address selector (uses cc: now) - remove now selects next item afterwards (speeds up mass deletion) - smaller fixes
Diffstat (limited to 'noncore/unsupported/mailit/emailhandler.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/mailit/emailhandler.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/noncore/unsupported/mailit/emailhandler.cpp b/noncore/unsupported/mailit/emailhandler.cpp
index b180051..fbbada7 100644
--- a/noncore/unsupported/mailit/emailhandler.cpp
+++ b/noncore/unsupported/mailit/emailhandler.cpp
@@ -118,36 +118,38 @@ void EmailHandler::getMailHeaders()
popClient->newConnection(mailAccount.popServer, 110);
}
void EmailHandler::getMailByList(MailList *mailList)
{
if (mailList->count() == 0) { //should not occur though
emit mailTransfered(0);
return;
}
headers = FALSE;
popClient->headersOnly(FALSE, 0);
- popClient->newConnection(mailAccount.popServer, 110);
+
+ popClient->setAccount(mailAccount.popUserName,mailAccount.popPasswd);
popClient->setSelectedMails(mailList);
-}
+ popClient->newConnection(mailAccount.popServer, 110);
+ }
-void EmailHandler::messageArrived(const QString &message, int id, uint size, bool incomplete)
+void EmailHandler::messageArrived(const QString &message, int id, uint size, bool complete)
{
Email mail;
mail.rawMail = message;
mail.serverId = id;
mail.size = size;
- mail.downloaded = incomplete;
+ mail.downloaded = complete;
emit mailArrived(mail, FALSE);
}
bool EmailHandler::parse(QString in, QString lineShift, Email *mail)
{
QString temp, boundary;
int pos;
QString delimiter, header, body, mimeHeader, mimeBody;
QString content, contentType, contentAttribute, id, encoding;
QString fileName, storedName;
int enclosureId = 0;
@@ -173,31 +175,29 @@ bool EmailHandler::parse(QString in, QString lineShift, Email *mail)
TextParser p(header, lineShift);
if ((pos = p.find("FROM",':', 0, TRUE)) != -1) {
pos++;
if (p.separatorAt(pos) == ' ') {
mail->from = p.getString(&pos, '<', false);
mail->from = mail->from.stripWhiteSpace();
if ( (mail->from.length() > 2) && (mail->from[0] == '"') ) {
mail->from = mail->from.left(mail->from.length() - 1);
mail->from = mail->from.right(mail->from.length() - 1);
}
pos++;
-
mail->fromMail = p.getString(&pos, '>', false);
} else {
- if ((p.separatorAt(pos) == '<')
- || (p.separatorAt(pos) == ' ')) //No name.. nasty
- pos++;
+ if (p.separatorAt(pos) == '<') //No name.. nasty
pos++;
+ //pos++;
mail->fromMail = p.getString(&pos, 'z', TRUE);
if (mail->fromMail.at(mail->fromMail.length()-1) == '>')
mail->fromMail.truncate(mail->fromMail.length() - 1);
mail->from=mail->fromMail;
}
}
pos=0;
//Search for To: after the FROM: attribute to prevent hitting the Delivered-To:
while((pos = p.find("TO",':', pos+1, TRUE))!=-1)
{