From d2850ef37e6efc585b56dddc2787e67cf97548db Mon Sep 17 00:00:00 2001
From: Ming Rui Zhang <mingrui.zhang@savoirfairelinux.com>
Date: Thu, 12 Nov 2020 13:47:02 -0500
Subject: [PATCH] account: add keep alive enabled parameter into account
 configuration

Change-Id: I7bdffa89af1b90123c3cbae2d0c1ce0b18f22d75
---
 src/api/account.h       | 1 +
 src/newaccountmodel.cpp | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/src/api/account.h b/src/api/account.h
index fd10ba82..986f2cb3 100644
--- a/src/api/account.h
+++ b/src/api/account.h
@@ -112,6 +112,7 @@ struct ConfProperties_t
     bool accountDiscovery;
     bool accountPublish;
     int registrationExpire;
+    bool keepAliveEnabled;
     VectorMapStringString credentials;
     struct Audio_t
     {
diff --git a/src/newaccountmodel.cpp b/src/newaccountmodel.cpp
index 64b6bf6b..80dd4262 100644
--- a/src/newaccountmodel.cpp
+++ b/src/newaccountmodel.cpp
@@ -833,6 +833,7 @@ account::Info::fromDetails(const MapStringString& details)
     confProperties.peerDiscovery = toBool(details[ConfProperties::DHT_PEER_DISCOVERY]);
     confProperties.accountDiscovery = toBool(details[ConfProperties::ACCOUNT_PEER_DISCOVERY]);
     confProperties.accountPublish = toBool(details[ConfProperties::ACCOUNT_PUBLISH]);
+    confProperties.keepAliveEnabled = toBool(details[ConfProperties::KEEP_ALIVE_ENABLED]);
     // Audio
     confProperties.Audio.audioPortMax = toInt(details[ConfProperties::Audio::PORT_MAX]);
     confProperties.Audio.audioPortMin = toInt(details[ConfProperties::Audio::PORT_MIN]);
@@ -945,6 +946,7 @@ account::ConfProperties_t::toDetails() const
     details[ConfProperties::DHT_PEER_DISCOVERY] = toQString(this->peerDiscovery);
     details[ConfProperties::ACCOUNT_PEER_DISCOVERY] = toQString(this->accountDiscovery);
     details[ConfProperties::ACCOUNT_PUBLISH] = toQString(this->accountPublish);
+    details[ConfProperties::KEEP_ALIVE_ENABLED] = toQString(this->keepAliveEnabled);
     // Audio
     details[ConfProperties::Audio::PORT_MAX] = toQString(this->Audio.audioPortMax);
     details[ConfProperties::Audio::PORT_MIN] = toQString(this->Audio.audioPortMin);
-- 
GitLab