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

[omemo] Let gajim-core issue a warning on plain text

parent d020e4ff
......@@ -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 " \
......
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