mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-07 22:02:12 +08:00
jamiaccount: do not emit signals during authentification
callbacks from OnChangeCallback are called during account's initialization. This will triggers signals that the client will already retrieve via dedicated methods and those signals are emitted when the account is not usable (accountManager or id_ not initialized). Change-Id: I8d16c077bbf8b827c91be9047b202cd5e859167a
This commit is contained in:
@ -1113,11 +1113,15 @@ JamiAccount::loadAccount(const std::string& archive_password,
|
||||
JAMI_DBG("[Account %s] loading account", getAccountID().c_str());
|
||||
AccountManager::OnChangeCallback callbacks {
|
||||
[this](const std::string& uri, bool confirmed) {
|
||||
if (!id_.first)
|
||||
return;
|
||||
runOnMainThread([id = getAccountID(), uri, confirmed] {
|
||||
emitSignal<DRing::ConfigurationSignal::ContactAdded>(id, uri, confirmed);
|
||||
});
|
||||
},
|
||||
[this](const std::string& uri, bool banned) {
|
||||
if (!id_.first)
|
||||
return;
|
||||
runOnMainThread([id = getAccountID(), uri, banned] {
|
||||
emitSignal<DRing::ConfigurationSignal::ContactRemoved>(id, uri, banned);
|
||||
});
|
||||
@ -1126,6 +1130,8 @@ JamiAccount::loadAccount(const std::string& archive_password,
|
||||
const std::string& conversationId,
|
||||
const std::vector<uint8_t>& payload,
|
||||
time_t received) {
|
||||
if (!id_.first)
|
||||
return;
|
||||
if (conversationId.empty()) {
|
||||
// Old path
|
||||
emitSignal<DRing::ConfigurationSignal::IncomingTrustRequest>(getAccountID(),
|
||||
@ -2303,7 +2309,8 @@ ConversationModule*
|
||||
JamiAccount::convModule()
|
||||
{
|
||||
if (!accountManager() || currentDeviceId() == "") {
|
||||
JAMI_ERR() << "Calling convModule() with an uninitialized account.";
|
||||
JAMI_ERR("[Account %s] Calling convModule() with an uninitialized account",
|
||||
getAccountID().c_str());
|
||||
return nullptr;
|
||||
}
|
||||
std::lock_guard<std::mutex> lk(moduleMtx_);
|
||||
|
Reference in New Issue
Block a user