Commit 6261e2db authored by Adrien Béraud's avatar Adrien Béraud Committed by Andreas Traczyk

dring: add AccountDetailsChanged signal

Change-Id: I538d3a777380d8c8c55c0999705a957a522a4a86
Reviewed-by: Andreas Traczyk's avatarAndreas Traczyk <andreas.traczyk@savoirfairelinux.com>
parent 616d4785
......@@ -874,6 +874,20 @@
<signal name="accountsChanged" tp:name-for-bindings="accountsChanged">
</signal>
<signal name="accountDetailsChanged" tp:name-for-bindings="accountDetailsChanged">
<arg type="s" name="accountID">
<tp:docstring>
The account ID
</tp:docstring>
</arg>
<annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="MapStringString"/>
<arg type="a{ss}" name="details" tp:type="String_String_Map">
<tp:docstring>
New persistent account details
</tp:docstring>
</arg>
</signal>
<signal name="registrationStateChanged" tp:name-for-bindings="registrationStateChanged">
<arg type="s" name="accountID"/>
<arg type="s" name="registrationState"/>
......
......@@ -172,6 +172,7 @@ DBusClient::initLibrary(int flags)
const std::map<std::string, SharedCallback> configEvHandlers = {
exportable_callback<ConfigurationSignal::VolumeChanged>(bind(&DBusConfigurationManager::volumeChanged, confM, _1, _2)),
exportable_callback<ConfigurationSignal::AccountsChanged>(bind(&DBusConfigurationManager::accountsChanged, confM)),
exportable_callback<ConfigurationSignal::AccountDetailsChanged>(bind(&DBusConfigurationManager::accountDetailsChanged, confM, _1, _2)),
exportable_callback<ConfigurationSignal::StunStatusFailed>(bind(&DBusConfigurationManager::stunStatusFailure, confM, _1)),
exportable_callback<ConfigurationSignal::RegistrationStateChanged>(bind(&DBusConfigurationManager::registrationStateChanged, confM, _1, _2, _3, _4)),
exportable_callback<ConfigurationSignal::VolatileDetailsChanged>(bind(&DBusConfigurationManager::volatileAccountDetailsChanged, confM, _1, _2)),
......
......@@ -2,7 +2,7 @@ dnl Ring - configure.ac for automake 1.9 and autoconf 2.59
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ([2.65])
AC_INIT([Ring Daemon],[4.2.0],[ring@gnu.org],[ring])
AC_INIT([Ring Daemon],[4.3.0],[ring@gnu.org],[ring])
AC_COPYRIGHT([[Copyright (c) Savoir-faire Linux 2004-2018]])
AC_REVISION([$Revision$])
......
......@@ -31,7 +31,7 @@ PROJECT_NAME = "Ring Daemon"
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = 4.2.0
PROJECT_NUMBER = 4.3.0
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer
......
......@@ -53,6 +53,7 @@ getSignalHandlers()
/* Configuration */
exported_callback<DRing::ConfigurationSignal::VolumeChanged>(),
exported_callback<DRing::ConfigurationSignal::AccountsChanged>(),
exported_callback<DRing::ConfigurationSignal::AccountDetailsChanged>(),
exported_callback<DRing::ConfigurationSignal::StunStatusFailed>(),
exported_callback<DRing::ConfigurationSignal::RegistrationStateChanged>(),
exported_callback<DRing::ConfigurationSignal::VolatileDetailsChanged>(),
......
......@@ -223,6 +223,10 @@ struct ConfigurationSignal {
};
// TODO: move those to AccountSignal in next API breakage
struct AccountDetailsChanged {
constexpr static const char* name = "AccountDetailsChanged";
using cb_type = void(const std::string& /*account_id*/, const std::map<std::string, std::string>& /* details */);
};
struct StunStatusFailed {
constexpr static const char* name = "StunStatusFailed";
using cb_type = void(const std::string& /*account_id*/);
......
......@@ -2653,6 +2653,9 @@ Manager::setAccountDetails(const std::string& accountID,
account->doRegister();
else
account->doUnregister();
// Update account details to the client side
emitSignal<DRing::ConfigurationSignal::AccountDetailsChanged>(accountID, details);
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment