Add an option to configure the max nick length
This commit is contained in:
parent
0b2037a67c
commit
28d790717f
1 changed files with 4 additions and 1 deletions
|
@ -47,7 +47,10 @@ g_lock = RLock()
|
||||||
|
|
||||||
LINES_NB_LIMIT = 4096
|
LINES_NB_LIMIT = 4096
|
||||||
|
|
||||||
def truncate_nick(nick, size=25):
|
def truncate_nick(nick, size=None):
|
||||||
|
size = size or config.get('max_nick_length', 25)
|
||||||
|
if size < 1:
|
||||||
|
size = 1
|
||||||
if nick and len(nick) >= size:
|
if nick and len(nick) >= size:
|
||||||
return nick[:size]+'…'
|
return nick[:size]+'…'
|
||||||
return nick
|
return nick
|
||||||
|
|
Loading…
Reference in a new issue