Skip to content
Snippets Groups Projects
Commit 37bad708 authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Merge branch 'master' into 'master'

Version 1.0.2

Closes #184 and #182

See merge request !18
parents e3035585 fddc7de7
No related branches found
No related tags found
No related merge requests found
1.0.2 / 2017-02-04
- Fix a bug when publishing devices
- Fix copying fingerprint
- Fix layout issue
- Dont handle type 'normal' messages
1.0.1 / 2017-01-14
- Better XEP Compliance
- Bugfixes
......
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="2.16"/>
<requires lib="gtk+" version="2.24"/>
<!-- interface-naming-policy toplevel-contextual -->
<object class="GtkListStore" id="account_store">
<columns>
......@@ -34,6 +34,20 @@
<column type="gint"/>
</columns>
</object>
<object class="GtkMenu" id="fprclipboard_menu">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkMenuItem" id="copyfprclipboard_item">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes" comments="Context menu item">Copy to clipboard</property>
<property name="use_underline">True</property>
<signal name="activate" handler="clipboard_button_cb" swapped="no"/>
</object>
</child>
</object>
<object class="GtkNotebook" id="notebook1">
<property name="visible">True</property>
<property name="can_focus">True</property>
......@@ -44,21 +58,23 @@
<property name="border_width">12</property>
<property name="spacing">10</property>
<child>
<object class="GtkHBox" id="hbox2">
<object class="GtkTable" id="table1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">5</property>
<property name="n_rows">5</property>
<property name="n_columns">3</property>
<property name="column_spacing">5</property>
<property name="row_spacing">7</property>
<child>
<object class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes" comments="label for account selector">&lt;b&gt;Account:&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
......@@ -75,78 +91,59 @@
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="x_options"></property>
<property name="x_padding">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkLabel" id="fingerprint_label_desc">
<property name="width_request">110</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes" comments="Descriptive label">Own Fingerprint:</property>
<property name="label" translatable="yes" comments="Descriptive label">Fingerprint:</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="fingerprint_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="use_markup">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="left_attach">1</property>
<property name="right_attach">3</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkLabel" id="OwnIDLabel">
<property name="width_request">110</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Own Device ID:</property>
<property name="label" translatable="yes">Device ID:</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
......@@ -156,47 +153,58 @@
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="left_attach">1</property>
<property name="right_attach">3</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
</packing>
</child>
<child>
<object class="GtkImage" id="qrcode">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="stock">gtk-missing-image</property>
<property name="icon-size">0</property>
</object>
<packing>
<property name="right_attach">3</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="qrinfo">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">For Verification QRCode please install python-qrcode</property>
<attributes>
<attribute name="weight" value="bold"/>
<attribute name="foreground" value="#ffff00000000"/>
</attributes>
</object>
<packing>
<property name="right_attach">3</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="fillelement">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkImage" id="qrcode">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="stock">gtk-missing-image</property>
<property name="icon-size">0</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="qrinfo">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">For Verification QRCode please install python-qrcode</property>
<attributes>
<attribute name="weight" value="bold"/>
<attribute name="foreground" value="#ffff00000000"/>
</attributes>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">4</property>
<property name="position">0</property>
</packing>
</child>
</object>
......@@ -205,7 +213,7 @@
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes" comments="tab label">Own Fingerprints</property>
<property name="label" translatable="yes" comments="tab label">Account Data</property>
</object>
<packing>
<property name="tab_fill">False</property>
......@@ -289,6 +297,7 @@
<child>
<object class="GtkButton" id="trust_button">
<property name="label" translatable="yes" comments="button">Trust/Revoke Fingerprint</property>
<property name="use_action_appearance">False</property>
<property name="width_request">200</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
......@@ -304,6 +313,7 @@
<child>
<object class="GtkButton" id="delfprbutton">
<property name="label" translatable="yes">Delete Fingerprint</property>
<property name="use_action_appearance">False</property>
<property name="width_request">200</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
......@@ -404,6 +414,7 @@
<child>
<object class="GtkButton" id="cleardevice_button">
<property name="label" translatable="yes">Clear Devices</property>
<property name="use_action_appearance">False</property>
<property name="width_request">160</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
......@@ -419,6 +430,7 @@
<child>
<object class="GtkButton" id="refresh">
<property name="label">gtk-refresh</property>
<property name="use_action_appearance">False</property>
<property name="width_request">160</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
......@@ -521,6 +533,7 @@
<child>
<object class="GtkButton" id="disable_accounts_btn">
<property name="label" translatable="yes">Disable Account</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
......@@ -578,6 +591,7 @@
<child>
<object class="GtkButton" id="activate_accounts_btn">
<property name="label" translatable="yes">Activate Account</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
......@@ -620,17 +634,4 @@
</packing>
</child>
</object>
<object class="GtkMenu" id="fprclipboard_menu">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkMenuItem" id="copyfprclipboard_item">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes" comments="Context menu item">Copy to clipboard</property>
<property name="use_underline">True</property>
<signal name="activate" handler="clipboard_button_cb" swapped="no"/>
</object>
</child>
</object>
</interface>
[info]
name: OMEMO
short_name: omemo
version: 1.0.1
version: 1.0.2
description: OMEMO is an XMPP Extension Protocol (XEP) for secure multi-client end-to-end encryption based on Axolotl and PEP. You need to install some dependencys, you can find install instructions for your system in the Gitlab Wiki.
authors: Bahtiar `kalkin-` Gadimov <bahtiar@gadimov.de>
Daniel Gultsch <daniel@gultsch.de>
......
......@@ -617,6 +617,9 @@ class OmemoPlugin(GajimPlugin):
-------
Return if encryption is not activated
"""
if event.type_ == 'normal':
return False
account = event.account
if account in self.disabled_accounts:
return
......@@ -792,19 +795,25 @@ class OmemoPlugin(GajimPlugin):
return True
@log_calls('OmemoPlugin')
def publish_own_devices_list(self, account):
""" Check if the passed event is a device list update and store the new
device ids.
def publish_own_devices_list(self, account, new=False):
""" Get all currently known own active device ids and publish them
Parameters
----------
account : str
the account name
new : bool
if True, a devicelist with only one
(the current id of this instance) device id is pushed
"""
state = self.get_omemo_state(account)
devices_list = state.own_devices
devices_list.append(state.own_device_id)
devices_list = list(set(devices_list))
if new:
devices_list = [state.own_device_id]
else:
devices_list = state.own_devices
devices_list.append(state.own_device_id)
devices_list = list(set(devices_list))
state.set_own_devices(devices_list)
log.debug(account + ' => Publishing own Devices: ' + str(
......@@ -1075,7 +1084,7 @@ class OmemoPlugin(GajimPlugin):
devices_list = list(set(unpack_device_list_update(stanza, account)))
if len(devices_list) == 0:
log.error(account + ' => Devicelistquery was NOT successful')
self.publish_own_devices_list(account)
self.publish_own_devices_list(account, new=True)
return False
contact_jid = stanza.getAttr('from')
if contact_jid == my_jid:
......@@ -1093,7 +1102,7 @@ class OmemoPlugin(GajimPlugin):
self.publish_own_devices_list(account)
else:
log.error(account + ' => Devicelistquery was NOT successful')
self.publish_own_devices_list(account)
self.publish_own_devices_list(account, new=True)
@log_calls('OmemoPlugin')
def clear_device_list(self, account):
......
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