summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2012-02-15 20:05:38 +0100
committerFlorent Le Coz <louiz@louiz.org>2012-02-15 20:05:38 +0100
commit28d790717f78bb7a24d0b4d953bdb4a938b673fb (patch)
tree4d350ec6016bc88bfda992ec5cd321134826ed8a
parent0b2037a67c60c860dd50f572cca34e9e0595c1e4 (diff)
downloadpoezio-28d790717f78bb7a24d0b4d953bdb4a938b673fb.tar.gz
poezio-28d790717f78bb7a24d0b4d953bdb4a938b673fb.tar.bz2
poezio-28d790717f78bb7a24d0b4d953bdb4a938b673fb.tar.xz
poezio-28d790717f78bb7a24d0b4d953bdb4a938b673fb.zip
Add an option to configure the max nick length
-rw-r--r--src/windows.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/windows.py b/src/windows.py
index 1b833290..68518086 100644
--- a/src/windows.py
+++ b/src/windows.py
@@ -47,7 +47,10 @@ g_lock = RLock()
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:
return nick[:size]+'…'
return nick