colo.py: long lines if server supports

This commit is contained in:
wowaname 2016-12-17 22:48:12 +00:00
parent b93f5c7def
commit 262911606f

View File

@ -10,7 +10,7 @@ import weechat
SCRIPT_NAME = "colo" SCRIPT_NAME = "colo"
SCRIPT_AUTHOR = "The Krusty Krab <wowaname@volatile.ch>" SCRIPT_AUTHOR = "The Krusty Krab <wowaname@volatile.ch>"
SCRIPT_VERSION = "2.1" SCRIPT_VERSION = "2.2"
SCRIPT_LICENSE = "Public domain" SCRIPT_LICENSE = "Public domain"
SCRIPT_DESC = "Makes your chats noticable" SCRIPT_DESC = "Makes your chats noticable"
@ -150,8 +150,13 @@ def cb_colo (data, mod, buf, input):
fmt = "%".join(fmt) fmt = "%".join(fmt)
nest = is_command(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" % int( weechat.info_get("irc_server_isupport_value", "%s,NICKLEN" %
weechat.buffer_get_string(buf, "localvar_server")) ) weechat.buffer_get_string(buf, "localvar_server")) )
) )