Show
Ignore:
Timestamp:
05/17/08 16:00:27 (6 months ago)
Author:
roidelapluie
Message:

One-to-one chat to MUC: set a beter tab name than the jid of the room. See #2095.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/groupchat_control.py

    r9650 r9651  
    465465                        color = gtk.gdk.colormap_get_system().alloc_color(color_name) 
    466466 
    467                 label_str = self.name 
     467                if self.is_continued: 
     468                        # if this is a continued conversation 
     469                        label_str = self.get_continued_conversation_name() 
     470                else: 
     471                        label_str = self.name 
    468472 
    469473                # count waiting highlighted messages 
     
    522526                banner_status_img.set_from_pixbuf(scaled_pix) 
    523527 
     528        def get_continued_conversation_name(self): 
     529                '''Get the name of a continued conversation. 
     530                Will return Continued Conversation if there isn't any other 
     531                contact in the room 
     532                ''' 
     533                nicks = [] 
     534                for nick in gajim.contacts.get_nick_list(self.account, 
     535                self.room_jid): 
     536                        if nick != self.nick: 
     537                                nicks.append(nick) 
     538                if nicks != []: 
     539                        title = ', ' 
     540                        title = _('Conversation with ') + title.join(nicks) 
     541                else: 
     542                        title = _('Continued conversation') 
     543                return title 
     544 
    524545        def draw_banner_text(self): 
    525546                '''Draw the text in the fat line at the top of the window that  
     
    530551                font_attrs, font_attrs_small = self.get_font_attrs() 
    531552                if self.is_continued: 
    532                         nicks = [] 
    533                         for nick in gajim.contacts.get_nick_list(self.account, self.room_jid): 
    534                                 if nick != self.nick: 
    535                                         nicks.append(nick) 
    536                         if nicks != []: 
    537                                 title = ', ' 
    538                                 title = 'Conversation with ' + title.join(nicks) 
    539                         else: 
    540                                 title = 'Continued conversation' 
    541                         text = '<span %s>%s</span>' % (font_attrs, title) 
    542                 else: 
    543                         text = '<span %s>%s</span>' % (font_attrs, self.room_jid) 
     553                        name = self.get_continued_conversation_name() 
     554                else: 
     555                        name = self.room_jid 
     556                text = '<span %s>%s</span>' % (font_attrs, name) 
    544557                self.name_label.set_markup(text) 
    545558