Commit 37bad708 authored by Philipp Hörist's avatar Philipp Hörist

Merge branch 'master' into 'master'

Version 1.0.2

Closes #184 and #182

See merge request !18
parents e3035585 fddc7de7
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
......
This diff is collapsed.
[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):
......
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