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