implement /me functionality and cleanup :p

This commit is contained in:
Vincent Hanquez 2004-09-29 14:01:24 +00:00
parent 2b6cc45e69
commit 446dcc49a0

View file

@ -194,18 +194,31 @@ class message_Window:
if not tim: if not tim:
tim = time.localtime() tim = time.localtime()
tims = time.strftime("[%H:%M:%S]", tim) tims = time.strftime("[%H:%M:%S]", tim)
buffer.insert(end_iter, tims) buffer.insert(end_iter, tims + ' ')
if contact:
if contact == 'status': otxt = ''
buffer.insert_with_tags_by_name(end_iter, txt+'\n', \ ttxt = ''
'status') if contact and contact == 'status':
else: tag = 'status'
buffer.insert_with_tags_by_name(end_iter, '<'+self.plugin.nicks[self.account]+'> ', 'outgoing') ttxt = txt + '\n'
buffer.insert(end_iter, txt+'\n')
else: else:
buffer.insert_with_tags_by_name(end_iter, '<' + \ if contact:
self.user.name + '> ', 'incoming') tag = 'outgoing'
buffer.insert(end_iter, txt+'\n') name = self.plugin.nicks[self.account]
else:
tag = 'incoming'
name = self.user.name
if string.find(txt, '/me ') == 0:
ttxt = name + ' ' + txt[4:] + '\n'
else:
ttxt = '<' + name + '> '
otxt = txt + '\n'
buffer.insert_with_tags_by_name(end_iter, ttxt, tag)
if len(otxt) > 0:
buffer.insert(end_iter, otxt)
#scroll to the end of the textview #scroll to the end of the textview
conversation.scroll_to_mark(buffer.get_mark('end'), 0.1, 0, 0, 0) conversation.scroll_to_mark(buffer.get_mark('end'), 0.1, 0, 0, 0)