diff --git a/omemo/CHANGELOG b/omemo/CHANGELOG
index 82c46bdbaca165e2dde3e589ac3594c2c995cb47..e03cdd42383b8c0a7ef9c62616464f1f28c2851d 100644
--- a/omemo/CHANGELOG
+++ b/omemo/CHANGELOG
@@ -1,105 +1,15 @@
-1.0.1 / 2017-01-14
-- Better XEP Compliance
-- Bugfixes
-
-1.0.0 / 2016-12-04
-- Bugfixes
-
-0.9.9 / 2016-12-01
-- Bugfixes
-
-0.9.8 / 2016-11-28
-- Fix a Problem where OMEMO wouldnt activate after the plugin is updated
-- Add QR Verification Code to Plugin Config
-
-0.9.7 / 2016-11-12
-- Bugfixes
-
-0.9.6 / 2016-11-01
-- Bugfixes
+2.0.3 / 2017-02-28
+- Set an inactive device active again after receiving a message from it
-0.9.5 / 2016-10-10
-- Add GroupChat BETA
-- Add Option to delete Fingerprints
-- Add Option to deactivate Accounts for OMEMO
+2.0.2 / 2017-02-28
+- Fix a bug when publishing devices
+- Fix copying fingerprint
+- Fix layout issue
+- Dont handle type 'normal' messages
-0.9.0 / 2016-08-28
-- Send INFO message to resources who dont support OMEMO
-- Check dependencys and give correct error message
-- Dont process PreKeyWhisperMessages without PreKey
-- Dont process PGP messages
-
-0.8.1 / 2016-08-05
-- Query own Device Bundles on send button press
-- Make Fingerprint Window higher and rename Buttons for something more appropriate
+2.0.1 / 2017-01-14
+- Better XEP Compliance
- Bugfixes
-0.8.0 / 2016-08-03
-- Encryption improvements:
--- SignedPreKey renews every 24 hours
--- New PreKeys are generated and published if less then 80 are available
--- If the Python Cryptography package is installed native encryption is now used (faster on old devices)
--- Bundle Information is only pulled right before sending a Message (see Business rules of the OMEMO XEP)
--- If Contact supports OMEMO, encryption is activated automatically
-
-- Other Stuff:
--- The Fingerprint Window pops up if the Send Button is pressed and there are new Fingerprints in the DB
--- Message Correction now works with OMEMO (Press STRG + UP Arrow to correct the last send message)
--- SQL Refactoring, so new users dont have to go through DB Migration
--- Small bugfixes
-
-0.7.5 / 2016-07-20
-================
-- Announcing of Support right after Plugin activation
-- New Context Menu for Gajim Compact View
-- Own Device Fingerprints are now available in the Fingerprint Window
-- Small bugfixes
-
-0.7 / 2016-07-16
-================
-- Reworked publishing Devicelist
-- Deactivate Gajim E2E on startup
-- Added new OMEMO popup menu
-- UI & handling of inactive Devices
-- various refactoring
-
-0.6 / 2016-06-30
-================
-- Add MAM support
-- Added Fingerprint Trustmanagment UI
-- Added Plugin Config Menu
-
-0.5 / 2016-05-02
-================
-- Add Windows support
-- Fix bugs
-
-0.4 / 2016-01-21
-==================
-
- * Update README.md
- * Fix #32: Add own devices as possible OMEMO partners.
- * Fix one of the errors in #26
- * Fix sqlite db intialization
- * Use the standalone python-omemo library
- * FIx LOG_DB errors / lost messages
- * Move all OMEMO related parts to own dir
- * Rename all links from kalkin/.. to omemo/...
- * Update archlinux PKGBUILD to 0.3
-
-0.3 / 2016-01-10
-==================
- * Save if OMEMO is enabled between restarts - #17
- * Disable OMEMO if dependencies are missing - #9
- * Make logging less verbose
- * Add Arch Linux PKGBUILD file (Thanks Tommaso Sardelli)
- * Extend README
- * Fix hiding OMEMO controls in muc
- * Fix "'ChatControl' object has no attribute 'lock_image'" bug - #16
- * Ui clearly displays which message is encrypted (and how) - #15
- * Plaintext messages are now always marked - #15
-
-# 2015-12-27
-- Fix crash, if jid is not in list (Thanks Mic92)
-- Fix clear_device_list, if account is not connected (Thanks Mic92)
-- Provide python-axolotl installation instructions in README and manifest.ini
+2.0.0 / 2016-12-04
+- Port Plugin from GTK2
diff --git a/omemo/fpr_dialog.ui b/omemo/fpr_dialog.ui
index 969aebe529757f80bec23f732eb9ae5ac29a8a9d..73c18d46d2c76a8d2ac3d645ea3cf7029d67c34d 100644
--- a/omemo/fpr_dialog.ui
+++ b/omemo/fpr_dialog.ui
@@ -292,6 +292,8 @@
diff --git a/omemo/manifest.ini b/omemo/manifest.ini
index d8822c56e217127bd984af80a3b698fd2fc94e57..0990a10189d261663b2f566b63fb5734eeba97f7 100644
--- a/omemo/manifest.ini
+++ b/omemo/manifest.ini
@@ -1,11 +1,10 @@
[info]
name: OMEMO
short_name: omemo
-version: 1.0.1
+version: 2.0.3
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 Github Wiki.
authors: Bahtiar `kalkin-` Gadimov
Daniel Gultsch
Philipp Hörist
homepage: https://dev.gajim.org/gajim/gajim-plugins/wikis/OmemoGajimPlugin
-min_gajim_version: 0.16.9
-max_gajim_version: 0.16.11
+min_gajim_version: 0.16.10
diff --git a/omemo/omemo/state.py b/omemo/omemo/state.py
index 2a9d5d0801ecb4dd95cbd42bbd1d3b8a0d2c23f0..2a899d1c4583dc0f5d3a1e8302cafa83f772f036 100644
--- a/omemo/omemo/state.py
+++ b/omemo/omemo/state.py
@@ -439,6 +439,7 @@ class OmemoState:
# Publish new bundle after PreKey has been used
# for building a new Session
self.plugin.publish_bundle(self.account)
+ self.add_device(recipient_id, device_id)
return key
except UntrustedIdentityException as e:
log.info(self.account + " => Received WhisperMessage " +
@@ -451,6 +452,7 @@ class OmemoState:
if self.isTrusted(recipient_id, device_id):
sessionCipher = self.get_session_cipher(recipient_id, device_id)
key = sessionCipher.decryptMsg(whisperMessage, textMsg=False)
+ self.add_device(recipient_id, device_id)
return key
else:
raise Exception("Received WhisperMessage "
diff --git a/omemo/omemoplugin.py b/omemo/omemoplugin.py
index 49fc0125dff06d2d9862e6d738e5893f056f33c0..8b4a71be8ddd056de934b4c61bf627facea8f991 100644
--- a/omemo/omemoplugin.py
+++ b/omemo/omemoplugin.py
@@ -589,6 +589,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
@@ -764,19 +767,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(
@@ -1047,7 +1056,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:
@@ -1065,7 +1074,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):
diff --git a/omemo/ui.py b/omemo/ui.py
index 464913c8459681b2cc2ba8d006eab7fcdcc5c76f..1da35f08be81c88d2cd74e3804d2f483f8126094 100644
--- a/omemo/ui.py
+++ b/omemo/ui.py
@@ -23,7 +23,7 @@ import logging
import os
import message_control
-from gi.repository import GObject, Gtk, GdkPixbuf
+from gi.repository import GObject, Gtk, GdkPixbuf, Gdk
# pylint: disable=import-error
import gtkgui_helpers
@@ -539,7 +539,7 @@ class OMEMOConfigDialog(GajimPluginConfigDialog):
keep_selection = tw.get_selection().path_is_selected(pthinfo[0])
pop = self.B.get_object('fprclipboard_menu')
- pop.popup(None, None, None, event.button, event.time)
+ pop.popup(None, None, None, None, event.button, event.time)
# keep_selection=True -> no further processing of click event
# keep_selection=False-> further processing -> GTK usually selects
@@ -553,9 +553,9 @@ class OMEMOConfigDialog(GajimPluginConfigDialog):
for path in paths:
it = mod.get_iter(path)
jid, fpr = mod.get(it, 1, 3)
- fprs.append('%s: %s' % (jid, fpr[4:-5]))
- Gtk.Clipboard().set_text('\n'.join(fprs))
- Gtk.Clipboard(selection='PRIMARY').set_text('\n'.join(fprs))
+ fprs.append('%s: %s' % (jid, fpr[31:-12]))
+ clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
+ clipboard.set_text('\n'.join(fprs), -1)
def update_context_list(self):
self.fpr_model.clear()
@@ -744,7 +744,7 @@ class FingerprintWindow(Gtk.Dialog):
keep_selection = tw.get_selection().path_is_selected(pthinfo[0])
pop = self.xml.get_object('fprclipboard_menu')
- pop.popup(None, None, None, event.button, event.time)
+ pop.popup(None, None, None, None, event.button, event.time)
# keep_selection=True -> no further processing of click event
# keep_selection=False-> further processing -> GTK usually selects
@@ -762,8 +762,8 @@ class FingerprintWindow(Gtk.Dialog):
it = mod.get_iter(path)
jid, fpr = mod.get(it, 1, 3)
fprs.append('%s: %s' % (jid, fpr[31:-12]))
- Gtk.Clipboard().set_text('\n'.join(fprs))
- Gtk.Clipboard(selection='PRIMARY').set_text('\n'.join(fprs))
+ clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
+ clipboard.set_text('\n'.join(fprs), -1)
def update_context_list(self, *args):
self.fpr_model.clear()