version 0.2.4
[fms.git] / src / global.cpp
index 251ea2a..d241f06 100644 (file)
@@ -67,13 +67,19 @@ void SetupDB()
                        major=1;\r
                        minor=5;\r
                }\r
                        major=1;\r
                        minor=5;\r
                }\r
+               if(major==1 && minor==5)\r
+               {\r
+                       ConvertDB0105To0106();\r
+                       major=1;\r
+                       minor=6;\r
+               }\r
        }\r
        else\r
        {\r
        }\r
        else\r
        {\r
-               db->Execute("INSERT INTO tblDBVersion(Major,Minor) VALUES(1,5);");\r
+               db->Execute("INSERT INTO tblDBVersion(Major,Minor) VALUES(1,6);");\r
        }\r
 \r
        }\r
 \r
-       db->Execute("UPDATE tblDBVersion SET Major=1, Minor=4;");\r
+       db->Execute("UPDATE tblDBVersion SET Major=1, Minor=6;");\r
 \r
        db->Execute("CREATE TABLE IF NOT EXISTS tblOption(\\r
                                Option                          TEXT UNIQUE,\\r
 \r
        db->Execute("CREATE TABLE IF NOT EXISTS tblOption(\\r
                                Option                          TEXT UNIQUE,\\r
@@ -89,6 +95,7 @@ void SetupDB()
                                SingleUse                               BOOL CHECK(SingleUse IN('true','false')) DEFAULT 'false',\\r
                                PublishTrustList                BOOL CHECK(PublishTrustList IN('true','false')) DEFAULT 'false',\\r
                                PublishBoardList                BOOL CHECK(PublishBoardList IN('true','false')) DEFAULT 'false',\\r
                                SingleUse                               BOOL CHECK(SingleUse IN('true','false')) DEFAULT 'false',\\r
                                PublishTrustList                BOOL CHECK(PublishTrustList IN('true','false')) DEFAULT 'false',\\r
                                PublishBoardList                BOOL CHECK(PublishBoardList IN('true','false')) DEFAULT 'false',\\r
+                               PublishFreesite                 BOOL CHECK(PublishFreesite IN('true','false')) DEFAULT 'false',\\r
                                InsertingIdentity               BOOL CHECK(InsertingIdentity IN('true','false')) DEFAULT 'false',\\r
                                LastInsertedIdentity    DATETIME,\\r
                                InsertingPuzzle                 BOOL CHECK(InsertingPuzzle IN('true','false')) DEFAULT 'false',\\r
                                InsertingIdentity               BOOL CHECK(InsertingIdentity IN('true','false')) DEFAULT 'false',\\r
                                LastInsertedIdentity    DATETIME,\\r
                                InsertingPuzzle                 BOOL CHECK(InsertingPuzzle IN('true','false')) DEFAULT 'false',\\r
@@ -99,6 +106,7 @@ void SetupDB()
                                LastInsertedBoardList   DATETIME,\\r
                                InsertingMessageList    BOOL CHECK(InsertingMessageList IN('true','false')) DEFAULT 'false',\\r
                                LastInsertedMessageList DATETIME,\\r
                                LastInsertedBoardList   DATETIME,\\r
                                InsertingMessageList    BOOL CHECK(InsertingMessageList IN('true','false')) DEFAULT 'false',\\r
                                LastInsertedMessageList DATETIME,\\r
+                               LastInsertedFreesite    DATETIME,\\r
                                DateCreated                             DATETIME\\r
                                );");\r
 \r
                                DateCreated                             DATETIME\\r
                                );");\r
 \r
@@ -484,6 +492,15 @@ void ConvertDB0104To0105()
        db->Execute("UPDATE tblDBVersion SET Major=1, Minor=5;");\r
 }\r
 \r
        db->Execute("UPDATE tblDBVersion SET Major=1, Minor=5;");\r
 }\r
 \r
+void ConvertDB0105To0106()\r
+{\r
+       // add Publish Freesite\r
+       SQLite3DB::DB *db=SQLite3DB::DB::Instance();\r
+       db->Execute("ALTER TABLE tblLocalIdentity ADD COLUMN PublishFreesite BOOL CHECK(PublishFreesite IN('true','false')) DEFAULT 'false';");\r
+       db->Execute("ALTER TABLE tblLocalIdentity ADD COLUMN LastInsertedFreesite DATETIME;");\r
+       db->Execute("UPDATE tblDBVersion SET Major=1, Minor=6;");\r
+}\r
+\r
 void SetupDefaultOptions()\r
 {\r
        // 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\r
 void SetupDefaultOptions()\r
 {\r
        // 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\r
@@ -530,7 +547,7 @@ void SetupDefaultOptions()
 \r
        st.Bind(0,"StartHTTP");\r
        st.Bind(1,"true");\r
 \r
        st.Bind(0,"StartHTTP");\r
        st.Bind(1,"true");\r
-       st.Bind(2,"Start HTTP server.");\r
+       st.Bind(2,"Start HTTP server.  WARNING: If you turn this off, you won't be able to access the administration pages.");\r
        st.Step();\r
        st.Reset();\r
 \r
        st.Step();\r
        st.Reset();\r
 \r
@@ -549,7 +566,7 @@ void SetupDefaultOptions()
        // StartFreenetUpdater\r
        st.Bind(0,"StartFreenetUpdater");\r
        st.Bind(1,"true");\r
        // StartFreenetUpdater\r
        st.Bind(0,"StartFreenetUpdater");\r
        st.Bind(1,"true");\r
-       st.Bind(2,"Start Freenet Updater thread.");\r
+       st.Bind(2,"Set to true to start the Freenet Updater thread and connect to Freenet.  Set to false to prevent communication with Freenet.");\r
        st.Step();\r
        st.Reset();\r
 \r
        st.Step();\r
        st.Reset();\r
 \r
@@ -622,7 +639,7 @@ void SetupDefaultOptions()
        st.Reset();\r
 \r
        st.Bind(0,"MinLocalTrustListTrust");\r
        st.Reset();\r
 \r
        st.Bind(0,"MinLocalTrustListTrust");\r
-       st.Bind(1,"51");\r
+       st.Bind(1,"50");\r
        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.");\r
        st.Step();\r
        st.Reset();\r
        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.");\r
        st.Step();\r
        st.Reset();\r
@@ -663,6 +680,12 @@ void SetupDefaultOptions()
        st.Step();\r
        st.Reset();\r
 \r
        st.Step();\r
        st.Reset();\r
 \r
+       st.Bind(0,"SaveMessagesFromNewBoards");\r
+       st.Bind(1,"true");\r
+       st.Bind(2,"Set to true to automatically save messages posted to new boards.  Set to false to ignore messages to new boards.");\r
+       st.Step();\r
+       st.Reset();\r
+\r
        st.Bind(0,"ChangeMessageTrustOnReply");\r
        st.Bind(1,"0");\r
        st.Bind(2,"How much the local message trust level of an identity should change when you reply to one of their messages.");\r
        st.Bind(0,"ChangeMessageTrustOnReply");\r
        st.Bind(1,"0");\r
        st.Bind(2,"How much the local message trust level of an identity should change when you reply to one of their messages.");\r