Commit 3487a68d authored by Adrien Béraud's avatar Adrien Béraud

dring: update profile received signal (breaking change)

Change-Id: Ia13b0ecf0dc66fdcfbd49ead62ab1fac806ba537
parent d4aeb0b9
......@@ -249,12 +249,14 @@
</arg>
</signal>
<signal name="accountAvatarReceived" tp:name-for-bindings="accountAvatarReceived">
<signal name="accountProfileReceived" tp:name-for-bindings="accountProfileReceived">
<tp:docstring>
Notify clients when a newly created account's avatar image is available for storage.
Notify clients when a newly created account's profile is available for storage.
</tp:docstring>
<arg type="s" name="accountID">
</arg>
<arg type="s" name="displayName">
</arg>
<arg type="s" name="photo">
</arg>
</signal>
......
......@@ -202,7 +202,7 @@ DBusClient::initLibrary(int flags)
exportable_callback<ConfigurationSignal::UserSearchEnded>(bind(&DBusConfigurationManager::userSearchEnded, confM, _1, _2, _3, _4 )),
exportable_callback<ConfigurationSignal::RegisteredNameFound>(bind(&DBusConfigurationManager::registeredNameFound, confM, _1, _2, _3, _4 )),
exportable_callback<ConfigurationSignal::DeviceRevocationEnded>(bind(&DBusConfigurationManager::deviceRevocationEnded, confM, _1, _2, _3)),
exportable_callback<ConfigurationSignal::AccountAvatarReceived>(bind(&DBusConfigurationManager::accountAvatarReceived, confM, _1, _2)),
exportable_callback<ConfigurationSignal::AccountProfileReceived>(bind(&DBusConfigurationManager::accountProfileReceived, confM, _1, _2, _3)),
exportable_callback<ConfigurationSignal::CertificatePinned>(bind(&DBusConfigurationManager::certificatePinned, confM, _1 )),
exportable_callback<ConfigurationSignal::CertificatePathPinned>(bind(&DBusConfigurationManager::certificatePathPinned, confM, _1, _2 )),
exportable_callback<ConfigurationSignal::CertificateExpired>(bind(&DBusConfigurationManager::certificateExpired, confM, _1 )),
......
......@@ -60,7 +60,7 @@ public:
virtual void migrationEnded(const std::string& /*accountId*/, const std::string& /*state*/){}
virtual void deviceRevocationEnded(const std::string& /*accountId*/, const std::string& /*device*/, int /*status*/){}
virtual void accountAvatarReceived(const std::string& /*accountId*/, const std::string& /*photo*/){}
virtual void accountProfileReceived(const std::string& /*accountId*/, const std::string& /*displayName*/, const std::string& /*photo*/){}
virtual void hardwareDecodingChanged(bool /*state*/){}
virtual void hardwareEncodingChanged(bool /*state*/){}
......@@ -273,7 +273,7 @@ public:
virtual void migrationEnded(const std::string& /*accountId*/, const std::string& /*state*/){}
virtual void deviceRevocationEnded(const std::string& /*accountId*/, const std::string& /*device*/, int /*status*/){}
virtual void accountAvatarReceived(const std::string& /*accountId*/, const std::string& /*photo*/){}
virtual void accountProfileReceived(const std::string& /*accountId*/, const std::string& /*displayName*/, const std::string& /*photo*/){}
virtual void hardwareDecodingChanged(bool /*state*/){}
virtual void hardwareEncodingChanged(bool /*state*/){}
......
......@@ -282,7 +282,7 @@ void init(ConfigurationCallback* confM, Callback* callM, PresenceCallback* presM
exportable_callback<ConfigurationSignal::UserSearchEnded>(bind(&ConfigurationCallback::userSearchEnded, confM, _1, _2, _3, _4 )),
exportable_callback<ConfigurationSignal::MigrationEnded>(bind(&ConfigurationCallback::migrationEnded, confM, _1, _2)),
exportable_callback<ConfigurationSignal::DeviceRevocationEnded>(bind(&ConfigurationCallback::deviceRevocationEnded, confM, _1, _2, _3)),
exportable_callback<ConfigurationSignal::AccountAvatarReceived>(bind(&ConfigurationCallback::accountAvatarReceived, confM, _1, _2))
exportable_callback<ConfigurationSignal::AccountProfileReceived>(bind(&ConfigurationCallback::accountProfileReceived, confM, _1, _2, _3))
};
// Presence event handlers
......
......@@ -55,7 +55,7 @@ public:
virtual void migrationEnded(const std::string& /*accountId*/, const std::string& /*state*/){}
virtual void deviceRevocationEnded(const std::string& /*accountId*/, const std::string& /*device*/, int /*status*/){}
virtual void accountAvatarReceived(const std::string& /*accountId*/, const std::string& /*photo*/){}
virtual void accountProfileReceived(const std::string& /*accountId*/, const std::string& /*names*/, const std::string& /*photo*/){}
virtual void hardwareDecodingChanged(bool /*state*/){}
virtual void hardwareEncodingChanged(bool /*state*/){}
......@@ -255,7 +255,7 @@ public:
virtual void migrationEnded(const std::string& /*accountId*/, const std::string& /*state*/){}
virtual void deviceRevocationEnded(const std::string& /*accountId*/, const std::string& /*device*/, int /*status*/){}
virtual void accountAvatarReceived(const std::string& /*accountId*/, const std::string& /*photo*/){}
virtual void accountProfileReceived(const std::string& /*accountId*/, const std::string& /*names*/, const std::string& /*photo*/){}
virtual void hardwareDecodingChanged(bool /*state*/){}
virtual void hardwareEncodingChanged(bool /*state*/){}
......
......@@ -76,7 +76,7 @@ getSignalHandlers()
exported_callback<DRing::ConfigurationSignal::MediaParametersChanged>(),
exported_callback<DRing::ConfigurationSignal::MigrationEnded>(),
exported_callback<DRing::ConfigurationSignal::DeviceRevocationEnded>(),
exported_callback<DRing::ConfigurationSignal::AccountAvatarReceived>(),
exported_callback<DRing::ConfigurationSignal::AccountProfileReceived>(),
exported_callback<DRing::ConfigurationSignal::Error>(),
#if defined(__ANDROID__) || (defined(TARGET_OS_IOS) && TARGET_OS_IOS)
exported_callback<DRing::ConfigurationSignal::GetHardwareAudioFormat>(),
......
......@@ -362,9 +362,9 @@ struct DRING_PUBLIC ConfigurationSignal {
constexpr static const char* name = "DeviceRevocationEnded";
using cb_type = void(const std::string& /*accountId*/, const std::string& /*device*/, int /*status*/);
};
struct DRING_PUBLIC AccountAvatarReceived {
constexpr static const char* name = "AccountAvatarReceived";
using cb_type = void(const std::string& /*accountId*/, const std::string& /*userPhoto*/);
struct DRING_PUBLIC AccountProfileReceived {
constexpr static const char* name = "AccountProfileReceived";
using cb_type = void(const std::string& /*accountId*/, const std::string& displayName, const std::string& /*userPhoto*/);
};
/**
* These are special getters for Android and UWP, so the daemon can retrieve
......
......@@ -1174,8 +1174,6 @@ JamiAccount::loadAccount(const std::string& archive_password, const std::string&
fileutils::check_dir(idPath_.c_str(), 0700);
emitSignal<DRing::ConfigurationSignal::AccountAvatarReceived>(getAccountID(), info.photo);
// save the chain including CA
auto id = info.identity;
id.first = std::move(fDeviceKey.get());
......@@ -1201,6 +1199,9 @@ JamiAccount::loadAccount(const std::string& archive_password, const std::string&
if (migrating) {
Migration::setState(getAccountID(), Migration::State::SUCCESS);
}
if (not info.photo.empty())
emitSignal<DRing::ConfigurationSignal::AccountProfileReceived>(getAccountID(), displayName_, info.photo);
setRegistrationState(RegistrationState::UNREGISTERED);
saveConfig();
doRegister();
......
......@@ -162,7 +162,6 @@ ServerAccountManager::initAuthentication(
}
ctx->onSuccess(*this_.info_, std::move(config), std::move(receipt), std::move(receiptSignature));
this_.syncDevices();
});
}
catch (const std::exception& e) {
......
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