mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-05-07 14:44:01 +00:00
Set presence to busy when reset presence when in call (Mantis 0014443)
This commit is contained in:
parent
e053fcf63e
commit
b6f465f9a0
2 changed files with 12 additions and 1 deletions
|
|
@ -292,6 +292,16 @@ void AccountCore::setSelf(QSharedPointer<AccountCore> me) {
|
|||
mAccountModel->setPresence(presence, userInitiated, resetToAuto, presenceNote);
|
||||
});
|
||||
});
|
||||
mAccountModelConnection->makeConnectToCore(
|
||||
&AccountCore::lResetToAutomaticPresence, [this](bool userInitiated, bool resetToAuto) {
|
||||
mAccountModelConnection->invokeToModel([this, userInitiated, resetToAuto, presenceNote = mPresenceNote]() {
|
||||
auto core = CoreModel::getInstance()->getCore();
|
||||
if (!core) return;
|
||||
mAccountModel->setPresence(core->getCallsNb() == 0 ? LinphoneEnums::Presence::Online
|
||||
: LinphoneEnums::Presence::Busy,
|
||||
userInitiated, resetToAuto, presenceNote);
|
||||
});
|
||||
});
|
||||
|
||||
DEFINE_CORE_GET_CONNECT(mAccountModelConnection, AccountCore, AccountModel, mAccountModel, int, voicemailCount,
|
||||
VoicemailCount)
|
||||
|
|
@ -876,7 +886,7 @@ QString AccountCore::getPresenceStatus() {
|
|||
}
|
||||
|
||||
void AccountCore::resetToAutomaticPresence() {
|
||||
emit lSetPresence(LinphoneEnums::Presence::Online, false, true);
|
||||
emit lResetToAutomaticPresence(false, true);
|
||||
}
|
||||
|
||||
LinphoneEnums::Presence AccountCore::getExplicitPresence() {
|
||||
|
|
|
|||
|
|
@ -235,6 +235,7 @@ signals:
|
|||
void lSetRegisterEnabled(bool enabled);
|
||||
void lSetNotificationsAllowed(bool value);
|
||||
void lSetPresence(LinphoneEnums::Presence presence, bool userInitiated = true, bool resetToAuto = false);
|
||||
void lResetToAutomaticPresence(bool userInitiated = true, bool resetToAuto = false);
|
||||
|
||||
protected:
|
||||
void writeIntoModel(std::shared_ptr<AccountModel> model) const;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue