Add a show_roster_jids option

This commit is contained in:
mathieui 2012-04-19 00:20:03 +02:00
parent 9ddd2481c7
commit abe8c0ab71
3 changed files with 14 additions and 1 deletions

View file

@ -215,6 +215,12 @@ use_tab_nicks = true
# the @) when displaying the MUC tab name.
show_muc_jid = true
# If this option is set to false, the roster will not show the contact JIDs
# when that is possible.
# e.g. instead of: toto (toto@example.org) (2)
# poezio will only show: toto (2)
show_roster_jids = true
# The terminal can beep on various event. Put the event you want in a list
# (separated by spaces).
# The events can be

View file

@ -269,6 +269,11 @@ section of this documentation.
jid. E.g. if you have poezio@muc.poezio.eu, it will be displayed as
`poezio`. This will be used only if use_tab_nicks is set to true.
*show_roster_jids*:: true
Set this to false if you want to hide the JIDs in the roster (and keep only
the contact names). If there is no contact name, the JID will still be
displayed.
*beep_on*:: highlight private

View file

@ -1628,7 +1628,9 @@ class RosterWin(Win):
presence = resource.presence
nb = ' (%s)' % (contact.get_nb_resources(),)
color = RosterWin.color_show[presence]()
if contact.name:
if config.getl('show_roster_jids', 'true') == 'false' and contact.name:
display_name = '%s %s' % (contact.name, nb[1:])
elif contact.name:
display_name = '%s (%s)%s' % (contact.name,
contact.bare_jid, nb,)
else: