diff options
author | Johannes Löthberg <johannes@kyriasis.com> | 2016-10-05 11:06:16 +0200 |
---|---|---|
committer | Johannes Löthberg <johannes@kyriasis.com> | 2017-06-01 18:37:33 +0200 |
commit | c06e64a6556f1703f9455ad91299c521ad8b3ed8 (patch) | |
tree | f8ad6e602df47c837251c6525f4dfb4a8b04ab1b /weechat/python/colorize_nicks.py | |
parent | bca24f634795b670883348f7aaca95f987e0c388 (diff) | |
download | dotfiles-c06e64a6556f1703f9455ad91299c521ad8b3ed8.tar.xz |
weechat: I give up
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Diffstat (limited to 'weechat/python/colorize_nicks.py')
-rw-r--r-- | weechat/python/colorize_nicks.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/weechat/python/colorize_nicks.py b/weechat/python/colorize_nicks.py index 5978253..03dac1d 100644 --- a/weechat/python/colorize_nicks.py +++ b/weechat/python/colorize_nicks.py @@ -21,6 +21,8 @@ # # # History: +# 2015-07-28, xt +# version 21: fix problems with nicks with commas in them # 2015-04-19, xt # version 20: fix ignore of nicks in URLs # 2015-04-18, xt @@ -73,7 +75,7 @@ w = weechat SCRIPT_NAME = "colorize_nicks" SCRIPT_AUTHOR = "xt <xt@bash.no>" -SCRIPT_VERSION = "20" +SCRIPT_VERSION = "21" SCRIPT_LICENSE = "GPL" SCRIPT_DESC = "Use the weechat nick colors in the chat area" @@ -287,7 +289,10 @@ def add_nick(data, signal, type_data): ''' Add nick to dict of colored nicks ''' global colored_nicks - pointer, nick = type_data.split(',') + # Nicks can have , in them in some protocols + splitted = type_data.split(',') + pointer = splitted[0] + nick = ",".join(splitted[1:]) if pointer not in colored_nicks: colored_nicks[pointer] = {} @@ -302,7 +307,10 @@ def remove_nick(data, signal, type_data): ''' Remove nick from dict with colored nicks ''' global colored_nicks - pointer, nick = type_data.split(',') + # Nicks can have , in them in some protocols + splitted = type_data.split(',') + pointer = splitted[0] + nick = ",".join(splitted[1:]) if pointer in colored_nicks and nick in colored_nicks[pointer]: del colored_nicks[pointer][nick] |