From b5a545dc958d04edb6d6f1010b9e6d7d9c640b88 Mon Sep 17 00:00:00 2001
From: Ming Rui Zhang <mingrui.zhang@savoirfairelinux.com>
Date: Mon, 3 Jun 2019 16:28:33 -0400
Subject: [PATCH] config: add local account peerdiscovery parameters

Change-Id: I7277fa61af30c918c67dad59b5d6ed003039670c
---
 src/api/account.h       | 2 ++
 src/newaccountmodel.cpp | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/src/api/account.h b/src/api/account.h
index 6f9ecfe3..8d3061f3 100644
--- a/src/api/account.h
+++ b/src/api/account.h
@@ -123,6 +123,8 @@ struct ConfProperties_t {
     std::string             proxyServer;
     std::string             proxyPushToken;
     bool                    peerDiscovery;
+    bool                    accountDiscovery;
+    bool                    accountPublish;
     int                     registrationExpire;
     struct Audio_t {
         int                 audioPortMax;
diff --git a/src/newaccountmodel.cpp b/src/newaccountmodel.cpp
index 887d613b..c3045d5d 100644
--- a/src/newaccountmodel.cpp
+++ b/src/newaccountmodel.cpp
@@ -674,6 +674,8 @@ account::Info::fromDetails(const MapStringString& details)
     confProperties.proxyServer                          = toStdString(details[ConfProperties::PROXY_SERVER]);
     confProperties.proxyPushToken                       = toStdString(details[ConfProperties::PROXY_PUSH_TOKEN]);
     confProperties.peerDiscovery                        = toBool(details[ConfProperties::DHT_PEER_DISCOVERY]);
+    confProperties.accountDiscovery                     = toBool(details[ConfProperties::ACCOUNT_PEER_DISCOVERY]);
+    confProperties.accountPublish                       = toBool(details[ConfProperties::ACCOUNT_PUBLISH]);
     // Audio
     confProperties.Audio.audioPortMax                   = toInt(details[ConfProperties::Audio::PORT_MAX]);
     confProperties.Audio.audioPortMin                   = toInt(details[ConfProperties::Audio::PORT_MIN]);
@@ -772,6 +774,8 @@ account::ConfProperties_t::toDetails() const
     details[ConfProperties::PROXY_SERVER]               = toQString(this->proxyServer);
     details[ConfProperties::PROXY_PUSH_TOKEN]           = toQString(this->proxyPushToken);
     details[ConfProperties::DHT_PEER_DISCOVERY]         = toQString(this->peerDiscovery);
+    details[ConfProperties::ACCOUNT_PEER_DISCOVERY]     = toQString(this->accountDiscovery);
+    details[ConfProperties::ACCOUNT_PUBLISH]            = toQString(this->accountPublish);
     // Audio
     details[ConfProperties::Audio::PORT_MAX]            = toQString(this->Audio.audioPortMax);
     details[ConfProperties::Audio::PORT_MIN]            = toQString(this->Audio.audioPortMin);
-- 
GitLab