X-Git-Url: https://git.pterodactylus.net/?p=fms.git;a=blobdiff_plain;f=src%2Fglobal.cpp;h=d241f069f2ec6bb96f4324735ecdceaf74d9255e;hp=251ea2abbb4e48a0887ad18f2245bcd99679d623;hb=8a0a83a78390f22f99d4487cda2569909dfbc28e;hpb=a007770a843aa759763b98288c9432c3906ce5c6 diff --git a/src/global.cpp b/src/global.cpp index 251ea2a..d241f06 100644 --- a/src/global.cpp +++ b/src/global.cpp @@ -67,13 +67,19 @@ void SetupDB() major=1; minor=5; } + if(major==1 && minor==5) + { + ConvertDB0105To0106(); + major=1; + minor=6; + } } else { - db->Execute("INSERT INTO tblDBVersion(Major,Minor) VALUES(1,5);"); + db->Execute("INSERT INTO tblDBVersion(Major,Minor) VALUES(1,6);"); } - db->Execute("UPDATE tblDBVersion SET Major=1, Minor=4;"); + db->Execute("UPDATE tblDBVersion SET Major=1, Minor=6;"); db->Execute("CREATE TABLE IF NOT EXISTS tblOption(\ Option TEXT UNIQUE,\ @@ -89,6 +95,7 @@ void SetupDB() SingleUse BOOL CHECK(SingleUse IN('true','false')) DEFAULT 'false',\ PublishTrustList BOOL CHECK(PublishTrustList IN('true','false')) DEFAULT 'false',\ PublishBoardList BOOL CHECK(PublishBoardList IN('true','false')) DEFAULT 'false',\ + PublishFreesite BOOL CHECK(PublishFreesite IN('true','false')) DEFAULT 'false',\ InsertingIdentity BOOL CHECK(InsertingIdentity IN('true','false')) DEFAULT 'false',\ LastInsertedIdentity DATETIME,\ InsertingPuzzle BOOL CHECK(InsertingPuzzle IN('true','false')) DEFAULT 'false',\ @@ -99,6 +106,7 @@ void SetupDB() LastInsertedBoardList DATETIME,\ InsertingMessageList BOOL CHECK(InsertingMessageList IN('true','false')) DEFAULT 'false',\ LastInsertedMessageList DATETIME,\ + LastInsertedFreesite DATETIME,\ DateCreated DATETIME\ );"); @@ -484,6 +492,15 @@ void ConvertDB0104To0105() db->Execute("UPDATE tblDBVersion SET Major=1, Minor=5;"); } +void ConvertDB0105To0106() +{ + // add Publish Freesite + SQLite3DB::DB *db=SQLite3DB::DB::Instance(); + db->Execute("ALTER TABLE tblLocalIdentity ADD COLUMN PublishFreesite BOOL CHECK(PublishFreesite IN('true','false')) DEFAULT 'false';"); + db->Execute("ALTER TABLE tblLocalIdentity ADD COLUMN LastInsertedFreesite DATETIME;"); + db->Execute("UPDATE tblDBVersion SET Major=1, Minor=6;"); +} + void SetupDefaultOptions() { // OptionValue should always be inserted as a string, even if the option really isn't a string - just to keep the field data type consistent @@ -530,7 +547,7 @@ void SetupDefaultOptions() st.Bind(0,"StartHTTP"); st.Bind(1,"true"); - st.Bind(2,"Start HTTP server."); + st.Bind(2,"Start HTTP server. WARNING: If you turn this off, you won't be able to access the administration pages."); st.Step(); st.Reset(); @@ -549,7 +566,7 @@ void SetupDefaultOptions() // StartFreenetUpdater st.Bind(0,"StartFreenetUpdater"); st.Bind(1,"true"); - st.Bind(2,"Start Freenet Updater thread."); + st.Bind(2,"Set to true to start the Freenet Updater thread and connect to Freenet. Set to false to prevent communication with Freenet."); st.Step(); st.Reset(); @@ -622,7 +639,7 @@ void SetupDefaultOptions() st.Reset(); st.Bind(0,"MinLocalTrustListTrust"); - st.Bind(1,"51"); + st.Bind(1,"50"); st.Bind(2,"Specifies a local trust list trust level that a peer must have before its trust list will be included in the weighted average. Any peers below this number will be excluded from the results."); st.Step(); st.Reset(); @@ -663,6 +680,12 @@ void SetupDefaultOptions() st.Step(); st.Reset(); + st.Bind(0,"SaveMessagesFromNewBoards"); + st.Bind(1,"true"); + st.Bind(2,"Set to true to automatically save messages posted to new boards. Set to false to ignore messages to new boards."); + st.Step(); + st.Reset(); + st.Bind(0,"ChangeMessageTrustOnReply"); st.Bind(1,"0"); st.Bind(2,"How much the local message trust level of an identity should change when you reply to one of their messages.");