16 #include "kmime_newsarticle.h"
18 using namespace KMime;
22 void NewsArticle::parse()
28 if( !(raw=rawHeader(l_ines.type())).isEmpty() )
29 l_ines.from7BitString(raw);
32 void NewsArticle::assemble()
38 if( (h=messageID( false))!=0 )
42 if( (h=control( false))!=0 )
46 if( (h=supersedes( false))!=0 )
58 if( (h=to( false))!=0 )
62 if( (h=newsgroups( false))!=0 )
66 if( (h=followUpTo( false))!=0 )
70 if( (h=replyTo( false))!=0 )
74 if( (h=mailCopiesTo( false))!=0 )
82 if( (h=references( false))!=0 )
90 if( (h=organization( false))!=0 )
94 if( (h=userAgent( false))!=0 )
98 newHead+= "MIME-Version: 1.0\n";
101 newHead+=contentType()->as7BitString()+ "\n";
104 newHead+=contentTransferEncoding()->as7BitString()+ "\n";
107 int pos=h_ead.find( "\nX-");
109 newHead+=h_ead.mid(pos+1, h_ead.length()-pos);
110 else if(h_eaders && !h_eaders->isEmpty()) {
111 for(h=h_eaders->first(); h; h=h_eaders->next()) {
112 if( h-> isXHeader() && (strncasecmp(h-> type(), "X-KNode", 7)!=0) )
120 void NewsArticle::clear()
126 Headers::Base * NewsArticle::getHeaderByType( const char * type)
128 if(strcasecmp( "Lines", type)==0) {
129 if(l_ines.isEmpty()) return 0;
132 return Message::getHeaderByType(type);
139 l_ines.setNumberOfLines( ( static_cast<Headers::Lines* >(h))->numberOfLines() );
142 Message::setHeader(h);
149 bool NewsArticle::removeHeader( const char *type)
151 if(strcasecmp( "Lines", type)==0)
154 return Message::removeHeader(type);
|