X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fnntp%2Fnntpconnection.cpp;h=cc5cffe6fb99dc31b412e9eeb030c0b790fcd44e;hb=4430e7762844c66428b6f822288beb71b7f82b95;hp=3fffad7d312c4e12194da23d85e0a94949227c25;hpb=b9c3763a932cebaa015a27fe111017f6f34dfbaa;p=fms.git diff --git a/src/nntp/nntpconnection.cpp b/src/nntp/nntpconnection.cpp index 3fffad7..cc5cffe 100644 --- a/src/nntp/nntpconnection.cpp +++ b/src/nntp/nntpconnection.cpp @@ -317,7 +317,7 @@ const bool NNTPConnection::HandleListCommand(const NNTPCommand &command) show=uwildmat((*i).GetBoardName().c_str(),arg2.c_str()); } - if(show==true) + if(show==true && (*i).GetSaveReceivedMessages()==true) { tempstr << (*i).GetBoardName() << " " << (*i).GetHighMessageID() << " " << (*i).GetLowMessageID() << " " << (m_status.m_allowpost ? "y" : "n"); SendBufferedLine(tempstr.str()); @@ -348,7 +348,7 @@ const bool NNTPConnection::HandleListCommand(const NNTPCommand &command) show=uwildmat((*i).GetBoardName().c_str(),arg2.c_str()); } - if(show==true) + if(show==true && (*i).GetSaveReceivedMessages()==true) { tempstr << (*i).GetBoardName() << "\t" << (*i).GetBoardDescription(); SendBufferedLine(tempstr.str()); @@ -559,9 +559,12 @@ const bool NNTPConnection::HandleNewGroupsCommand(const NNTPCommand &command) for(BoardList::iterator i=bl.begin(); i!=bl.end(); i++) { - std::ostringstream tempstr; - tempstr << (*i).GetBoardName() << " " << (*i).GetHighMessageID() << " " << (*i).GetLowMessageID() << " " << m_status.m_allowpost ? "y" : "n"; - SendBufferedLine(tempstr.str()); + if((*i).GetSaveReceivedMessages()==true) + { + std::ostringstream tempstr; + tempstr << (*i).GetBoardName() << " " << (*i).GetHighMessageID() << " " << (*i).GetLowMessageID() << " " << m_status.m_allowpost ? "y" : "n"; + SendBufferedLine(tempstr.str()); + } } SendBufferedLine("."); @@ -635,11 +638,13 @@ const bool NNTPConnection::HandleOverCommand(const NNTPCommand &command) messageuuid=command.m_arguments[0]; messageuuid=StringFunctions::Replace(messageuuid,"<",""); messageuuid=StringFunctions::Replace(messageuuid,">",""); + /* // get rid of @ and everything after if(messageuuid.find("@")!=std::string::npos) { messageuuid.erase(messageuuid.find("@")); } + */ } // single article or range else @@ -782,11 +787,14 @@ void NNTPConnection::HandlePostedMessage(const std::string &message) { mess.HandleAdministrationMessage(); } + if(mess.StartFreenetInsert()) + { + SendBufferedLine("240 Article received OK"); + } else { - mess.StartFreenetInsert(); + SendBufferedLine("441 Posting failed. Make sure the identity you are sending with exists!"); } - SendBufferedLine("240 Article received OK"); } else { @@ -955,7 +963,7 @@ void NNTPConnection::SendArticleOverInfo(Message &message) { line+=" "; } - line+="<"+(*i).second+"@freenetproject.org>"; + line+="<"+(*i).second+">"; //+"@freenetproject.org>"; } line+="\t"; } @@ -1015,6 +1023,21 @@ void NNTPConnection::SendArticleParts(const NNTPConnection::NNTPCommand &command else { articleid=command.m_arguments[0]; + //strip off < and > and everthing after @ + if(articleid.size()>0 && articleid[0]=='<') + { + articleid.erase(0,1); + } + if(articleid.size()>0 && articleid[articleid.size()-1]=='>') + { + articleid.erase(articleid.size()-1); + } + /* + if(articleid.size()>0 && articleid.find('@')!=std::string::npos) + { + articleid.erase(articleid.find('@')); + } + */ message.Load(articleid); type=2; }