From 9a0b8f3d00877e9ada830628833e176442589f6c Mon Sep 17 00:00:00 2001 From: jesopo Date: Fri, 8 Feb 2019 17:48:41 +0000 Subject: [PATCH] `server_capabilities` is a dict, `capabilities` is a set (line_handler.py) --- modules/line_handler.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/line_handler.py b/modules/line_handler.py index ae354a1b..7b16e4ae 100644 --- a/modules/line_handler.py +++ b/modules/line_handler.py @@ -307,9 +307,10 @@ class Module(ModuleManager.BaseModule): else: event["server"].send_capability_end() elif subcommand == "new": - event["server"].capabilities.update(set(capabilities.keys())) + capabilities_keys = capabilities.keys() + event["server"].server_capabilities.update(capabilities) - matched_caps = self._match_caps(list(capabilities.keys())) + matched_caps = self._match_caps(list(capabilities_keys)) event["server"].queue_capabilities(matched_caps) self._event(event, "cap.new", server=event["server"], @@ -318,8 +319,10 @@ class Module(ModuleManager.BaseModule): if event["server"].has_capability_queue(): event["server"].send_capability_queue() elif subcommand == "del": - event["server"].capabilities.difference_update(set( - capabilities.keys())) + for capability in capabilities.keys(): + event["server"].capabilities.discard(capability) + del event["server"].server_capabilities[capability] + self._event(event, "cap.del", server=event["server"], capabilities=capabilities) elif subcommand == "ack":