Commit 4b03268b authored by Tijmen de Mes's avatar Tijmen de Mes

Handle replicated SIP messages

parent b9b6e2df
......@@ -71,6 +71,10 @@ class SMSSettings(SettingsGroup):
private_key = Setting(type=ApplicationDataPath, default=None, nillable=True)
class SMSSettingsExtension(SMSSettings):
enable_message_replication = Setting(type=bool, default=True)
class SoundSettings(SettingsGroup):
inbound_ringtone = Setting(type=SoundFile, default=None, nillable=True)
......@@ -89,7 +93,7 @@ class AccountExtension(SettingsObjectExtension):
rtp = RTPSettingsExtension
server = ServerSettings
sip = SIPSettingsExtension
sms = SMSSettings
sms = SMSSettingsExtension
sounds = SoundSettings
xcap = XCAPSettingsExtension
......
This diff is collapsed.
......@@ -262,6 +262,7 @@ class PreferencesWindow(base_class, ui_class, metaclass=QSingleton):
self.message_imdn_enabled_button.clicked.connect(self._SH_EnableMessageIMDNButtonClicked)
self.message_add_unknown_contacts_button.clicked.connect(self._SH_AddUnknownContactsButtonClicked)
self.message_pgp_enabled_button.clicked.connect(self._SH_EnablePGPButtonClicked)
self.message_replication_button.clicked.connect(self._SH_MessageReplicationButtonClicked)
# Audio devices
self.audio_alert_device_button.activated[int].connect(self._SH_AudioAlertDeviceButtonActivated)
......@@ -901,9 +902,15 @@ class PreferencesWindow(base_class, ui_class, metaclass=QSingleton):
self.prefix_button.addItem(item_text)
self.prefix_button.setCurrentIndex(self.prefix_button.findText(item_text))
self._update_pstn_example_label()
# Messages tab
self.message_replication_button.show()
self.message_replication_button.setChecked(account.sms.enable_message_replication)
else:
self.account_auto_answer.setText('Auto answer from all neighbours')
self.message_replication_button.hide()
def update_chat_preview(self):
blink_settings = BlinkSettings()
......@@ -1455,6 +1462,11 @@ class PreferencesWindow(base_class, ui_class, metaclass=QSingleton):
account.sms.enable_pgp = checked
account.save()
def _SH_MessageReplicationButtonClicked(self, checked):
account = self.selected_account
account.sms.enable_message_replication = checked
account.save()
# Audio devices signal handlers
def _SH_AudioAlertDeviceButtonActivated(self, index):
device = self.audio_alert_device_button.itemData(index)
......
......@@ -1279,43 +1279,21 @@
</size>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="11" column="1">
<widget class="QCheckBox" name="message_add_unknown_contacts_button">
<item row="3" column="0" colspan="2">
<widget class="QCheckBox" name="message_iscomposing_enabled_button">
<property name="text">
<string>Add unknown contacts to 'Messages' group in your contacts</string>
<string>Enable Is-Composing</string>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="QLabel" name="label_4">
<property name="enabled">
<bool>false</bool>
</property>
<item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="message_cpim_enabled_button">
<property name="text">
<string>If you turn off IMDN you won't be able to see receipts from other people</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="Line" name="line_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<string>Use CPIM envelope</string>
</property>
</widget>
</item>
<item row="1" column="1">
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="message_label">
<property name="font">
<font>
......@@ -1331,28 +1309,55 @@
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QCheckBox" name="message_imdn_enabled_button">
<item row="12" column="0" colspan="2">
<widget class="QCheckBox" name="message_replication_button">
<property name="text">
<string>Enable IMDN (Read receipts)</string>
<string>Handle server replicated messages</string>
</property>
</widget>
</item>
<item row="2" column="1">
<item row="8" column="0" colspan="2">
<widget class="QCheckBox" name="message_add_unknown_contacts_button">
<property name="text">
<string>Add unknown contacts to 'Messages' group in your contacts</string>
</property>
</widget>
</item>
<item row="10" column="0" colspan="2">
<widget class="QLabel" name="history_label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>History and synchronization</string>
</property>
</widget>
</item>
<item row="9" column="0" colspan="2">
<widget class="QCheckBox" name="message_pgp_enabled_button">
<property name="text">
<string>Enable message encryption with OpenPGP (if supported by receiver)</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QCheckBox" name="message_iscomposing_enabled_button">
<item row="6" column="0" colspan="2">
<widget class="QCheckBox" name="message_imdn_enabled_button">
<property name="text">
<string>Enable Is-Composing</string>
<string>Enable IMDN (Read receipts)</string>
</property>
</widget>
</item>
<item row="7" column="1">
<item row="4" column="0" colspan="2">
<widget class="QLabel" name="label">
<property name="font">
<font>
......@@ -1365,23 +1370,46 @@
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="message_cpim_enabled_button">
<item row="7" column="0" colspan="2">
<widget class="QLabel" name="label_4">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Use CPIM envelope</string>
<string>If you turn off IMDN you won't be able to see receipts from other people</string>
</property>
</widget>
</item>
<item row="12" column="1">
<widget class="QCheckBox" name="message_pgp_enabled_button">
<property name="text">
<string>Enable message encryption with OpenPGP (if supported by receiver)</string>
<item row="5" column="0" colspan="2">
<widget class="Line" name="line_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="11" column="0" colspan="2">
<widget class="Line" name="history_line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="advanced_tab">
......@@ -2973,14 +3001,14 @@
<string>File Logging Settings</string>
</property>
<layout class="QGridLayout" name="logging_group_box_layout">
<item row="0" column="0" colspan="5">
<item row="0" column="0">
<widget class="QCheckBox" name="trace_sip_button">
<property name="text">
<string>Trace SIP</string>
</property>
</widget>
</item>
<item row="1" column="0">
<item row="1" column="0" colspan="5">
<widget class="QCheckBox" name="trace_messaging_button">
<property name="text">
<string>Trace SIP Messaging and PGP Encryption</string>
......
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