From 8db1bee024a0e2e937754193278497ff631254ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Sun, 11 Jun 2017 00:09:20 +0200 Subject: [omemo] Let gajim-core issue a warning on plain text --- omemo/omemoplugin.py | 34 ---------------------------------- 1 file changed, 34 deletions(-) (limited to 'omemo') diff --git a/omemo/omemoplugin.py b/omemo/omemoplugin.py index 962cb21..3734b1a 100644 --- a/omemo/omemoplugin.py +++ b/omemo/omemoplugin.py @@ -428,18 +428,6 @@ class OmemoPlugin(GajimPlugin): msg.encrypted = self.encryption_name return - elif msg.msg_.getTag('body'): - account = msg.conn.name - - from_jid = str(msg.msg_.getAttr('from')) - from_jid = gajim.get_jid_without_resource(from_jid) - - state = self.get_omemo_state(account) - encryption = gajim.config.get_per('contacts', from_jid, 'encryption') - - if encryption == 'OMEMO': - msg.msgtxt = '**Unencrypted** ' + msg.msgtxt - def _message_received(self, msg): """ Handles an incoming message @@ -520,22 +508,6 @@ class OmemoPlugin(GajimPlugin): msg.stanza.setBody(plaintext) msg.encrypted = self.encryption_name - elif msg.stanza.getTag('body'): - account = msg.conn.name - - from_jid = str(msg.stanza.getFrom()) - jid = gajim.get_jid_without_resource(from_jid) - state = self.get_omemo_state(account) - encryption = gajim.config.get_per('contacts', jid, 'encryption') - - if encryption == 'OMEMO': - msg.msgtxt = '**Unencrypted** ' + msg.msgtxt - msg.stanza.setBody(msg.msgtxt) - - ctrl = gajim.interface.msg_win_mgr.get_control(jid, account) - if ctrl: - self.plain_warning(ctrl) - def room_memberlist_received(self, event): account = event.conn.name if account in self.disabled_accounts: @@ -1107,12 +1079,6 @@ class OmemoPlugin(GajimPlugin): log.debug(stanzastr) log.debug('-'*15) - @staticmethod - def plain_warning(chat_control): - chat_control.print_conversation_line( - 'Received plaintext message! ' + - 'Your next message will still be encrypted!', 'status', '', None) - @staticmethod def no_trusted_fingerprints_warning(chat_control): msg = "To send an encrypted message, you have to " \ -- cgit v1.2.3