+std::string GetAccountDir(std::string AccName, bool ServerCert)
+{
+
+ // Get the account directory.
+
+ std::string AccountDir;
+
+#if defined(__HAIKU__)
+
+#elif defined(__WIN32__)
+
+ AccountDir.clear();
+ AccountDir.append(getenv("APPDATA"));
+ AccountDir.append("\\Xestia\\Address Book\\accounts\\");
+ AccountDir.append(AccName);
+ AccountDir.append("\\");
+
+ if (ServerCert == true){
+ AccountDir.append("server.crt");
+ }
+
+#elif defined(__APPLE__)
+
+ AccountDir.clear();
+ AccountDir.append(getenv("HOME"));
+ AccountDir.append("/Library/Preferences/Xestia/Address Book/accounts/");
+ AccountDir.append(AccName);
+ AccountDir.append("/");
+
+ if (ServerCert == true){
+ AccountDir.append("server.crt");
+ }
+
+#else
+
+ AccountDir.clear();
+ AccountDir.append(getenv("HOME"));
+ AccountDir.append("/.xestiaab/accounts/");
+ AccountDir.append(AccName);
+ AccountDir.append("/");
+
+ if (ServerCert == true){
+ AccountDir.append("server.crt");
+ }
+
+#endif
+
+ return AccountDir;
+
+}
+