Show
Ignore:
Timestamp:
02/06/07 20:54:30 (22 months ago)
Author:
asterix
Message:

merge diff from trunk

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/gajim_0.11/src/roster_window.py

    r7841 r7940  
    399399                model.set_value(iter, 1 , gtkgui_helpers.escape_for_pango_markup(text)) 
    400400 
    401         def add_to_not_in_the_roster(self, account, jid, nick = ''): 
     401        def add_to_not_in_the_roster(self, account, jid, nick = '', resource = ''): 
    402402                ''' add jid to group "not in the roster", he MUST not be in roster yet, 
    403                  return contact ''' 
     403                return contact ''' 
    404404                keyID = '' 
    405405                attached_keys = gajim.config.get_per('accounts', account, 
     
    407407                if jid in attached_keys: 
    408408                        keyID = attached_keys[attached_keys.index(jid) + 1] 
    409                 contact = gajim.contacts.create_contact(jid = jid, 
    410                         name = nick, groups = [_('Not in Roster')], 
    411                         show = 'not in roster', status = '', sub = 'none', 
    412                         keyID = keyID) 
     409                contact = gajim.contacts.create_contact(jid = jid, name = nick, 
     410                        groups = [_('Not in Roster')], show = 'not in roster', status = '', 
     411                        sub = 'none', resource = resource, keyID = keyID) 
    413412                gajim.contacts.add_contact(account, contact) 
    414413                self.add_contact_to_roster(contact.jid, account) 
     
    452451                        sub = 'from') 
    453452                gajim.contacts.add_contact(account, c) 
    454                 gajim.interface.roster.add_contact_to_roster(transport, account) 
     453                self.add_contact_to_roster(transport, account) 
    455454 
    456455        def really_remove_contact(self, contact, account): 
     
    988987                                # profile, avatar 
    989988                                profile_avatar_item = gtk.MenuItem(_('of account %s') % account,  
    990                                          False) 
     989                                        False) 
    991990                                profile_avatar_sub_menu.append(profile_avatar_item) 
    992991                                profile_avatar_item.connect('activate',  
     
    26742673                                        self.add_contact_to_roster(contact.jid, account) 
    26752674                                else: 
     2675                                        if _('Not in Roster') in contact.groups: 
     2676                                                gajim.events.remove_events(account, contact.jid) 
    26762677                                        self.readd_if_needed(contact, account) 
    26772678                if len(list_) == 1: 
     
    30533054                        chat_control.read_queue() 
    30543055 
    3055         def new_chat_from_jid(self, account, jid): 
    3056                 jid = gajim.get_jid_without_resource(jid) 
    3057                 contact = gajim.contacts.get_contact_with_highest_priority(account, jid) 
     3056        def new_chat_from_jid(self, account, fjid): 
     3057                jid, resource = gajim.get_room_and_nick_from_fjid(fjid) 
     3058                if resource: 
     3059                        contact = gajim.contacts.get_contact(account, jid, resource) 
     3060                else: 
     3061                        contact = gajim.contacts.get_contact_with_highest_priority(account, 
     3062                                jid) 
    30583063                added_to_roster = False 
    30593064                if not contact: 
    30603065                        added_to_roster = True 
    3061                         contact = self.add_to_not_in_the_roster(account, jid)  
    3062  
    3063                 if not gajim.interface.msg_win_mgr.has_window(contact.jid, account): 
    3064                         self.new_chat(contact, account) 
    3065                 mw = gajim.interface.msg_win_mgr.get_window(contact.jid, account) 
    3066                 mw.set_active_tab(jid, account) 
     3066                        contact = self.add_to_not_in_the_roster(account, jid, 
     3067                                resource = resource)  
     3068 
     3069                if not gajim.interface.msg_win_mgr.has_window(fjid, account): 
     3070                        self.new_chat(contact, account, resource = resource) 
     3071                mw = gajim.interface.msg_win_mgr.get_window(fjid, account) 
     3072                mw.set_active_tab(fjid, account) 
    30673073                mw.window.present() 
    30683074                # For JEP-0172 
    30693075                if added_to_roster: 
    3070                         mc = mw.get_control(jid, account) 
     3076                        mc = mw.get_control(fjid, account) 
    30713077                        mc.user_nick = gajim.nicks[account] 
    30723078