server_capabilities is a dict, capabilities is a set (line_handler.py)

This commit is contained in:
jesopo 2019-02-08 17:48:41 +00:00
parent 91f78e834e
commit 9a0b8f3d00

View file

@ -307,9 +307,10 @@ class Module(ModuleManager.BaseModule):
else: else:
event["server"].send_capability_end() event["server"].send_capability_end()
elif subcommand == "new": 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) event["server"].queue_capabilities(matched_caps)
self._event(event, "cap.new", server=event["server"], self._event(event, "cap.new", server=event["server"],
@ -318,8 +319,10 @@ class Module(ModuleManager.BaseModule):
if event["server"].has_capability_queue(): if event["server"].has_capability_queue():
event["server"].send_capability_queue() event["server"].send_capability_queue()
elif subcommand == "del": elif subcommand == "del":
event["server"].capabilities.difference_update(set( for capability in capabilities.keys():
capabilities.keys())) event["server"].capabilities.discard(capability)
del event["server"].server_capabilities[capability]
self._event(event, "cap.del", server=event["server"], self._event(event, "cap.del", server=event["server"],
capabilities=capabilities) capabilities=capabilities)
elif subcommand == "ack": elif subcommand == "ack":