diff --git a/gajim/chat_control.py b/gajim/chat_control.py index c77c81645f55eb80f4ad5c5a0fdca5e9ead1e936..93f833295ccdb1114076a3158810f7288ca40d10 100644 --- a/gajim/chat_control.py +++ b/gajim/chat_control.py @@ -935,8 +935,7 @@ def add_message(self, msg_log_id=None, correct_id=None, message_id=None, - additional_data=None, - error=None): + additional_data=None): """ Print a line in the conversation @@ -973,14 +972,12 @@ def add_message(self, kind, name, tim, - subject=subject, - old_kind=self.old_msg_kind, displaymarking=displaymarking, msg_log_id=msg_log_id, message_id=message_id, correct_id=correct_id, - additional_data=additional_data, - error=error) + additional_data=additional_data) + if text.startswith('/me ') or text.startswith('/me\n'): self.old_msg_kind = None else: diff --git a/gajim/chat_control_base.py b/gajim/chat_control_base.py index 6e8a2916a860549b840f63b94c22933af83764a6..65b608a644ab131fe28607038334966a56e42e23 100644 --- a/gajim/chat_control_base.py +++ b/gajim/chat_control_base.py @@ -1074,7 +1074,7 @@ def save_message(self, message, msg_type): def add_info_message(self, text, message_id=None): self.conversation_view.add_message( - text, 'info', '', None, message_id=message_id, graphics=False) + text, 'info', '', None, message_id=message_id) def add_status_message(self, text): self.conversation_view.add_message( @@ -1085,36 +1085,14 @@ def add_message(self, kind, name, tim, - other_tags_for_name=None, - other_tags_for_time=None, - other_tags_for_text=None, restored=False, - subject=None, - old_kind=None, displaymarking=None, msg_log_id=None, message_id=None, stanza_id=None, correct_id=None, - additional_data=None, - marker=None, - error=None): - """ - Print 'chat' type messages - correct_id = (message_id, correct_id) - """ - jid = self.contact.jid - full_jid = self.contact.jid - end = False - if self.conversation_view.autoscroll or kind == 'outgoing': - end = True - - if other_tags_for_name is None: - other_tags_for_name = [] - if other_tags_for_time is None: - other_tags_for_time = [] - if other_tags_for_text is None: - other_tags_for_text = [] + additional_data=None): + if additional_data is None: additional_data = AdditionalDataDict() @@ -1123,14 +1101,11 @@ def add_message(self, kind, name, tim, - other_text_tags=other_tags_for_text, display_marking=displaymarking, message_id=message_id, correct_id=correct_id, log_line_id=msg_log_id, - additional_data=additional_data, - marker=marker, - error=error) + additional_data=additional_data) if restored: return @@ -1141,15 +1116,6 @@ def add_message(self, else: self.last_msg_id = message_id - if kind == 'incoming': - if (not self._type.is_groupchat or - # self.contact.can_notify() or TODO - 'marked' in other_tags_for_text): - # it's a normal message, or a muc message with want to be - # notified about if quitting just after - # other_tags_for_text == ['marked'] --> highlighted gc message - app.last_message_time[self.account][full_jid] = time.time() - if kind in ('incoming', 'incoming_queue'): # Record the history of received messages self.save_message(text, 'received') @@ -1164,60 +1130,6 @@ def add_message(self, # self.last_msg_id, # self._type) - # TODO old event Code - # if kind in ('incoming', 'incoming_queue', 'error'): - # gc_message = False - # if self._type.is_groupchat: - # gc_message = True - - # if ((self.parent_win and (not self.parent_win.get_active_control() or \ - # self != self.parent_win.get_active_control() or \ - # not self.parent_win.is_active() or not end)) or \ - # (gc_message and \ - # jid in app.interface.minimized_controls[self.account])) and \ - # kind in ('incoming', 'incoming_queue', 'error'): - # # we want to have save this message in events list - # # other_tags_for_text == ['marked'] --> highlighted gc message - # if gc_message: - # if 'marked' in other_tags_for_text: - # event_type = events.PrintedMarkedGcMsgEvent - # else: - # event_type = events.PrintedGcMsgEvent - # event = 'gc_message_received' - # else: - # if self._type.is_chat: - # event_type = events.PrintedChatEvent - # else: - # event_type = events.PrintedPmEvent - # event = 'message_received' - # show_in_roster = get_show_in_roster(event, self.session) - # show_in_systray = get_show_in_systray( - # event_type.type_, self.account, self.contact.jid) - - # event = event_type(text, - # subject, - # self, - # msg_log_id, - # message_id=message_id, - # stanza_id=stanza_id, - # show_in_roster=show_in_roster, - # show_in_systray=show_in_systray) - # app.events.add_event(self.account, full_jid, event) - # # We need to redraw contact if we show in roster - # if show_in_roster: - # app.interface.roster.draw_contact(self.contact.jid, - # self.account) - - # if (not self.parent_win.get_active_control() or \ - # self != self.parent_win.get_active_control() or \ - # not self.parent_win.is_active() or not end) and \ - # kind in ('incoming', 'incoming_queue', 'error'): - # self.parent_win.redraw_tab(self) - # if not self.parent_win.is_active(): - # self.parent_win.show_title(True, self) # Enabled Urgent hint - # else: - # self.parent_win.show_title(False, self) # Disabled Urgent hint - def toggle_emoticons(self): """ Hide show emoticons_button @@ -1440,13 +1352,11 @@ def add_messages(self, messages): kind, contact_name, msg.time, - subject=msg.subject, additional_data=msg.additional_data, message_id=msg.message_id, log_line_id=msg.log_line_id, marker=msg.marker, - error=msg.error, - history=True) + error=msg.error) def has_focus(self): if app.window.get_property('has-toplevel-focus'): diff --git a/gajim/groupchat_control.py b/gajim/groupchat_control.py index 5f9c56afae8a586fb790051bae0f688c20fa5962..4455cc145ffd94dd41d6046854cc80c63c64f98a 100644 --- a/gajim/groupchat_control.py +++ b/gajim/groupchat_control.py @@ -764,9 +764,6 @@ def add_message(self, text, contact='', tim=None, If contact is not set: it's a message from the server or help. """ - other_tags_for_name = [] - other_tags_for_text = [] - if not contact: # Message from the server kind = 'status' @@ -779,10 +776,10 @@ def add_message(self, text, contact='', tim=None, if kind == 'incoming': # it's a message NOT from us # highlighting and sounds highlight, _sound = self.highlighting_for_message(text, tim) - other_tags_for_name.append('muc_nickname_color_%s' % contact) - if highlight: - other_tags_for_name.append('bold') - other_tags_for_text.append('marked') + # other_tags_for_name.append('muc_nickname_color_%s' % contact) + # if highlight: + # other_tags_for_name.append('bold') + # other_tags_for_text.append('marked') self._nick_completion.record_message(contact, highlight) @@ -793,9 +790,6 @@ def add_message(self, text, contact='', tim=None, kind, contact, tim, - other_tags_for_name, - [], - other_tags_for_text, displaymarking=displaymarking, correct_id=correct_id, message_id=message_id, diff --git a/gajim/gtk/conversation/rows/info.py b/gajim/gtk/conversation/rows/info.py index db1fd3f2ad2dcefcb28ae0e583c931dc85359f8b..a6e0e4a0b830c29f0f7195e4677954af94871a39 100644 --- a/gajim/gtk/conversation/rows/info.py +++ b/gajim/gtk/conversation/rows/info.py @@ -30,10 +30,8 @@ def __init__(self, account, timestamp, text, - other_text_tags, kind, subject, - graphics, history_mode=False): BaseRow.__init__(self, account, history_mode=history_mode) self.type = 'info' @@ -49,8 +47,6 @@ def __init__(self, else: text = GLib.markup_escape_text(text) - other_text_tags.append('status') - avatar_placeholder = Gtk.Box() avatar_placeholder.set_size_request(AvatarSize.ROSTER, -1) self.grid.attach(avatar_placeholder, 0, 0, 1, 2) diff --git a/gajim/gtk/conversation/rows/message.py b/gajim/gtk/conversation/rows/message.py index a278b0bf9320a409c2656db78c1242d2f6083e04..c26b5e42beff014f5f9b0c27a958d60a96b9b577 100644 --- a/gajim/gtk/conversation/rows/message.py +++ b/gajim/gtk/conversation/rows/message.py @@ -45,7 +45,6 @@ def __init__(self, kind, name, text, - other_text_tags, avatar, is_groupchat, additional_data=None, @@ -56,12 +55,6 @@ def __init__(self, history_mode=False, log_line_id=None): - # other_tags_for_name contained 'marked', 'bold' and - # 'muc_nickname_color_', which are now derived from - # other_text_tags ('marked') - - # other_tags_for_time were always empty? - BaseRow.__init__(self, account, history_mode=history_mode) self.type = 'chat' self.timestamp = datetime.fromtimestamp(timestamp) @@ -76,10 +69,10 @@ def __init__(self, self._has_receipt = marker == 'received' self._has_displayed = marker == 'displayed' - if is_groupchat: - if other_text_tags and 'marked' in other_text_tags: - self.get_style_context().add_class( - 'conversation-mention-highlight') + # if is_groupchat: + # if other_text_tags and 'marked' in other_text_tags: + # self.get_style_context().add_class( + # 'conversation-mention-highlight') result = process(text) self._message_widget = MessageWidget(account) diff --git a/gajim/gtk/conversation/view.py b/gajim/gtk/conversation/view.py index 04fa705ecb95e78686c8b7448c76948aee0271e7..573d37b5248c28c4ae1eb033db0b0c8a90b73746 100644 --- a/gajim/gtk/conversation/view.py +++ b/gajim/gtk/conversation/view.py @@ -110,7 +110,6 @@ def add_message(self, kind, name, timestamp, - other_text_tags=None, log_line_id=None, message_id=None, correct_id=None, @@ -118,24 +117,11 @@ def add_message(self, additional_data=None, subject=None, marker=None, - error=None, - history=False, - graphics=True): - - log.debug( - 'Adding message: %s, %s, %s, %s, message_id: %s, correct_id: %s, ' - 'other_text_tags: %s, display_marking: %s, additional_data: %s, ' - 'subject: %s, marker: %s, error: %s, history: %s, graphics: %s', - text, kind, name, timestamp, message_id, correct_id, - other_text_tags, display_marking, additional_data, subject, - marker, error, history, graphics) + error=None): if not timestamp: timestamp = time.time() - if other_text_tags is None: - other_text_tags = [] - muc_subject = bool(subject and self._contact is not None and self._contact.is_groupchat) if kind in ('status', 'info') or muc_subject: @@ -143,10 +129,8 @@ def add_message(self, self._account, timestamp, text, - other_text_tags, kind, subject, - graphics, history_mode=self._history_mode) else: if correct_id: @@ -166,7 +150,6 @@ def add_message(self, kind, name, text, - other_text_tags, avatar, is_groupchat, additional_data=additional_data,