X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmessage.cpp;h=5bebb5d3f54440631907301c934e27621e54385b;hb=9ae3b1434e51788e6feb72e1415ec800d05c535a;hp=0445e294e71125b5612aae3978b82a1b83456b12;hpb=221236a4d3aac4144529d418ce368db5c98facb0;p=fms.git diff --git a/src/message.cpp b/src/message.cpp index 0445e29..5bebb5d 100644 --- a/src/message.cpp +++ b/src/message.cpp @@ -18,12 +18,12 @@ #include #endif -Message::Message() +Message::Message(SQLite3DB::DB *db):IDatabase(db) { Initialize(); } -Message::Message(const long messageid) +Message::Message(SQLite3DB::DB *db, const long messageid):IDatabase(db) { Load(messageid); } @@ -157,7 +157,7 @@ const std::string Message::GetNNTPHeaders() const { std::string rval(""); - rval+="From: "+m_fromname+"\r\n"; + rval+="From: "+SanitizeFromName(m_fromname)+"\r\n"; rval+="Newsgroups: "; for(std::vector::const_iterator i=m_boards.begin(); i!=m_boards.end(); i++) { @@ -400,9 +400,11 @@ void Message::Initialize() m_inreplyto.clear(); m_fileattachments.clear(); m_changemessagetrustonreply=0; - Option::Instance()->Get("ChangeMessageTrustOnReply",tempval); + Option option(m_db); + + option.Get("ChangeMessageTrustOnReply",tempval); StringFunctions::Convert(tempval,m_changemessagetrustonreply); - Option::Instance()->Get("AddNewPostFromIdentities",tempval); + option.Get("AddNewPostFromIdentities",tempval); if(tempval=="true") { m_addnewpostfromidentities=true; @@ -412,10 +414,10 @@ void Message::Initialize() m_addnewpostfromidentities=false; } tempval="50"; - Option::Instance()->Get("MinLocalMessageTrust",tempval); + option.Get("MinLocalMessageTrust",tempval); StringFunctions::Convert(tempval,m_minlocalmessagetrust); tempval="51"; - Option::Instance()->Get("MinLocalTrustListTrust",tempval); + option.Get("MinLocalTrustListTrust",tempval); StringFunctions::Convert(tempval,m_minlocaltrustlisttrust); } @@ -825,6 +827,11 @@ const bool Message::ParseNNTPMessage(const std::string &nntpmessage) return true; } +const std::string Message::SanitizeFromName(const std::string &fromname) const +{ + return StringFunctions::Replace(fromname,",","_"); +} + const bool Message::StartFreenetInsert() {