From 262911606f1d3d7c388095ac778fe89bc80f12f6 Mon Sep 17 00:00:00 2001 From: wowaname Date: Sat, 17 Dec 2016 22:48:12 +0000 Subject: [PATCH] colo.py: long lines if server supports --- scripts/colo.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/colo.py b/scripts/colo.py index 88dd911..f63ee58 100644 --- a/scripts/colo.py +++ b/scripts/colo.py @@ -10,7 +10,7 @@ import weechat SCRIPT_NAME = "colo" SCRIPT_AUTHOR = "The Krusty Krab " -SCRIPT_VERSION = "2.1" +SCRIPT_VERSION = "2.2" SCRIPT_LICENSE = "Public domain" SCRIPT_DESC = "Makes your chats noticable" @@ -150,8 +150,13 @@ 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")) + weechat.infolist_next(iptr) + long_lines = weechat.infolist_integer(iptr, "cap_long_lines") + weechat.infolist_free(iptr) - l = (409 - len(fmt) - + 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")) ) )