Commit c2ee1b52 authored by Philipp Hörist's avatar Philipp Hörist
Browse files

[pgp] Fix filetransfer

parent 2369f11a
......@@ -27,12 +27,15 @@ import queue
import nbxmpp
from gi.repository import GLib
from gajim import dialogs
from gajim.common import app
from gajim.common.connection_handlers_events import MessageNotSentEvent
from gajim.plugins import GajimPlugin
from gajim.plugins.plugins_i18n import _
from gajim.gtk.dialogs import ErrorDialog
from gajim.gtk.dialogs import InformationDialog
from gajim.gtk.dialogs import YesNoDialog
log = logging.getLogger('gajim.plugin_system.oldpgp')
......@@ -108,19 +111,19 @@ class OldPGPPlugin(GajimPlugin):
key_id =
transient = chat_control.parent_win.window
authenticated, info = check_state(key_id, account)
dialogs.InformationDialog(authenticated, info, transient)
InformationDialog(authenticated, info, transient)
def _before_sendmessage(chat_control):
account = chat_control.account
if not
_('No OpenPGP key assigned'),
_('No OpenPGP key is assigned to this contact. So you cannot '
'encrypt messages with OpenPGP.'))
chat_control.sendmessage = False
elif not app.config.get_per('accounts', account, 'keyid'):
_('No OpenPGP key assigned'),
_('No OpenPGP key is assigned to your account. So you cannot '
'encrypt messages with OpenPGP.'))
......@@ -213,7 +216,7 @@ class OldPGPPlugin(GajimPlugin):
obj, msgenc=msgenc, error=error, conn=conn)
_('Untrusted OpenPGP key'),
_('The OpenPGP key used to encrypt this chat is not '
'trusted. Do you really want to encrypt this '
......@@ -269,7 +272,7 @@ class OldPGPPlugin(GajimPlugin):
def _encrypt_file_thread(self, file, account, callback):
my_key_id = app.config.get_per('accounts', account, 'keyid')
key_list = [, my_key_id]
key_list = [, my_key_id]
encrypted = self.get_gpg(account).encrypt_file(file.get_data(), key_list)
if not encrypted:
......@@ -286,8 +289,7 @@ class OldPGPPlugin(GajimPlugin):
def _on_file_encryption_error(file, error):
_('Error'), error, transient_for=file.control.parent_win.window)
ErrorDialog(_('Error'), error)
def cleanup_stanza(obj):
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