Skip to content
Snippets Groups Projects
Commit 7531305b authored by Sébastien Blin's avatar Sébastien Blin
Browse files

account: add support for sendReadReceipt

Change-Id: Iba44d7b7618c61db01d37477aee0a73ead094ca8
GitLab: https://git.jami.net/savoirfairelinux/ring-daemon/-/issues/599
parent 6b3bf514
No related branches found
No related tags found
No related merge requests found
......@@ -65,6 +65,7 @@
<file>src/settingsview/components/AdvancedPublicAddressSettings.qml</file>
<file>src/settingsview/components/AdvancedConnectivitySettings.qml</file>
<file>src/settingsview/components/AdvancedCallSettings.qml</file>
<file>src/settingsview/components/AdvancedChatSettings.qml</file>
<file>src/settingsview/components/SettingMaterialButton.qml</file>
<file>src/settingsview/components/ToggleSwitch.qml</file>
<file>src/settingsview/components/SettingSpinBox.qml</file>
......
......@@ -75,6 +75,11 @@ Item {
property string addCustomRingtone: qsTr("Add a custom ringtone")
property string selectNewRingtone: qsTr("Select a new ringtone")
// AdvancedChatSettings
property string chatSettings: qsTr("Chat Settings")
property string enableReadReceipts: qsTr("Enable read receipts")
property string enableReadReceiptsTooltip: qsTr("Send and receive receipts indicating that a message have been displayed")
// AdvancedVoiceMailSettings
property string voiceMail: qsTr("Voicemail")
property string voiceMailDialCode: qsTr("Voicemail dial code")
......
......@@ -324,6 +324,12 @@ SettingsAdapter::getAccountConfig_DHT_PublicInCalls()
return getAccountConfig().DHT.PublicInCalls;
}
bool
SettingsAdapter::getAccountConfig_ReadReceipt()
{
return getAccountConfig().sendReadReceipt;
}
bool
SettingsAdapter::getAccountConfig_RendezVous()
{
......@@ -632,6 +638,15 @@ SettingsAdapter::setAutoAnswerCalls(bool state)
lrcInstance_->accountModel().setAccountConfig(lrcInstance_->get_currentAccountId(), confProps);
}
void
SettingsAdapter::setSendReadReceipt(bool state)
{
auto confProps = lrcInstance_->accountModel().getAccountConfig(
lrcInstance_->get_currentAccountId());
confProps.sendReadReceipt = state;
lrcInstance_->accountModel().setAccountConfig(lrcInstance_->get_currentAccountId(), confProps);
}
void
SettingsAdapter::setEnableRingtone(bool state)
{
......
......@@ -104,6 +104,7 @@ public:
Q_INVOKABLE bool getAccountConfig_PeerDiscovery();
Q_INVOKABLE bool getAccountConfig_DHT_PublicInCalls();
Q_INVOKABLE bool getAccountConfig_ReadReceipt();
Q_INVOKABLE bool getAccountConfig_RendezVous();
Q_INVOKABLE bool getAccountConfig_AutoAnswer();
......@@ -164,6 +165,7 @@ public:
Q_INVOKABLE void setCallsUntrusted(bool state);
Q_INVOKABLE void setIsRendezVous(bool state);
Q_INVOKABLE void setAutoAnswerCalls(bool state);
Q_INVOKABLE void setSendReadReceipt(bool state);
Q_INVOKABLE void setEnableRingtone(bool state);
Q_INVOKABLE void setEnableProxy(bool state);
Q_INVOKABLE void setKeepAliveEnabled(bool state);
......
/*
* Copyright (C) 2021 by Savoir-faire Linux
* Author: Sébastien Blin <sebastien.blin@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.14
import QtQuick.Layouts 1.14
import QtQuick.Controls 2.14
import net.jami.Adapters 1.0
import net.jami.Constants 1.0
import "../../commoncomponents"
ColumnLayout {
id: root
property int itemWidth
function updateSettings() {
checkBoxSendDisplayed.checked = SettingsAdapter.getAccountConfig_ReadReceipt()
}
ElidedTextLabel {
Layout.fillWidth: true
eText: JamiStrings.chatSettings
fontSize: JamiTheme.headerFontSize
maxWidth: width
}
ColumnLayout {
Layout.fillWidth: true
Layout.leftMargin: JamiTheme.preferredMarginSize
ToggleSwitch {
id: checkBoxSendDisplayed
tooltipText: JamiStrings.enableReadReceiptsTooltip
labelText: JamiStrings.enableReadReceipts
fontPointSize: JamiTheme.settingsFontSize
onSwitchToggled: {
SettingsAdapter.setSendReadReceipt(checked)
}
}
}
}
......@@ -39,6 +39,7 @@ ColumnLayout {
function updateAdvancedAccountInfos() {
advancedCallSettings.updateCallSettingsInfos()
advancedChatSettings.updateSettings()
advancedVoiceMailSettings.updateVoiceMailSettingsInfos()
advancedSIPSecuritySettings.updateSecurityAccountInfos()
advancedNameServerSettings.updateNameServerInfos()
......@@ -104,7 +105,16 @@ ColumnLayout {
Layout.fillWidth: true
isSIP: root.isSIP
isSIP: LRCInstance.currentAccountType === Profile.Type.SIP
itemWidth: root.itemWidth
}
AdvancedChatSettings {
id: advancedChatSettings
Layout.fillWidth: true
visible: LRCInstance.currentAccountType === Profile.Type.JAMI
itemWidth: root.itemWidth
}
......@@ -113,7 +123,7 @@ ColumnLayout {
Layout.fillWidth: true
visible: root.isSIP
visible: LRCInstance.currentAccountType === Profile.Type.SIP
itemWidth: root.itemWidth
}
......@@ -122,7 +132,7 @@ ColumnLayout {
Layout.fillWidth: true
visible: root.isSIP
visible: LRCInstance.currentAccountType === Profile.Type.SIP
itemWidth: root.itemWidth
}
......@@ -131,7 +141,7 @@ ColumnLayout {
Layout.fillWidth: true
visible: !root.isSIP
visible: LRCInstance.currentAccountType === Profile.Type.JAMI
itemWidth: root.itemWidth
}
......@@ -140,7 +150,7 @@ ColumnLayout {
Layout.fillWidth: true
visible: !root.isSIP
visible: LRCInstance.currentAccountType === Profile.Type.JAMI
itemWidth: root.itemWidth
}
......@@ -149,7 +159,7 @@ ColumnLayout {
Layout.fillWidth: true
visible: !root.isSIP
visible: LRCInstance.currentAccountType === Profile.Type.JAMI
itemWidth: root.itemWidth
}
......@@ -159,7 +169,7 @@ ColumnLayout {
Layout.fillWidth: true
itemWidth: root.itemWidth
isSIP: root.isSIP
isSIP: LRCInstance.currentAccountType === Profile.Type.SIP
}
AdvancedPublicAddressSettings {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment