mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-02-07 15:08:24 +00:00
Set presence to busy when reset presence when in call (Mantis 0014443)
This commit is contained in:
parent
191b17bc8a
commit
35ed305af1
2 changed files with 12 additions and 1 deletions
|
|
@ -298,6 +298,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)
|
||||
|
|
@ -904,7 +914,7 @@ QString AccountCore::getPresenceStatus() {
|
|||
}
|
||||
|
||||
void AccountCore::resetToAutomaticPresence() {
|
||||
emit lSetPresence(LinphoneEnums::Presence::Online, false, true);
|
||||
emit lResetToAutomaticPresence(false, true);
|
||||
}
|
||||
|
||||
LinphoneEnums::Presence AccountCore::getExplicitPresence() {
|
||||
|
|
|
|||
|
|
@ -240,6 +240,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