Commit 14d6074f authored by Philipp Hörist's avatar Philipp Hörist

Remove unused encrypted attribute

Encryption information is saved in additional_data attribute
parent 56aa7baa
...@@ -802,7 +802,7 @@ def _nec_mam_decrypted_message_received(self, obj): ...@@ -802,7 +802,7 @@ def _nec_mam_decrypted_message_received(self, obj):
self.add_message( self.add_message(
obj.msgtxt, kind, tim=obj.timestamp, obj.msgtxt, kind, tim=obj.timestamp,
encrypted=obj.encrypted, correct_id=obj.correct_id, correct_id=obj.correct_id,
message_id=obj.message_id, additional_data=obj.additional_data) message_id=obj.message_id, additional_data=obj.additional_data)
def _nec_decrypted_message_received(self, obj): def _nec_decrypted_message_received(self, obj):
...@@ -819,9 +819,10 @@ def _nec_decrypted_message_received(self, obj): ...@@ -819,9 +819,10 @@ def _nec_decrypted_message_received(self, obj):
typ = 'out' typ = 'out'
self.add_message(obj.msgtxt, typ, self.add_message(obj.msgtxt, typ,
tim=obj.timestamp, encrypted=obj.encrypted, subject=obj.subject, tim=obj.timestamp, subject=obj.subject,
xhtml=obj.xhtml, displaymarking=obj.displaymarking, xhtml=obj.xhtml, displaymarking=obj.displaymarking,
msg_log_id=obj.msg_log_id, message_id=obj.message_id, correct_id=obj.correct_id, msg_log_id=obj.msg_log_id, message_id=obj.message_id,
correct_id=obj.correct_id,
additional_data=obj.additional_data) additional_data=obj.additional_data)
if obj.msg_log_id: if obj.msg_log_id:
pw = self.parent_win pw = self.parent_win
...@@ -855,7 +856,7 @@ def _message_sent(self, obj): ...@@ -855,7 +856,7 @@ def _message_sent(self, obj):
self.msg_textview, 'gajim-msg-correcting') self.msg_textview, 'gajim-msg-correcting')
self.add_message(obj.message, self.contact.jid, tim=obj.timestamp, self.add_message(obj.message, self.contact.jid, tim=obj.timestamp,
encrypted=obj.encrypted, xhtml=obj.xhtml, xhtml=obj.xhtml,
displaymarking=displaymarking, message_id=message_id, displaymarking=displaymarking, message_id=message_id,
correct_id=obj.correct_id, correct_id=obj.correct_id,
additional_data=obj.additional_data) additional_data=obj.additional_data)
...@@ -887,7 +888,7 @@ def send_message(self, message, xhtml=None, ...@@ -887,7 +888,7 @@ def send_message(self, message, xhtml=None,
def get_our_nick(self): def get_our_nick(self):
return app.nicks[self.account] return app.nicks[self.account]
def add_message(self, text, frm='', tim=None, encrypted=None, def add_message(self, text, frm='', tim=None,
subject=None, xhtml=None, subject=None, xhtml=None,
displaymarking=None, msg_log_id=None, correct_id=None, displaymarking=None, msg_log_id=None, correct_id=None,
message_id=None, additional_data=None, error=None): message_id=None, additional_data=None, error=None):
...@@ -921,7 +922,7 @@ def add_message(self, text, frm='', tim=None, encrypted=None, ...@@ -921,7 +922,7 @@ def add_message(self, text, frm='', tim=None, encrypted=None,
else: else:
kind = 'outgoing' kind = 'outgoing'
name = self.get_our_nick() name = self.get_our_nick()
if not xhtml and not encrypted and \ if not xhtml and \
app.config.get('rst_formatting_outgoing_messages'): app.config.get('rst_formatting_outgoing_messages'):
from gajim.common.rst_xhtml_generator import create_xhtml from gajim.common.rst_xhtml_generator import create_xhtml
xhtml = create_xhtml(text) xhtml = create_xhtml(text)
...@@ -932,7 +933,7 @@ def add_message(self, text, frm='', tim=None, encrypted=None, ...@@ -932,7 +933,7 @@ def add_message(self, text, frm='', tim=None, encrypted=None,
displaymarking=displaymarking, displaymarking=displaymarking,
msg_log_id=msg_log_id, message_id=message_id, msg_log_id=msg_log_id, message_id=message_id,
correct_id=correct_id, additional_data=additional_data, correct_id=correct_id, additional_data=additional_data,
encrypted=encrypted, error=error) error=error)
if text.startswith('/me ') or text.startswith('/me\n'): if text.startswith('/me ') or text.startswith('/me\n'):
self.old_msg_kind = None self.old_msg_kind = None
else: else:
...@@ -1288,7 +1289,7 @@ def read_queue(self): ...@@ -1288,7 +1289,7 @@ def read_queue(self):
if event.sent_forwarded: if event.sent_forwarded:
kind = 'out' kind = 'out'
self.add_message(event.message, kind, tim=event.time, self.add_message(event.message, kind, tim=event.time,
encrypted=event.encrypted, subject=event.subject, subject=event.subject,
xhtml=event.xhtml, displaymarking=event.displaymarking, xhtml=event.xhtml, displaymarking=event.displaymarking,
correct_id=event.correct_id, message_id=event.message_id, correct_id=event.correct_id, message_id=event.message_id,
additional_data=event.additional_data) additional_data=event.additional_data)
......
...@@ -991,7 +991,7 @@ def add_message(self, text, kind, name, tim, ...@@ -991,7 +991,7 @@ def add_message(self, text, kind, name, tim,
old_kind=None, xhtml=None, old_kind=None, xhtml=None,
displaymarking=None, msg_log_id=None, displaymarking=None, msg_log_id=None,
message_id=None, correct_id=None, additional_data=None, message_id=None, correct_id=None, additional_data=None,
encrypted=None, marker=None, error=None): marker=None, error=None):
""" """
Print 'chat' type messages Print 'chat' type messages
correct_id = (message_id, correct_id) correct_id = (message_id, correct_id)
...@@ -1017,7 +1017,7 @@ def add_message(self, text, kind, name, tim, ...@@ -1017,7 +1017,7 @@ def add_message(self, text, kind, name, tim,
subject, old_kind, xhtml, subject, old_kind, xhtml,
displaymarking=displaymarking, message_id=message_id, displaymarking=displaymarking, message_id=message_id,
correct_id=correct_id, additional_data=additional_data, correct_id=correct_id, additional_data=additional_data,
encrypted=encrypted, marker=marker, error=error) marker=marker, error=error)
if restored: if restored:
return return
......
...@@ -1535,7 +1535,7 @@ def _nec_stanza_message_outgoing(self, obj): ...@@ -1535,7 +1535,7 @@ def _nec_stanza_message_outgoing(self, obj):
if encryption: if encryption:
app.plugin_manager.extension_point( app.plugin_manager.extension_point(
'encrypt' + encryption, self, obj, self.send_message) 'encrypt' + encryption, self, obj, self.send_message)
if not obj.encrypted: if not obj.additional_data.get_value('encrypted', 'name', False):
# Dont propagate event # Dont propagate event
return True return True
else: else:
......
...@@ -590,8 +590,6 @@ def init(self): ...@@ -590,8 +590,6 @@ def init(self):
self.attention = False self.attention = False
self.correct_id = None self.correct_id = None
self.automatic_message = True self.automatic_message = True
self.encryption = ''
self.encrypted = False
def get_full_jid(self): def get_full_jid(self):
if self.resource: if self.resource:
......
...@@ -61,7 +61,7 @@ def __init__(self, time_=None, show_in_roster=False, show_in_systray=True): ...@@ -61,7 +61,7 @@ def __init__(self, time_=None, show_in_roster=False, show_in_systray=True):
class ChatEvent(Event): class ChatEvent(Event):
type_ = 'chat' type_ = 'chat'
def __init__(self, message, subject, kind, time_, encrypted, resource, def __init__(self, message, subject, kind, time_, resource,
msg_log_id, correct_id=None, message_id=None, xhtml=None, session=None, msg_log_id, correct_id=None, message_id=None, xhtml=None, session=None,
displaymarking=None, sent_forwarded=False, show_in_roster=False, displaymarking=None, sent_forwarded=False, show_in_roster=False,
show_in_systray=True, additional_data=None): show_in_systray=True, additional_data=None):
...@@ -71,7 +71,6 @@ def __init__(self, message, subject, kind, time_, encrypted, resource, ...@@ -71,7 +71,6 @@ def __init__(self, message, subject, kind, time_, encrypted, resource,
self.subject = subject self.subject = subject
self.kind = kind self.kind = kind
self.time = time_ self.time = time_
self.encrypted = encrypted
self.resource = resource self.resource = resource
self.msg_log_id = msg_log_id self.msg_log_id = msg_log_id
self.message_id = message_id self.message_id = message_id
......
...@@ -232,7 +232,6 @@ def _mam_message_received(self, _con, stanza, properties): ...@@ -232,7 +232,6 @@ def _mam_message_received(self, _con, stanza, properties):
{'conn': self._con, {'conn': self._con,
'account': self._account, 'account': self._account,
'additional_data': additional_data, 'additional_data': additional_data,
'encrypted': False,
'timestamp': properties.mam.timestamp, 'timestamp': properties.mam.timestamp,
'self_message': properties.is_self_message, 'self_message': properties.is_self_message,
'groupchat': groupchat, 'groupchat': groupchat,
......
...@@ -178,7 +178,6 @@ def _message_received(self, _con, stanza, properties): ...@@ -178,7 +178,6 @@ def _message_received(self, _con, stanza, properties):
'stanza': stanza, 'stanza': stanza,
'account': self._account, 'account': self._account,
'id_': properties.id, 'id_': properties.id,
'encrypted': False,
'additional_data': additional_data, 'additional_data': additional_data,
'forwarded': properties.is_carbon_message, 'forwarded': properties.is_carbon_message,
'sent': properties.is_carbon_message and properties.carbon.is_sent, 'sent': properties.is_carbon_message and properties.carbon.is_sent,
......
...@@ -95,7 +95,6 @@ def _messageCB(self, con, stanza, properties): ...@@ -95,7 +95,6 @@ def _messageCB(self, con, stanza, properties):
'stanza': stanza, 'stanza': stanza,
'account': self.name, 'account': self.name,
'id_': id_, 'id_': id_,
'encrypted': False,
'additional_data': additional_data, 'additional_data': additional_data,
'forwarded': False, 'forwarded': False,
'sent': False, 'sent': False,
......
...@@ -915,7 +915,7 @@ def print_conversation_line(self, text, kind, name, tim, ...@@ -915,7 +915,7 @@ def print_conversation_line(self, text, kind, name, tim,
other_tags_for_name=None, other_tags_for_time=None, other_tags_for_text=None, other_tags_for_name=None, other_tags_for_time=None, other_tags_for_text=None,
subject=None, old_kind=None, xhtml=None, graphics=True, subject=None, old_kind=None, xhtml=None, graphics=True,
displaymarking=None, message_id=None, correct_id=None, additional_data=None, displaymarking=None, message_id=None, correct_id=None, additional_data=None,
encrypted=None, marker=None, error=None): marker=None, error=None):
""" """
Print 'chat' type messages Print 'chat' type messages
""" """
......
...@@ -821,8 +821,8 @@ def _nec_mam_decrypted_message_received(self, obj): ...@@ -821,8 +821,8 @@ def _nec_mam_decrypted_message_received(self, obj):
return return
self.add_message( self.add_message(
obj.msgtxt, contact=obj.nick, obj.msgtxt, contact=obj.nick,
tim=obj.timestamp, correct_id=obj.correct_id, tim=obj.timestamp,
encrypted=obj.encrypted, correct_id=obj.correct_id,
message_id=obj.message_id, message_id=obj.message_id,
additional_data=obj.additional_data) additional_data=obj.additional_data)
...@@ -840,13 +840,13 @@ def _nec_gc_message_received(self, obj): ...@@ -840,13 +840,13 @@ def _nec_gc_message_received(self, obj):
self.add_message( self.add_message(
obj.msgtxt, contact=obj.nick, obj.msgtxt, contact=obj.nick,
tim=obj.timestamp, xhtml=obj.xhtml_msgtxt, tim=obj.timestamp, xhtml=obj.xhtml_msgtxt,
displaymarking=obj.displaymarking, encrypted=obj.encrypted, displaymarking=obj.displaymarking,
correct_id=obj.correct_id, message_id=obj.message_id, correct_id=obj.correct_id, message_id=obj.message_id,
additional_data=obj.additional_data) additional_data=obj.additional_data)
obj.needs_highlight = self.needs_visual_notification(obj.msgtxt) obj.needs_highlight = self.needs_visual_notification(obj.msgtxt)
def on_private_message(self, nick, sent, msg, tim, xhtml, session, def on_private_message(self, nick, sent, msg, tim, xhtml, session,
msg_log_id=None, encrypted=False, msg_log_id=None,
displaymarking=None): displaymarking=None):
# Do we have a queue? # Do we have a queue?
fjid = self.room_jid + '/' + nick fjid = self.room_jid + '/' + nick
...@@ -855,7 +855,6 @@ def on_private_message(self, nick, sent, msg, tim, xhtml, session, ...@@ -855,7 +855,6 @@ def on_private_message(self, nick, sent, msg, tim, xhtml, session,
'', '',
'incoming', 'incoming',
tim, tim,
encrypted,
'', '',
msg_log_id, msg_log_id,
xhtml=xhtml, xhtml=xhtml,
...@@ -882,7 +881,7 @@ def on_private_message(self, nick, sent, msg, tim, xhtml, session, ...@@ -882,7 +881,7 @@ def on_private_message(self, nick, sent, msg, tim, xhtml, session,
def add_message(self, text, contact='', tim=None, xhtml=None, def add_message(self, text, contact='', tim=None, xhtml=None,
displaymarking=None, correct_id=None, message_id=None, displaymarking=None, correct_id=None, message_id=None,
encrypted=None, additional_data=None): additional_data=None):
""" """
Add message to the ConversationsTextview Add message to the ConversationsTextview
...@@ -925,7 +924,7 @@ def add_message(self, text, contact='', tim=None, xhtml=None, ...@@ -925,7 +924,7 @@ def add_message(self, text, contact='', tim=None, xhtml=None,
self, text, kind, contact, tim, self, text, kind, contact, tim,
other_tags_for_name, [], other_tags_for_text, xhtml=xhtml, other_tags_for_name, [], other_tags_for_text, xhtml=xhtml,
displaymarking=displaymarking, displaymarking=displaymarking,
correct_id=correct_id, message_id=message_id, encrypted=encrypted, correct_id=correct_id, message_id=message_id,
additional_data=additional_data) additional_data=additional_data)
def get_nb_unread(self): def get_nb_unread(self):
...@@ -1095,7 +1094,7 @@ def _nec_decrypted_message_received(self, obj): ...@@ -1095,7 +1094,7 @@ def _nec_decrypted_message_received(self, obj):
frm = 'out' frm = 'out'
obj.session.control.add_message( obj.session.control.add_message(
obj.msgtxt, frm, obj.msgtxt, frm,
tim=obj.timestamp, xhtml=obj.xhtml, encrypted=obj.encrypted, tim=obj.timestamp, xhtml=obj.xhtml,
displaymarking=obj.displaymarking, displaymarking=obj.displaymarking,
message_id=obj.message_id, message_id=obj.message_id,
correct_id=obj.correct_id) correct_id=obj.correct_id)
...@@ -1104,7 +1103,7 @@ def _nec_decrypted_message_received(self, obj): ...@@ -1104,7 +1103,7 @@ def _nec_decrypted_message_received(self, obj):
self.on_private_message( self.on_private_message(
nick, obj.sent, obj.msgtxt, obj.timestamp, nick, obj.sent, obj.msgtxt, obj.timestamp,
obj.xhtml, self.session, msg_log_id=obj.msg_log_id, obj.xhtml, self.session, msg_log_id=obj.msg_log_id,
encrypted=obj.encrypted, displaymarking=obj.displaymarking) displaymarking=obj.displaymarking)
def _nec_ping(self, obj): def _nec_ping(self, obj):
if self.contact.jid != obj.contact.room_jid: if self.contact.jid != obj.contact.room_jid:
......
...@@ -378,7 +378,7 @@ def _nec_decrypted_message_received(self, obj): ...@@ -378,7 +378,7 @@ def _nec_decrypted_message_received(self, obj):
event_type = 'pm' event_type = 'pm'
self.raise_signal('NewMessage', ( self.raise_signal('NewMessage', (
obj.conn.name, [obj.fjid, obj.msgtxt, obj.timestamp, obj.conn.name, [obj.fjid, obj.msgtxt, obj.timestamp,
obj.encrypted, event_type, obj.subject, event_type, obj.subject,
obj.msg_log_id, obj.user_nick, obj.xhtml])) obj.msg_log_id, obj.user_nick, obj.xhtml]))
def on_our_status(self, obj): def on_our_status(self, obj):
......
...@@ -226,7 +226,7 @@ def roster_message2(self, obj): ...@@ -226,7 +226,7 @@ def roster_message2(self, obj):
if do_event: if do_event:
kind = obj.properties.type.value kind = obj.properties.type.value
event = event_t(obj.msgtxt, obj.subject, kind, obj.timestamp, event = event_t(obj.msgtxt, obj.subject, kind, obj.timestamp,
obj.encrypted, obj.resource, obj.msg_log_id, obj.resource, obj.msg_log_id,
correct_id=obj.correct_id, correct_id=obj.correct_id,
message_id=obj.message_id, message_id=obj.message_id,
xhtml=obj.xhtml, xhtml=obj.xhtml,
...@@ -239,7 +239,7 @@ def roster_message2(self, obj): ...@@ -239,7 +239,7 @@ def roster_message2(self, obj):
app.events.add_event(self.conn.name, fjid, event) app.events.add_event(self.conn.name, fjid, event)
def roster_message(self, jid, msg, tim, encrypted=False, msg_type='', def roster_message(self, jid, msg, tim, msg_type='',
subject=None, resource='', msg_log_id=None, user_nick='', xhtml=None, subject=None, resource='', msg_log_id=None, user_nick='', xhtml=None,
displaymarking=None, additional_data=None): displaymarking=None, additional_data=None):
""" """
...@@ -303,7 +303,7 @@ def roster_message(self, jid, msg, tim, encrypted=False, msg_type='', ...@@ -303,7 +303,7 @@ def roster_message(self, jid, msg, tim, encrypted=False, msg_type='',
if msg_type == 'error': if msg_type == 'error':
typ = 'error' typ = 'error'
self.control.add_message(msg, typ, tim=tim, encrypted=encrypted, self.control.add_message(msg, typ, tim=tim,
subject=subject, xhtml=xhtml, displaymarking=displaymarking, subject=subject, xhtml=xhtml, displaymarking=displaymarking,
additional_data=additional_data) additional_data=additional_data)
...@@ -319,7 +319,7 @@ def roster_message(self, jid, msg, tim, encrypted=False, msg_type='', ...@@ -319,7 +319,7 @@ def roster_message(self, jid, msg, tim, encrypted=False, msg_type='',
show_in_roster = get_show_in_roster(event_type, self) show_in_roster = get_show_in_roster(event_type, self)
show_in_systray = get_show_in_systray(event_type, contact.jid) show_in_systray = get_show_in_systray(event_type, contact.jid)
event = event_t(msg, subject, msg_type, tim, encrypted, resource, event = event_t(msg, subject, msg_type, tim, resource,
msg_log_id, xhtml=xhtml, session=self, msg_log_id, xhtml=xhtml, session=self,
displaymarking=displaymarking, sent_forwarded=False, displaymarking=displaymarking, sent_forwarded=False,
show_in_roster=show_in_roster, show_in_systray=show_in_systray, show_in_roster=show_in_roster, show_in_systray=show_in_systray,
......
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