diff --git a/src/dring/dring.h b/src/dring/dring.h index f70ae30bcc183038f702a04e5c6ae78ae710f488..ff8b8fa550d8955bedc333f94be12a5b8726d3a6 100644 --- a/src/dring/dring.h +++ b/src/dring/dring.h @@ -46,10 +46,9 @@ const char* version() noexcept; * Initialize globals, create underlaying daemon. * * @param flags Flags to customize this initialization - * @param app_path Universal Windows Platform Application path * @returns true if initialization succeed else false. */ -bool init(enum InitFlag flags, const char* app_path = "") noexcept; +bool init(enum InitFlag flags) noexcept; /** * Start asynchronously daemon created by init(). diff --git a/src/ring_api.cpp b/src/ring_api.cpp index a2a04ae794efa30b3c3a04dd8994268fcbc2d36d..9e5524a9d26c8fa4ef7ed302747167b7dd5bba0b 100644 --- a/src/ring_api.cpp +++ b/src/ring_api.cpp @@ -42,7 +42,7 @@ namespace DRing { bool -init(enum InitFlag flags, const char* app_path) noexcept +init(enum InitFlag flags) noexcept { ::setDebugMode(flags & DRING_FLAG_DEBUG); ::setConsoleLog(flags & DRING_FLAG_CONSOLE_LOG); diff --git a/src/ringdht/ringaccount.cpp b/src/ringdht/ringaccount.cpp index cd991165b0d8d4009f3cab22c01c67a81a3390f0..a91c7cca72960475845b5e1dc22d0bf2ed1d8182 100644 --- a/src/ringdht/ringaccount.cpp +++ b/src/ringdht/ringaccount.cpp @@ -142,19 +142,9 @@ RingAccount::RingAccount(const std::string& accountID, bool /* presenceEnabled * #ifdef WIN32_NATIVE gnutls_global_init(); #endif -//#ifdef WIN32_NATIVE -// cachePath_ = Manager::instance().getUWPAppPath() + -// DIR_SEPARATOR_STR + std::string(".cache") + -// DIR_SEPARATOR_STR + getAccountID(); -// dataPath_ = cachePath_ + DIR_SEPARATOR_STR "values"; -// idPath_ = Manager::instance().getUWPAppPath() + -// DIR_SEPARATOR_STR + std::string(".cache") + -// DIR_SEPARATOR_STR + getAccountID(); -//#else cachePath_ = fileutils::get_cache_dir()+DIR_SEPARATOR_STR+getAccountID(); dataPath_ = cachePath_ + DIR_SEPARATOR_STR "values"; idPath_ = fileutils::get_data_dir()+DIR_SEPARATOR_STR+getAccountID(); -//#endif } RingAccount::~RingAccount() @@ -468,12 +458,8 @@ RingAccount::checkIdentityPath() return; } -//ifndef WIN32_NATIVE const auto idPath = fileutils::get_data_dir() + DIR_SEPARATOR_STR + getAccountID(); -//#else -// const auto idPath = Manager::instance().getUWPAppPath() + DIR_SEPARATOR_STR + -// std::string(".data") + DIR_SEPARATOR_STR + getAccountID(); -//#endif + tlsPrivateKeyFile_ = idPath + DIR_SEPARATOR_STR "dht.key"; tlsCertificateFile_ = idPath + DIR_SEPARATOR_STR "dht.crt"; loadIdentity(); @@ -505,12 +491,9 @@ RingAccount::loadIdentity() if (!id.first || !id.second) { throw VoipLinkException("Can't generate identity for this account."); } -//#ifndef WIN32_NATIVE + idPath_ = fileutils::get_data_dir() + DIR_SEPARATOR_STR + getAccountID(); -//#else - //idPath_ = Manager::instance().getUWPAppPath() + DIR_SEPARATOR_STR + - //std::string(".data") + DIR_SEPARATOR_STR + getAccountID(); -//#endif + fileutils::check_dir(idPath_.c_str(), 0700); fileutils::saveFile(idPath_ + DIR_SEPARATOR_STR "ca.key", ca.first->serialize(), 0600);