X-Git-Url: https://git.pterodactylus.net/?p=fms.git;a=blobdiff_plain;f=src%2Ffreenet%2Fmessagelistxml.cpp;h=473a495e983dd17cea1c9b1a58c61cf25a539c13;hp=4eed479f1e7fe9200915998493b35b4725ebbe62;hb=1230cc420c955e75051d011d964bc68f061ba08c;hpb=6836fbb5db8464f56e682989996b2210b14231d0 diff --git a/src/freenet/messagelistxml.cpp b/src/freenet/messagelistxml.cpp index 4eed479..473a495 100644 --- a/src/freenet/messagelistxml.cpp +++ b/src/freenet/messagelistxml.cpp @@ -219,12 +219,12 @@ const bool MessageListXML::ParseXML(const std::string &xml) txt=hnd2.FirstChild("Date").FirstChild().ToText(); if(txt) { - date=txt->ValueStr(); + date=SanitizeSingleString(txt->ValueStr()); } txt=hnd2.FirstChild("Index").FirstChild().ToText(); if(txt) { - tempstr=txt->ValueStr(); + tempstr=SanitizeSingleString(txt->ValueStr()); StringFunctions::Convert(tempstr,index); } node2=hnd2.FirstChild("Boards").FirstChild("Board").ToNode(); @@ -232,7 +232,7 @@ const bool MessageListXML::ParseXML(const std::string &xml) { if(node2->FirstChild()) { - std::string boardname=node2->FirstChild()->ValueStr(); + std::string boardname=SanitizeSingleString(node2->FirstChild()->ValueStr()); StringFunctions::LowerCase(boardname,boardname); boards.push_back(boardname); } @@ -244,6 +244,57 @@ const bool MessageListXML::ParseXML(const std::string &xml) node=node->NextSibling("Message"); } + node=hnd.FirstChild("MessageList").FirstChild("ExternalMessage").ToNode(); + while(node) + { + std::string type=""; + std::string identity=""; + date=""; + index=-1; + boards.clear(); + + TiXmlHandle hnd2(node); + txt=hnd2.FirstChild("Type").FirstChild().ToText(); + if(txt) + { + type=SanitizeSingleString(txt->ValueStr()); + } + + if(type=="Keyed") + { + txt=hnd2.FirstChild("Identity").FirstChild().ToText(); + if(txt) + { + identity=SanitizeSingleString(txt->ValueStr()); + } + txt=hnd2.FirstChild("Date").FirstChild().ToText(); + if(txt) + { + date=SanitizeSingleString(txt->ValueStr()); + } + txt=hnd2.FirstChild("Index").FirstChild().ToText(); + if(txt) + { + tempstr=SanitizeSingleString(txt->ValueStr()); + StringFunctions::Convert(tempstr,index); + } + node2=hnd2.FirstChild("Boards").FirstChild("Board").ToNode(); + while(node2) + { + if(node2->FirstChild()) + { + std::string boardname=SanitizeSingleString(node2->FirstChild()->ValueStr()); + StringFunctions::LowerCase(boardname,boardname); + boards.push_back(boardname); + } + node2=node2->NextSibling("Board"); + } + m_externalmessages.push_back(externalmessage("Keyed",identity,date,index,boards)); + } + + node=node->NextSibling("ExternalMessage"); + } + return true; } else