Changeset 7940 for branches/gajim_0.11/src/roster_window.py
- Timestamp:
- 02/06/07 20:54:30 (22 months ago)
- Files:
-
- 1 modified
-
branches/gajim_0.11/src/roster_window.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/gajim_0.11/src/roster_window.py
r7841 r7940 399 399 model.set_value(iter, 1 , gtkgui_helpers.escape_for_pango_markup(text)) 400 400 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 = ''): 402 402 ''' add jid to group "not in the roster", he MUST not be in roster yet, 403 return contact '''403 return contact ''' 404 404 keyID = '' 405 405 attached_keys = gajim.config.get_per('accounts', account, … … 407 407 if jid in attached_keys: 408 408 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) 413 412 gajim.contacts.add_contact(account, contact) 414 413 self.add_contact_to_roster(contact.jid, account) … … 452 451 sub = 'from') 453 452 gajim.contacts.add_contact(account, c) 454 gajim.interface.roster.add_contact_to_roster(transport, account)453 self.add_contact_to_roster(transport, account) 455 454 456 455 def really_remove_contact(self, contact, account): … … 988 987 # profile, avatar 989 988 profile_avatar_item = gtk.MenuItem(_('of account %s') % account, 990 False)989 False) 991 990 profile_avatar_sub_menu.append(profile_avatar_item) 992 991 profile_avatar_item.connect('activate', … … 2674 2673 self.add_contact_to_roster(contact.jid, account) 2675 2674 else: 2675 if _('Not in Roster') in contact.groups: 2676 gajim.events.remove_events(account, contact.jid) 2676 2677 self.readd_if_needed(contact, account) 2677 2678 if len(list_) == 1: … … 3053 3054 chat_control.read_queue() 3054 3055 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) 3058 3063 added_to_roster = False 3059 3064 if not contact: 3060 3065 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) 3067 3073 mw.window.present() 3068 3074 # For JEP-0172 3069 3075 if added_to_roster: 3070 mc = mw.get_control( jid, account)3076 mc = mw.get_control(fjid, account) 3071 3077 mc.user_nick = gajim.nicks[account] 3072 3078
