gc_contact.nick -> gc_contact.name (same attr as contact)

This commit is contained in:
Yann Leboulanger 2005-12-30 12:16:46 +00:00
parent d4ac8a23a7
commit dab85845de
3 changed files with 10 additions and 10 deletions

View File

@ -61,7 +61,7 @@ class GC_Contact:
def __init__(self, room_jid='', nick='', show='', status='', role='', def __init__(self, room_jid='', nick='', show='', status='', role='',
affiliation='', jid = ''): affiliation='', jid = ''):
self.room_jid = room_jid self.room_jid = room_jid
self.nick = nick self.name = name
self.show = show self.show = show
self.status = status self.status = status
self.role = role self.role = role
@ -69,7 +69,7 @@ class GC_Contact:
self.jid = jid self.jid = jid
def get_full_jid(self): def get_full_jid(self):
return self.room_jid + '/' + self.nick return self.room_jid + '/' + self.name
class Contacts: class Contacts:
'''Information concerning all contacts and groupchat contacts''' '''Information concerning all contacts and groupchat contacts'''
@ -226,7 +226,7 @@ class Contacts:
def contact_from_gc_contact(self, gc_contact): def contact_from_gc_contact(self, gc_contact):
'''Create a Contact instance from a GC_Contact instance''' '''Create a Contact instance from a GC_Contact instance'''
return Contact(jid = gc_contact.get_full_jid(), name = gc_contact.nick, return Contact(jid = gc_contact.get_full_jid(), name = gc_contact.name,
groups = ['none'], show = gc_contact.show, status = gc_contact.status, groups = ['none'], show = gc_contact.show, status = gc_contact.status,
sub = 'none') sub = 'none')
@ -237,15 +237,15 @@ class Contacts:
def add_gc_contact(self, account, gc_contact): def add_gc_contact(self, account, gc_contact):
# No such account before ? # No such account before ?
if not self._gc_contacts.has_key(account): if not self._gc_contacts.has_key(account):
self._contacts[account] = {gc_contact.room_jid : {gc_contact.nick: \ self._contacts[account] = {gc_contact.room_jid : {gc_contact.name: \
gc_contact}} gc_contact}}
return return
# No such room_jid before ? # No such room_jid before ?
if not self._gc_contacts[account].has_key(gc_contact.room_jid): if not self._gc_contacts[account].has_key(gc_contact.room_jid):
self._gc_contacts[account][gc_contact.room_jid] = {gc_contact.nick: \ self._gc_contacts[account][gc_contact.room_jid] = {gc_contact.name: \
gc_contact} gc_contact}
return return
self._gc_contacts[account][gc_contact.room_jid][gc_contact.nick] = \ self._gc_contacts[account][gc_contact.room_jid][gc_contact.name] = \
gc_contact gc_contact
def remove_gc_contact(self, account, gc_contact): def remove_gc_contact(self, account, gc_contact):
@ -254,9 +254,9 @@ class Contacts:
if not self._gc_contacts[account].has_key(gc_contact.room_jid): if not self._gc_contacts[account].has_key(gc_contact.room_jid):
return return
if not self._gc_contacts[account][gc_contact.room_jid].has_key( if not self._gc_contacts[account][gc_contact.room_jid].has_key(
gc_contact.nick): gc_contact.name):
return return
del self._gc_contacts[account][gc_contact.room_jid][gc_contact.nick] del self._gc_contacts[account][gc_contact.room_jid][gc_contact.name]
# It was the last nick in room ? # It was the last nick in room ?
if not len(self._gc_contacts[account][gc_contact.room_jid]): if not len(self._gc_contacts[account][gc_contact.room_jid]):
del self._gc_contacts[account][gc_contact.room_jid] del self._gc_contacts[account][gc_contact.room_jid]

View File

@ -397,7 +397,7 @@ class GroupchatWindow(chat.Chat):
else: else:
image = state_images[gc_contact.show] image = state_images[gc_contact.show]
name = gtkgui_helpers.escape_for_pango_markup(gc_contact.nick) name = gtkgui_helpers.escape_for_pango_markup(gc_contact.name)
status = gc_contact.status status = gc_contact.status
# add status msg, if not empty, under contact name in the treeview # add status msg, if not empty, under contact name in the treeview
if status and gajim.config.get('show_status_msgs_in_roster'): if status and gajim.config.get('show_status_msgs_in_roster'):

View File

@ -325,7 +325,7 @@ class GCTooltip(BaseTooltip):
if contact.jid.strip() != '': if contact.jid.strip() != '':
info = '<span size="large" weight="bold">' + contact.jid + '</span>' info = '<span size="large" weight="bold">' + contact.jid + '</span>'
else: else:
info = '<span size="large" weight="bold">' + contact.nick + '</span>' info = '<span size="large" weight="bold">' + contact.name + '</span>'
info += '\n<span weight="bold">' + _('Role: ') + '</span>' + \ info += '\n<span weight="bold">' + _('Role: ') + '</span>' + \
helpers.get_uf_role(contact.role) helpers.get_uf_role(contact.role)