Commit 54437a0f authored by Philipp Hörist's avatar Philipp Hörist

Rename print_conversation_* methods

parent a0f655f2
Pipeline #3557 passed with stages
in 3 minutes and 32 seconds
......@@ -855,7 +855,7 @@ class ChatControl(ChatControlBase):
if obj.kind == KindConstant.CHAT_MSG_SENT:
kind = 'outgoing'
self.print_conversation(
self.add_message(
obj.msgtxt, kind, tim=obj.timestamp,
encrypted=obj.encrypted, correct_id=obj.correct_id,
msg_stanza_id=obj.message_id, additional_data=obj.additional_data)
......@@ -878,7 +878,7 @@ class ChatControl(ChatControlBase):
typ = 'out'
if obj.jid != app.get_jid_from_account(obj.conn.name):
xep0184_id = obj.id_
self.print_conversation(obj.msgtxt, typ,
self.add_message(obj.msgtxt, typ,
tim=obj.timestamp, encrypted=obj.encrypted, subject=obj.subject,
xhtml=obj.xhtml, displaymarking=obj.displaymarking,
msg_log_id=obj.msg_log_id, msg_stanza_id=obj.id_, correct_id=obj.correct_id,
......@@ -913,7 +913,7 @@ class ChatControl(ChatControlBase):
gtkgui_helpers.remove_css_class(
self.msg_textview, 'gajim-msg-correcting')
self.print_conversation(obj.message, self.contact.jid, tim=obj.timestamp,
self.add_message(obj.message, self.contact.jid, tim=obj.timestamp,
encrypted=obj.encrypted, xep0184_id=xep0184_id, xhtml=obj.xhtml,
displaymarking=displaymarking, msg_stanza_id=id_,
correct_id=obj.correct_id,
......@@ -946,7 +946,7 @@ class ChatControl(ChatControlBase):
def get_our_nick(self):
return app.nicks[self.account]
def print_conversation(self, text, frm='', tim=None, encrypted=None,
def add_message(self, text, frm='', tim=None, encrypted=None,
subject=None, xhtml=None, simple=False, xep0184_id=None,
displaymarking=None, msg_log_id=None, correct_id=None,
msg_stanza_id=None, additional_data=None):
......@@ -986,7 +986,7 @@ class ChatControl(ChatControlBase):
xhtml = create_xhtml(text)
if xhtml:
xhtml = '<body xmlns="%s">%s</body>' % (NS_XHTML, xhtml)
ChatControlBase.print_conversation_line(self, text, kind, name, tim,
ChatControlBase.add_message(self, text, kind, name, tim,
subject=subject, old_kind=self.old_msg_kind, xhtml=xhtml,
simple=simple, xep0184_id=xep0184_id, displaymarking=displaymarking,
msg_log_id=msg_log_id, msg_stanza_id=msg_stanza_id,
......@@ -1318,7 +1318,7 @@ class ChatControl(ChatControlBase):
if row.subject:
msg = _('Subject: %(subject)s\n%(message)s') % \
{'subject': row.subject, 'message': msg}
ChatControlBase.print_conversation_line(self, msg, kind, name,
ChatControlBase.add_message(self, msg, kind, name,
tim, small_attr, small_attr + ['restored_message'],
small_attr + ['restored_message'], False,
old_kind=local_old_kind, xhtml=xhtml, additional_data=additional_data)
......@@ -1350,7 +1350,7 @@ class ChatControl(ChatControlBase):
kind = 'print_queue'
if event.sent_forwarded:
kind = 'out'
self.print_conversation(event.message, kind, tim=event.time,
self.add_message(event.message, kind, tim=event.time,
encrypted=event.encrypted, subject=event.subject,
xhtml=event.xhtml, displaymarking=event.displaymarking,
correct_id=event.correct_id, additional_data=event.additional_data)
......
......@@ -932,7 +932,7 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
self.conv_textview.print_conversation_line(
text, jid, 'status', '', None)
def print_conversation_line(self, text, kind, name, tim,
def add_message(self, text, kind, name, tim,
other_tags_for_name=None, other_tags_for_time=None, other_tags_for_text=None,
count_as_new=True, subject=None, old_kind=None, xhtml=None, simple=False,
xep0184_id=None, graphics=True, displaymarking=None, msg_log_id=None,
......
......@@ -1199,7 +1199,7 @@ class GroupchatControl(ChatControlBase):
return
if obj.archive_jid != self.room_jid:
return
self.print_conversation(
self.add_message(
obj.msgtxt, contact=obj.nick,
tim=obj.timestamp, correct_id=obj.correct_id,
encrypted=obj.encrypted,
......@@ -1212,7 +1212,7 @@ class GroupchatControl(ChatControlBase):
if not obj.nick:
# message from server
self.print_conversation(
self.add_message(
obj.msgtxt, tim=obj.timestamp,
xhtml=obj.xhtml_msgtxt, displaymarking=obj.displaymarking,
additional_data=obj.additional_data)
......@@ -1221,7 +1221,7 @@ class GroupchatControl(ChatControlBase):
if obj.delayed:
# don't print xhtml if it's an old message.
# Like that xhtml messages are grayed too.
self.print_old_conversation(
self.add_delayed_message(
obj.msgtxt, contact=obj.nick,
tim=obj.timestamp, xhtml=None, encrypted=obj.encrypted,
displaymarking=obj.displaymarking, msg_stanza_id=obj.id_,
......@@ -1229,7 +1229,7 @@ class GroupchatControl(ChatControlBase):
else:
if obj.nick == self.nick:
self.last_sent_txt = obj.msgtxt
self.print_conversation(
self.add_message(
obj.msgtxt, contact=obj.nick,
tim=obj.timestamp, xhtml=obj.xhtml_msgtxt,
displaymarking=obj.displaymarking, encrypted=obj.encrypted,
......@@ -1288,7 +1288,7 @@ class GroupchatControl(ChatControlBase):
return self.model.get_iter(path)
def print_old_conversation(self, text, contact='', tim=None, xhtml=None,
def add_delayed_message(self, text, contact='', tim=None, xhtml=None,
displaymarking=None, msg_stanza_id=None, encrypted=None, additional_data=None):
if additional_data is None:
additional_data = AdditionalDataDict()
......@@ -1305,13 +1305,13 @@ class GroupchatControl(ChatControlBase):
else:
small_attr = []
ChatControlBase.print_conversation_line(self, text, kind, contact, tim,
ChatControlBase.add_message(self, text, kind, contact, tim,
small_attr, small_attr + ['restored_message'],
small_attr + ['restored_message'], count_as_new=False, xhtml=xhtml,
displaymarking=displaymarking, msg_stanza_id=msg_stanza_id,
encrypted=encrypted, additional_data=additional_data)
def print_conversation(self, text, contact='', tim=None, xhtml=None,
def add_message(self, text, contact='', tim=None, xhtml=None,
graphics=True, displaymarking=None, correct_id=None, msg_stanza_id=None,
encrypted=None, additional_data=None):
"""
......@@ -1351,7 +1351,7 @@ class GroupchatControl(ChatControlBase):
self.check_and_possibly_add_focus_out_line()
ChatControlBase.print_conversation_line(self, text, kind, contact, tim,
ChatControlBase.add_message(self, text, kind, contact, tim,
other_tags_for_name, [], other_tags_for_text, xhtml=xhtml,
graphics=graphics, displaymarking=displaymarking,
correct_id=correct_id, msg_stanza_id=msg_stanza_id, encrypted=encrypted,
......@@ -1531,7 +1531,7 @@ class GroupchatControl(ChatControlBase):
frm = ''
if obj.sent:
frm = 'out'
obj.session.control.print_conversation(obj.msgtxt, frm,
obj.session.control.add_message(obj.msgtxt, frm,
tim=obj.timestamp, xhtml=obj.xhtml, encrypted=obj.encrypted,
displaymarking=obj.displaymarking, msg_stanza_id=obj.id_,
correct_id=obj.correct_id)
......
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