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 @@ class ChatControl(ChatControlBase):
self.add_message(
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)
def _nec_decrypted_message_received(self, obj):
......@@ -819,9 +819,10 @@ class ChatControl(ChatControlBase):
typ = 'out'
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,
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)
if obj.msg_log_id:
pw = self.parent_win
......@@ -855,7 +856,7 @@ class ChatControl(ChatControlBase):
self.msg_textview, 'gajim-msg-correcting')
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,
correct_id=obj.correct_id,
additional_data=obj.additional_data)
......@@ -887,7 +888,7 @@ class ChatControl(ChatControlBase):
def get_our_nick(self):
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,
displaymarking=None, msg_log_id=None, correct_id=None,
message_id=None, additional_data=None, error=None):
......@@ -921,7 +922,7 @@ class ChatControl(ChatControlBase):
else:
kind = 'outgoing'
name = self.get_our_nick()
if not xhtml and not encrypted and \
if not xhtml and \
app.config.get('rst_formatting_outgoing_messages'):
from gajim.common.rst_xhtml_generator import create_xhtml
xhtml = create_xhtml(text)
......@@ -932,7 +933,7 @@ class ChatControl(ChatControlBase):
displaymarking=displaymarking,
msg_log_id=msg_log_id, message_id=message_id,
correct_id=correct_id, additional_data=additional_data,
encrypted=encrypted, error=error)
error=error)
if text.startswith('/me ') or text.startswith('/me\n'):
self.old_msg_kind = None
else:
......@@ -1288,7 +1289,7 @@ class ChatControl(ChatControlBase):
if event.sent_forwarded:
kind = 'out'
self.add_message(event.message, kind, tim=event.time,
encrypted=event.encrypted, subject=event.subject,
subject=event.subject,
xhtml=event.xhtml, displaymarking=event.displaymarking,
correct_id=event.correct_id, message_id=event.message_id,
additional_data=event.additional_data)
......
......@@ -991,7 +991,7 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
old_kind=None, xhtml=None,
displaymarking=None, msg_log_id=None,
message_id=None, correct_id=None, additional_data=None,
encrypted=None, marker=None, error=None):
marker=None, error=None):
"""
Print 'chat' type messages
correct_id = (message_id, correct_id)
......@@ -1017,7 +1017,7 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
subject, old_kind, xhtml,
displaymarking=displaymarking, message_id=message_id,
correct_id=correct_id, additional_data=additional_data,
encrypted=encrypted, marker=marker, error=error)
marker=marker, error=error)
if restored:
return
......
......@@ -1535,7 +1535,7 @@ class Connection(CommonConnection, ConnectionHandlers):
if encryption:
app.plugin_manager.extension_point(
'encrypt' + encryption, self, obj, self.send_message)
if not obj.encrypted:
if not obj.additional_data.get_value('encrypted', 'name', False):
# Dont propagate event
return True
else:
......
......@@ -590,8 +590,6 @@ class MessageOutgoingEvent(nec.NetworkOutgoingEvent):
self.attention = False
self.correct_id = None
self.automatic_message = True
self.encryption = ''
self.encrypted = False
def get_full_jid(self):
if self.resource:
......
......@@ -61,7 +61,7 @@ class Event:
class ChatEvent(Event):
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,
displaymarking=None, sent_forwarded=False, show_in_roster=False,
show_in_systray=True, additional_data=None):
......@@ -71,7 +71,6 @@ class ChatEvent(Event):
self.subject = subject
self.kind = kind
self.time = time_
self.encrypted = encrypted
self.resource = resource
self.msg_log_id = msg_log_id
self.message_id = message_id
......
......@@ -232,7 +232,6 @@ class MAM(BaseModule):
{'conn': self._con,
'account': self._account,
'additional_data': additional_data,
'encrypted': False,
'timestamp': properties.mam.timestamp,
'self_message': properties.is_self_message,
'groupchat': groupchat,
......
......@@ -178,7 +178,6 @@ class Message(BaseModule):
'stanza': stanza,
'account': self._account,
'id_': properties.id,
'encrypted': False,
'additional_data': additional_data,
'forwarded': properties.is_carbon_message,
'sent': properties.is_carbon_message and properties.carbon.is_sent,
......
......@@ -95,7 +95,6 @@ class ConnectionHandlersZeroconf(connection_handlers.ConnectionHandlersBase):
'stanza': stanza,
'account': self.name,
'id_': id_,
'encrypted': False,
'additional_data': additional_data,
'forwarded': False,
'sent': False,
......
......@@ -915,7 +915,7 @@ class ConversationTextview(GObject.GObject):
other_tags_for_name=None, other_tags_for_time=None, other_tags_for_text=None,
subject=None, old_kind=None, xhtml=None, graphics=True,
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
"""
......
......@@ -821,8 +821,8 @@ class GroupchatControl(ChatControlBase):
return
self.add_message(
obj.msgtxt, contact=obj.nick,
tim=obj.timestamp, correct_id=obj.correct_id,
encrypted=obj.encrypted,
tim=obj.timestamp,
correct_id=obj.correct_id,
message_id=obj.message_id,
additional_data=obj.additional_data)
......@@ -840,13 +840,13 @@ class GroupchatControl(ChatControlBase):
self.add_message(
obj.msgtxt, contact=obj.nick,
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,
additional_data=obj.additional_data)
obj.needs_highlight = self.needs_visual_notification(obj.msgtxt)
def on_private_message(self, nick, sent, msg, tim, xhtml, session,
msg_log_id=None, encrypted=False,
msg_log_id=None,
displaymarking=None):
# Do we have a queue?
fjid = self.room_jid + '/' + nick
......@@ -855,7 +855,6 @@ class GroupchatControl(ChatControlBase):
'',
'incoming',
tim,
encrypted,
'',
msg_log_id,
xhtml=xhtml,
......@@ -882,7 +881,7 @@ class GroupchatControl(ChatControlBase):
def add_message(self, text, contact='', tim=None, xhtml=None,
displaymarking=None, correct_id=None, message_id=None,
encrypted=None, additional_data=None):
additional_data=None):
"""
Add message to the ConversationsTextview
......@@ -925,7 +924,7 @@ class GroupchatControl(ChatControlBase):
self, text, kind, contact, tim,
other_tags_for_name, [], other_tags_for_text, xhtml=xhtml,
displaymarking=displaymarking,
correct_id=correct_id, message_id=message_id, encrypted=encrypted,
correct_id=correct_id, message_id=message_id,
additional_data=additional_data)
def get_nb_unread(self):
......@@ -1095,7 +1094,7 @@ class GroupchatControl(ChatControlBase):
frm = 'out'
obj.session.control.add_message(
obj.msgtxt, frm,
tim=obj.timestamp, xhtml=obj.xhtml, encrypted=obj.encrypted,
tim=obj.timestamp, xhtml=obj.xhtml,
displaymarking=obj.displaymarking,
message_id=obj.message_id,
correct_id=obj.correct_id)
......@@ -1104,7 +1103,7 @@ class GroupchatControl(ChatControlBase):
self.on_private_message(
nick, obj.sent, obj.msgtxt, obj.timestamp,
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):
if self.contact.jid != obj.contact.room_jid:
......
......@@ -378,7 +378,7 @@ class GajimRemote(Server):
event_type = 'pm'
self.raise_signal('NewMessage', (
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]))
def on_our_status(self, obj):
......
......@@ -226,7 +226,7 @@ class ChatControlSession:
if do_event:
kind = obj.properties.type.value
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,
message_id=obj.message_id,
xhtml=obj.xhtml,
......@@ -239,7 +239,7 @@ class ChatControlSession:
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,
displaymarking=None, additional_data=None):
"""
......@@ -303,7 +303,7 @@ class ChatControlSession:
if msg_type == '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,
additional_data=additional_data)
......@@ -319,7 +319,7 @@ class ChatControlSession:
show_in_roster = get_show_in_roster(event_type, self)
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,
displaymarking=displaymarking, sent_forwarded=False,
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