Skip to content
Snippets Groups Projects
Commit c951abcc authored by nkour's avatar nkour
Browse files

irc emulation: /me adds * and then the nick

parent cf028229
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment