[Bahtiar `kalkin-` Gadimov]

Shorten name of a gc entry in "Join GC" submenu

Some XMPP clients save the subject of a group chat as the bookmark name. The
subject can be very long thus the MenuItems can get also very long. This simple
patch shortens the name to a carefully chosen value.
Fixes #8218
This commit is contained in:
Yann Leboulanger 2016-01-16 14:18:16 +01:00
parent 8237f27704
commit 35349d9ee4
1 changed files with 4 additions and 0 deletions

View File

@ -6158,6 +6158,10 @@ class RosterWindow:
# No name was given for this bookmark.
# Use the first part of JID instead...
name = bookmark['jid'].split("@")[0]
# Shorten long names
name = (name[:42] + '..') if len(name) > 42 else name
# Do not use underline.
item = Gtk.MenuItem.new_with_label(name)
item.set_use_underline(False)