From 04d736bbcf9e1422515f7192f996939612215ca0 Mon Sep 17 00:00:00 2001 From: wowaname Date: Tue, 24 Jan 2017 06:00:29 +0000 Subject: [PATCH] colo.py --- scripts/colo.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/colo.py b/scripts/colo.py index f63ee58..94b5b00 100644 --- a/scripts/colo.py +++ b/scripts/colo.py @@ -150,16 +150,17 @@ def cb_colo (data, mod, buf, input): fmt = "%".join(fmt) nest = is_command(fmt) - iptr = weechat.infolist_get("irc_server", "", weechat.buffer_get_string( - buf, "localvar_server")) + servername = weechat.buffer_get_string(buf, "localvar_server") + iptr = weechat.infolist_get("irc_server", "", servername) weechat.infolist_next(iptr) long_lines = weechat.infolist_integer(iptr, "cap_long_lines") weechat.infolist_free(iptr) - l = ((512 if long_lines else 0) + 409 - len(fmt) - - int( weechat.info_get("irc_server_isupport_value", "%s,NICKLEN" % - weechat.buffer_get_string(buf, "localvar_server")) ) - ) + nicklen = weechat.info_get("irc_server_isupport_value", "%s,NICKLEN" % + servername) + if not nicklen: nicklen = 9 + + l = ((512 if long_lines else 0) + 409 - len(fmt) - int(nicklen)) o = [] for line in input.replace("\r", "\n").split("\n"): if not line: continue