Changeset 6293
- Timestamp:
- 05/08/06 10:19:20 (3 years ago)
- Location:
- trunk/src
- Files:
-
- 3 modified
-
chat_control.py (modified) (6 diffs)
-
common/config.py (modified) (1 diff)
-
conversation_textview.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/chat_control.py
r6271 r6293 455 455 def print_conversation_line(self, text, kind, name, tim, 456 456 other_tags_for_name = [], other_tags_for_time = [], 457 other_tags_for_text = [], count_as_new = True, subject = None): 457 other_tags_for_text = [], count_as_new = True, 458 subject = None, old_kind = None): 458 459 '''prints 'chat' type messages''' 459 460 jid = self.contact.jid … … 464 465 end = True 465 466 textview.print_conversation_line(text, jid, kind, name, tim, 466 other_tags_for_name, other_tags_for_time, other_tags_for_text, subject) 467 other_tags_for_name, other_tags_for_time, other_tags_for_text, 468 subject, old_kind) 467 469 468 470 if not count_as_new: … … 706 708 '''A control for standard 1-1 chat''' 707 709 TYPE_ID = message_control.TYPE_CHAT 708 710 old_msg_kind = None # last kind of the printed message 711 709 712 def __init__(self, parent_win, contact, acct, resource = None): 710 713 ChatControlBase.__init__(self, self.TYPE_ID, parent_win, 'chat_child_vbox', … … 1096 1099 else: 1097 1100 kind = 'outgoing' 1098 name = gajim.nicks[self.account] 1101 name = gajim.nicks[self.account] 1099 1102 ChatControlBase.print_conversation_line(self, text, kind, name, tim, 1100 subject = subject) 1103 subject = subject, old_kind = self.old_msg_kind) 1104 if text.startswith('/me ') or text.startswith('/me\n'): 1105 self.old_msg_kind = None 1106 else: 1107 self.old_msg_kind = kind 1101 1108 1102 1109 def get_tab_label(self, chatstate): … … 1444 1451 rows = gajim.logger.get_last_conversation_lines(jid, restore_how_many, 1445 1452 pending_how_many, timeout) 1446 1453 local_old_kind = None 1447 1454 for row in rows: # row[0] time, row[1] has kind, row[2] the message 1448 1455 if not row[2]: # message is empty, we don't print it … … 1463 1470 ['small', 'restored_message'], 1464 1471 ['small', 'restored_message'], 1465 False) 1472 False, old_kind = local_old_kind) 1473 if row[2].startswith('/me ') or row[2].startswith('/me\n'): 1474 local_old_kind = None 1475 else: 1476 local_old_kind = kind 1466 1477 if len(rows): 1467 1478 self.conv_textview.print_empty_line() -
trunk/src/common/config.py
r6272 r6293 199 199 'hide_chat_banner': [opt_bool, False, _('Hides the banner in two persons chat window')], 200 200 'hide_groupchat_occupants_list': [opt_bool, False, _('Hides the room occupants list in groupchat window')], 201 'chat_merge_consecutive_nickname': [opt_bool, False, _('Merge consecutive nickname in chat window')], 202 'chat_merge_consecutive_nickname_indent': [opt_str, ' ', _('Indentation when using merge consecutive nickame')], 201 203 } 202 204 -
trunk/src/conversation_textview.py
r6271 r6293 568 568 def print_conversation_line(self, text, jid, kind, name, tim, 569 569 other_tags_for_name = [], other_tags_for_time = [], 570 other_tags_for_text = [], subject = None ):570 other_tags_for_text = [], subject = None, old_kind = None): 571 571 '''prints 'chat' type messages''' 572 572 # kind = info, we print things as if it was a status: same color, ... … … 584 584 if kind == 'incoming_queue': 585 585 kind = 'incoming' 586 if old_kind == 'incoming_queue': 587 old_kind = 'incoming' 586 588 # print the time stamp 587 589 if not tim: 588 590 # We don't have tim for outgoing messages... 589 591 tim = time.localtime() 590 if gajim.config.get('print_time') == 'always': 592 current_print_time = gajim.config.get('print_time') 593 if current_print_time == 'always': 591 594 before_str = gajim.config.get('before_time') 592 595 after_str = gajim.config.get('after_time') … … 612 615 buffer.insert_with_tags_by_name(end_iter, tim_format + ' ', 613 616 *other_tags_for_time) 614 elif gajim.config.get('print_time')== 'sometimes':617 elif current_print_time == 'sometimes': 615 618 every_foo_seconds = 60 * gajim.config.get( 616 619 'print_ichat_every_foo_minutes') … … 628 631 text_tags.append(other_text_tag) 629 632 else: # not status nor /me 630 self.print_name(name, kind, other_tags_for_name) 633 if gajim.config.get( 634 'chat_merge_consecutive_nickname'): 635 if kind != old_kind: 636 self.print_name(name, kind, other_tags_for_name) 637 else: 638 self.print_real_text(gajim.config.get( 639 'chat_merge_consecutive_nickname_indent')) 640 else: 641 self.print_name(name, kind, other_tags_for_name) 631 642 self.print_subject(subject) 632 643 self.print_real_text(text, text_tags, name)
