X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ffreenet%2Fidentityxml.cpp;h=3f8ec1790cd00665fb0c3639b5ed0e366978c950;hb=e773b0ecb8a35c67cde5b2e82bbebb05224f34d0;hp=f4e8c542723617b2105b8885e9a9599e3a6b51c9;hpb=b9c3763a932cebaa015a27fe111017f6f34dfbaa;p=fms.git diff --git a/src/freenet/identityxml.cpp b/src/freenet/identityxml.cpp index f4e8c54..3f8ec17 100644 --- a/src/freenet/identityxml.cpp +++ b/src/freenet/identityxml.cpp @@ -28,6 +28,12 @@ std::string IdentityXML::GetXML() tid->LinkEndChild(XMLCreateBooleanElement("PublishBoardList",m_publishboardlist)); + // freesite edition will be -1 if identity isn't publishing a freesite + if(m_freesiteedition>=0) + { + tid->LinkEndChild(XMLCreateTextElement("FreesiteEdition",m_freesiteedition)); + } + td.Accept(&tp); return std::string(tp.CStr()); @@ -39,6 +45,7 @@ void IdentityXML::Initialize() m_publishtrustlist=false; m_publishboardlist=false; m_singleuse=false; + m_freesiteedition=-1; } const bool IdentityXML::ParseXML(const std::string &xml) @@ -59,12 +66,24 @@ const bool IdentityXML::ParseXML(const std::string &xml) m_name=txt->ValueStr(); } + if(m_name.size()>40) + { + m_name.erase(40); + } + m_singleuse=XMLGetBooleanElement(hnd.FirstChild("Identity").ToElement(),"SingleUse"); m_publishtrustlist=XMLGetBooleanElement(hnd.FirstChild("Identity").ToElement(),"PublishTrustList"); m_publishboardlist=XMLGetBooleanElement(hnd.FirstChild("Identity").ToElement(),"PublishBoardList"); + txt=hnd.FirstChild("Identity").FirstChild("FreesiteEdition").FirstChild().ToText(); + if(txt) + { + std::string editionstr=txt->ValueStr(); + StringFunctions::Convert(editionstr,m_freesiteedition); + } + return true; }