X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ffreenet%2Fidentityxml.cpp;h=3f8ec1790cd00665fb0c3639b5ed0e366978c950;hb=e773b0ecb8a35c67cde5b2e82bbebb05224f34d0;hp=b2b33c7e02889fef957d38467bb95aa82dee34f6;hpb=d8f51eac91f86a1e00a05a5058a8fa9eb8732464;p=fms.git diff --git a/src/freenet/identityxml.cpp b/src/freenet/identityxml.cpp index b2b33c7..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) @@ -48,7 +55,6 @@ const bool IdentityXML::ParseXML(const std::string &xml) if(!td.Error()) { - TiXmlElement *el; TiXmlText *txt; TiXmlHandle hnd(&td); @@ -60,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; }