Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Label servers that can cause data loss as dangerous
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sat, 4 Jul 2020 23:47:33 +0000 (00:47 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 5 Jul 2020 20:19:37 +0000 (21:19 +0100)
Previous wording was incorrect as we were not stopping connections to
the servers in question and within a modern software development
environment is inappropriate and offensive.

CHANGES
source/common/CMakeLists.txt
source/common/svrdlist.cpp [moved from source/common/svrblist.cpp with 60% similarity]
source/common/svrdlist.h [moved from source/common/svrblist.h with 81% similarity]
source/frmEditAccount.cpp
source/frmEditAccount.h
source/frmNewAccount.cpp
source/tests/xestiaab_common.h

diff --git a/CHANGES b/CHANGES
index d26b7bd..308b802 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -144,7 +144,7 @@ Version 0.12
 ============
 12 April 2016
 
-- Added check to see if a server is on the blacklist and to display a
+- Added check to see if a server is on the dangerous list and to display a
   dialog confirming that data loss could happen if that server is used.
 - Added support for OS X. Support begins from OS X 10.11.4. Use of XAB
   on OS X before this version is unsupported.
index 5cb4a7f..552d13b 100644 (file)
@@ -23,8 +23,8 @@ set(FILE_LIST base64.cpp
               preferences.h
               sslcertstructs.h
               structs.h
-              svrblist.cpp
-              svrblist.h
+              svrdlist.cpp
+              svrdlist.h
               textprocessing.cpp
               textprocessing.h
               timers.cpp
similarity index 60%
rename from source/common/svrblist.cpp
rename to source/common/svrdlist.cpp
index 9894b21..997c9c1 100644 (file)
@@ -1,4 +1,4 @@
-// svrblist.cpp - Server Blacklist subroutines.
+// svrdlist.cpp - Server Dangerous List subroutines.
 //
 // (c) 2012-2015 Xestia Software Development.
 //
 #include <wx/wx.h>
 #include <wx/tokenzr.h>
 
-bool CheckBlacklist(wxString ServerAddress){
+bool CheckDangerousList(wxString serverAddress){
 
-       // Check if the server address is on the blacklist.
+       // Check if the server address is on the dangerous list.
 
-       wxString ServerBlacklist = "google.com";
-       wxString BListHostname;
+       wxString dangerousServerList = "google.com";
+       wxString dangerousListHostname;
 
-       wxStringTokenizer ServerBlacklistTkz(ServerBlacklist, wxT("|"));
+       wxStringTokenizer dangerousServerTokens(dangerousServerList, wxT("|"));
 
-       while(ServerBlacklistTkz.HasMoreTokens()){
+       while(dangerousServerTokens.HasMoreTokens()){
        
-               BListHostname = ServerBlacklistTkz.GetNextToken();
-               if (BListHostname == ServerAddress){
-                       return TRUE;
+               dangerousListHostname = dangerousServerTokens.GetNextToken();
+               if (dangerousListHostname == serverAddress){
+                       return true;
                }
        
        }
 
-       return FALSE;
+       return false;
 
 }
\ No newline at end of file
similarity index 81%
rename from source/common/svrblist.h
rename to source/common/svrdlist.h
index c2e7b3d..4781b05 100644 (file)
@@ -1,4 +1,4 @@
-// svrblist.h - Server Blacklist subroutines header.
+// svrdlist.h - Server Dangerous List subroutines header.
 //
 // (c) 2012-2015 Xestia Software Development.
 //
@@ -18,9 +18,9 @@
 
 #include <wx/wx.h>
 
-#ifndef COMMON_SVRBLIST_H
-#define COMMON_SVRBLIST_H
+#ifndef COMMON_SVRDLIST_H
+#define COMMON_SVRDLIST_H
 
-bool CheckBlacklist(wxString ServerAddress);
+bool CheckDangerousList(wxString serverAddress);
 
 #endif
\ No newline at end of file
index 67df523..920f526 100644 (file)
@@ -17,6 +17,7 @@
 // with Xestia Address Book. If not, see <http://www.gnu.org/licenses/>
 
 #include "frmEditAccount.h"
+#include "common/svrdlist.h"
 
 frmEditAccount::frmEditAccount( wxWindow* parent )
 :
@@ -274,10 +275,10 @@ void frmEditAccount::LoadSettings( wxString AccNameIn ){
 void frmEditAccount::UpdateSettings( wxCommandEvent& event )
 {
 
-       // Check if server address matches against the blacklist.
+       // Check if server address matches against the dangerous list.
        // Bring up warning message if it does.
        
-       if (CheckBlacklist(txtAddress->GetValue())){
+       if (CheckDangerousList(txtAddress->GetValue())){
                
                int MessageBoxResult = wxMessageBox(_("The server with the address given does not support the CardDAV protocol properly and shouldn't be used.\n\nData loss is very likely.\n\nDo you still want to continue using this server?"), _("Server warning"), wxYES_NO, this);
                
index a151528..4175721 100644 (file)
@@ -27,7 +27,6 @@ Subclass of frmEditAccountADT, which is generated by wxFormBuilder.
 #include "AppXestiaAddrBk.h"
 #include <wx/fileconf.h>
 #include "frmInvalidSSLCertificate.h"
-#include "common/svrblist.h"
 #include "connobject/ConnectionObject.h"
 
 #if defined(__WIN32__)
index b6a6c2e..9d0873e 100644 (file)
@@ -28,7 +28,7 @@
 #endif
 
 #include "common/dirs.h"
-#include "common/svrblist.h"
+#include "common/svrdlist.h"
 #include "frmInvalidSSLCertificate.h"
 
 DEFINE_EVENT_TYPE(UPDATERESULTS);
@@ -140,10 +140,10 @@ void frmNewAccount::ProcessNext( wxCommandEvent& event )
             
                }
         
-               // Check if server address matches against the blacklist.
+               // Check if server address matches against the dangerous list.
                // Bring up warning message if it does.
                
-               if (CheckBlacklist(txtServerAddress->GetValue())){
+               if (CheckDangerousList(txtServerAddress->GetValue())){
                
                        int MessageBoxResult = wxMessageBox(_("The server with the address given does not support the CardDAV protocol properly and shouldn't be used.\n\nData loss is very likely.\n\nDo you still want to continue using this server?"), _("Server warning"), wxYES_NO, this);
                
index ca9b727..c870765 100644 (file)
@@ -20,7 +20,7 @@
 #include "../common/dirs.h"
 #include "../common/filename.h"
 #include "../common/mime.h"
-#include "../common/svrblist.h"
+#include "../common/svrdlist.h"
 #include "../common/textprocessing.h"
 
 static wxString AccountInput1 = "Example1";
@@ -316,10 +316,10 @@ TEST(CommonFunctions, GivenTwoFilesWhenGetMIMEIsCalledThenBothFilesMIMETypesAreG
        
 }
 
-TEST(CommonFunctions, GivenTwoDomainNamesWhenCheckBlacklistIsCalledThenReturnsCorrectStatus)
+TEST(CommonFunctions, GivenTwoDomainNamesWhenCheckDangerousListIsCalledThenReturnsCorrectStatus)
 {
        
-       // Test that the blacklist is actually working.
+       // Test that the dangerous list is actually working.
 
        // Given
        
@@ -327,7 +327,7 @@ TEST(CommonFunctions, GivenTwoDomainNamesWhenCheckBlacklistIsCalledThenReturnsCo
        
        // When
        
-       domainStatus = CheckBlacklist("example.com");
+       domainStatus = CheckDangerousList("example.com");
        
        // Then
        
@@ -336,7 +336,7 @@ TEST(CommonFunctions, GivenTwoDomainNamesWhenCheckBlacklistIsCalledThenReturnsCo
        // When
        
        domainStatus = false;
-       domainStatus = CheckBlacklist("google.com");
+       domainStatus = CheckDangerousList("google.com");
        
        // Then
        
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy