From c951abccf3bbe96072fac834f10d902595b1cd69 Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Fri, 17 Jun 2005 15:31:21 +0000 Subject: [PATCH] irc emulation: /me adds * and then the nick --- src/chat.py | 14 +++++++++----- src/groupchat_window.py | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/chat.py b/src/chat.py index 9f97705e4..151585944 100644 --- a/src/chat.py +++ b/src/chat.py @@ -53,9 +53,9 @@ class Chat: self.account = account self.change_cursor = None self.xmls = {} - self.tagIn = {} - self.tagOut = {} - self.tagStatus = {} + self.tagIn = {} # holds nick that talks to us + self.tagOut = {} # holds our nick + self.tagStatus = {} # holds status messages self.nb_unread = {} self.last_message_time = {} self.last_time_printout = {} @@ -734,7 +734,7 @@ class Chat: if kind == 'status': text_tags.append(kind) elif text.startswith('/me ') or text.startswith('/me\n'): - text = name + text[3:] + text = '* ' + name + text[3:] text_tags.append(kind) if kind == 'incoming': @@ -744,6 +744,8 @@ class Chat: # not status nor /me name_tags = other_tags_for_name[:] #create a new list name_tags.append(kind) + if kind == 'incoming': + name_tags.append('incoming_message') before_str = gajim.config.get('before_nickname') after_str = gajim.config.get('after_nickname') format = before_str + name + after_str + ' ' @@ -754,11 +756,13 @@ class Chat: # add the rest of text located in the index and after end_iter = buffer.get_end_iter() + if kind == 'incoming': + text_tags.append('incoming_message') self.print_with_tag_list(buffer, text[index:], end_iter, text_tags) #scroll to the end of the textview end = False - if at_the_end or (kind == 'outgoing'): + if at_the_end or kind == 'outgoing': #we are at the end or we are sending something end = True # We scroll to the end after the scrollbar has appeared diff --git a/src/groupchat_window.py b/src/groupchat_window.py index 813ac104b..c15d643ad 100644 --- a/src/groupchat_window.py +++ b/src/groupchat_window.py @@ -476,7 +476,7 @@ class GroupchatWindow(chat.Chat): other_tags_for_name = [] other_tags_for_text = [] if contact: - if contact == self.nicks[room_jid]: + if contact == self.nicks[room_jid]: # it's us kind = 'outgoing' else: kind = 'incoming'