Don't show ressource in join/left in gc, and neither in chat, except if more than

one ressource connected.
This commit is contained in:
Jean-Marie Traissard 2006-09-24 23:41:54 +00:00
parent f4a15a1d16
commit edc176975e
2 changed files with 9 additions and 2 deletions

View File

@ -857,7 +857,10 @@ class GroupchatControl(ChatControlBase):
print_status = gajim.config.get('print_status_in_muc') print_status = gajim.config.get('print_status_in_muc')
nick_jid = nick nick_jid = nick
if jid: if jid:
nick_jid += ' (%s)' % jid # delete ressource
jid_splitted = jid.split('/')
simple_jid = jid_splitted[0]
nick_jid += ' (%s)' % simple_jid
if show == 'offline' and print_status in ('all', 'in_and_out'): if show == 'offline' and print_status in ('all', 'in_and_out'):
st = _('%s has left') % nick_jid st = _('%s has left') % nick_jid
if reason: if reason:

View File

@ -1093,8 +1093,12 @@ class RosterWindow:
win.redraw_tab(ctrl) win.redraw_tab(ctrl)
name = contact.get_shown_name() name = contact.get_shown_name()
if contact.resource != '':
# if multiple resources (or second one disconnecting)
if (len(contact_instances) > 1 or (len(contact_instances) == 1 and \
show in ('offline', 'error'))) and contact.resource != '':
name += '/' + contact.resource name += '/' + contact.resource
uf_show = helpers.get_uf_show(show) uf_show = helpers.get_uf_show(show)
if status: if status:
ctrl.print_conversation(_('%s is now %s (%s)') % (name, uf_show, ctrl.print_conversation(_('%s is now %s (%s)') % (name, uf_show,