summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/composemail.cpp17
-rw-r--r--noncore/net/mail/composemail.h6
-rw-r--r--noncore/net/mail/libmailwrapper/mailtypes.cpp13
-rw-r--r--noncore/net/mail/libmailwrapper/mailtypes.h4
-rw-r--r--noncore/net/mail/libmailwrapper/mailwrapper.h3
-rw-r--r--noncore/net/mail/libmailwrapper/smtpwrapper.cpp29
-rw-r--r--noncore/net/mail/viewmail.cpp6
7 files changed, 61 insertions, 17 deletions
diff --git a/noncore/net/mail/composemail.cpp b/noncore/net/mail/composemail.cpp
index f8ac76f..b5cd75b 100644
--- a/noncore/net/mail/composemail.cpp
+++ b/noncore/net/mail/composemail.cpp
@@ -16,2 +16,3 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m
16 settings = s; 16 settings = s;
17 m_replyid = "";
17 18
@@ -86,10 +87,3 @@ void ComposeMail::setTo( const QString & to )
86{ 87{
87/* QString toline; 88 toLine->setText( to );
88 QStringList toEntry = to;
89 for ( QStringList::Iterator it = toEntry.begin(); it != toEntry.end(); ++it ) {
90 toline += (*it);
91 }
92 toLine->setText( toline );
93*/
94toLine->setText( to );
95} 89}
@@ -103,3 +97,3 @@ void ComposeMail::setInReplyTo( const QString & messageId )
103{ 97{
104 98 m_replyid = messageId;
105} 99}
@@ -209,2 +203,7 @@ void ComposeMail::accept()
209 mail->setSubject( subjectLine->text() ); 203 mail->setSubject( subjectLine->text() );
204 if (!m_replyid.isEmpty()) {
205 QStringList ids;
206 ids.append(m_replyid);
207 mail->setInreply(ids);
208 }
210 QString txt = message->text(); 209 QString txt = message->text();
diff --git a/noncore/net/mail/composemail.h b/noncore/net/mail/composemail.h
index 604c862..886fb1d 100644
--- a/noncore/net/mail/composemail.h
+++ b/noncore/net/mail/composemail.h
@@ -56,8 +56,6 @@ private slots:
56 56
57 57protected:
58
59private:
60 Settings *settings; 58 Settings *settings;
61 QList<SMTPaccount> smtpAccounts; 59 QList<SMTPaccount> smtpAccounts;
62 60 QString m_replyid;
63}; 61};
diff --git a/noncore/net/mail/libmailwrapper/mailtypes.cpp b/noncore/net/mail/libmailwrapper/mailtypes.cpp
index bf91c63..96e0fd5 100644
--- a/noncore/net/mail/libmailwrapper/mailtypes.cpp
+++ b/noncore/net/mail/libmailwrapper/mailtypes.cpp
@@ -36,2 +36,3 @@ void RecMail::copy_old(const RecMail&old)
36 wrapper = old.wrapper; 36 wrapper = old.wrapper;
37 in_reply_to = old.in_reply_to;
37} 38}
@@ -43,2 +44,3 @@ void RecMail::init()
43 bcc.clear(); 44 bcc.clear();
45 in_reply_to.clear();
44 wrapper = 0; 46 wrapper = 0;
@@ -86,2 +88,13 @@ const QStringList& RecMail::Bcc()const
86 88
89void RecMail::setInreply(const QStringList&list)
90{
91 in_reply_to = list;
92}
93
94const QStringList& RecMail::Inreply()const
95{
96 return in_reply_to;
97}
98
99
87RecPart::RecPart() 100RecPart::RecPart()
diff --git a/noncore/net/mail/libmailwrapper/mailtypes.h b/noncore/net/mail/libmailwrapper/mailtypes.h
index b2047cb..1420f79 100644
--- a/noncore/net/mail/libmailwrapper/mailtypes.h
+++ b/noncore/net/mail/libmailwrapper/mailtypes.h
@@ -61,2 +61,4 @@ public:
61 const QStringList&Bcc()const; 61 const QStringList&Bcc()const;
62 void setInreply(const QStringList&list);
63 const QStringList&Inreply()const;
62 const QBitArray&getFlags()const{return msg_flags;} 64 const QBitArray&getFlags()const{return msg_flags;}
@@ -71,3 +73,3 @@ protected:
71 QBitArray msg_flags; 73 QBitArray msg_flags;
72 QStringList to,cc,bcc; 74 QStringList to,cc,bcc,in_reply_to;
73 AbstractMail*wrapper; 75 AbstractMail*wrapper;
diff --git a/noncore/net/mail/libmailwrapper/mailwrapper.h b/noncore/net/mail/libmailwrapper/mailwrapper.h
index caaa3a2..3a9f97b 100644
--- a/noncore/net/mail/libmailwrapper/mailwrapper.h
+++ b/noncore/net/mail/libmailwrapper/mailwrapper.h
@@ -57,2 +57,4 @@ public:
57 void setReply( const QString&a ) { reply = a; } 57 void setReply( const QString&a ) { reply = a; }
58 void setInreply(const QStringList&list){m_in_reply_to = list;}
59 const QStringList&Inreply()const{return m_in_reply_to;}
58 60
@@ -61,2 +63,3 @@ private:
61 QString name, mail, to, cc, bcc, reply, subject, message; 63 QString name, mail, to, cc, bcc, reply, subject, message;
64 QStringList m_in_reply_to;
62}; 65};
diff --git a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
index d7a005e..63acfd5 100644
--- a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
@@ -151,2 +151,3 @@ mailimf_fields *SMTPwrapper::createImfFields(const Mail&mail ) {
151 mailimf_address_list *to=0, *cc=0, *bcc=0, *reply=0; 151 mailimf_address_list *to=0, *cc=0, *bcc=0, *reply=0;
152 clist*in_reply_to = 0;
152 char *subject = strdup( mail.getSubject().latin1() ); 153 char *subject = strdup( mail.getSubject().latin1() );
@@ -177,5 +178,31 @@ mailimf_fields *SMTPwrapper::createImfFields(const Mail&mail ) {
177 reply = parseAddresses( mail.getReply() ); 178 reply = parseAddresses( mail.getReply() );
179
180 if (mail.Inreply().count()>0) {
181 in_reply_to = clist_new();
182 char*c_reply;
183 unsigned int nsize = 0;
184 for (QStringList::ConstIterator it=mail.Inreply().begin();
185 it != mail.Inreply().end();++it) {
186 /* yes! must be malloc! */
187 if ((*it).isEmpty())
188 continue;
189 QString h((*it));
190 while (h.length()>0 && h[0]=='<') {
191 h.remove(0,1);
192 }
193 while (h.length()>0 && h[h.length()-1]=='>') {
194 h.remove(h.length()-1,1);
195 }
196 if (h.isEmpty()) continue;
197 nsize = strlen(h.latin1());
198 c_reply = (char*)malloc( (nsize+1)*sizeof(char));
199 memset(c_reply,0,nsize+1);
200 memcpy(c_reply,h.latin1(),nsize);
201 clist_append(in_reply_to,c_reply);
202 qDebug("In reply to: %s",c_reply);
203 }
204 }
178 205
179 fields = mailimf_fields_new_with_data( from, sender, reply, to, cc, bcc, 206 fields = mailimf_fields_new_with_data( from, sender, reply, to, cc, bcc,
180 NULL, NULL, subject ); 207 in_reply_to, NULL, subject );
181 if ( fields == NULL ) 208 if ( fields == NULL )
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp
index ec93f8d..84f8a90 100644
--- a/noncore/net/mail/viewmail.cpp
+++ b/noncore/net/mail/viewmail.cpp
@@ -411,3 +411,3 @@ void ViewMail::slotReply()
411 QString prefix; 411 QString prefix;
412 if ( m_mail[1].find(QRegExp("^Re: *$")) != -1) prefix = ""; 412 if ( m_mail[1].find(QRegExp("^Re: .*$")) != -1) prefix = "";
413 else prefix = "Re: "; // no i18n on purpose 413 else prefix = "Re: "; // no i18n on purpose
@@ -417,4 +417,6 @@ void ViewMail::slotReply()
417 composer.setTo( m_mail[0] ); 417 composer.setTo( m_mail[0] );
418 composer.setSubject( "Re: " + m_mail[1] ); 418 composer.setSubject( prefix + m_mail[1] );
419 composer.setMessage( rtext ); 419 composer.setMessage( rtext );
420 composer.setInReplyTo(m_recMail.Msgid());
421
420 if ( QDialog::Accepted == QPEApplication::execDialog( &composer ) ) 422 if ( QDialog::Accepted == QPEApplication::execDialog( &composer ) )