aboutsummaryrefslogtreecommitdiff
path: root/modules/line_handler
diff options
context:
space:
mode:
authorGravatar jesopo2019-06-20 16:52:23 +0100
committerGravatar jesopo2019-06-20 16:52:23 +0100
commit24cdff9e44c8afdbb6a1289b8da451ec1d0ba9af (patch)
tree0a147e612ffe1b5e5c3cc1ebe982f3f853898292 /modules/line_handler
parentreturn unshortened url when shortening fails (diff)
signature
Add an export for IRCv3 CAPs
Diffstat (limited to 'modules/line_handler')
-rw-r--r--modules/line_handler/__init__.py2
-rw-r--r--modules/line_handler/ircv3.py5
2 files changed, 5 insertions, 2 deletions
diff --git a/modules/line_handler/__init__.py b/modules/line_handler/__init__.py
index 15a921c2..0470e36a 100644
--- a/modules/line_handler/__init__.py
+++ b/modules/line_handler/__init__.py
@@ -133,7 +133,7 @@ class Module(ModuleManager.BaseModule):
# the server is telling us about its capabilities!
@utils.hook("raw.received.cap")
def cap(self, event):
- ircv3.cap(self.events, event)
+ ircv3.cap(self.exports, self.events, event)
# the server is asking for authentication
@utils.hook("raw.received.authenticate")
diff --git a/modules/line_handler/ircv3.py b/modules/line_handler/ircv3.py
index 3c389c85..93b814c8 100644
--- a/modules/line_handler/ircv3.py
+++ b/modules/line_handler/ircv3.py
@@ -27,7 +27,7 @@ def _cap_match(server, caps):
matched_caps[available] = cap
return matched_caps
-def cap(events, event):
+def cap(exports, events, event):
capabilities = utils.parse.keyvalue(event["args"][-1])
subcommand = event["args"][1].upper()
is_multiline = len(event["args"]) > 3 and event["args"][2] == "*"
@@ -50,6 +50,9 @@ def cap(events, event):
server_caps = list(event["server"].server_capabilities.keys())
all_caps = CAPABILITIES[:]
+ export_caps = [cap.copy() for cap in exports.get_all("cap")]
+ all_caps.extend(export_caps)
+
module_caps = events.on("received.cap.ls").call(
capabilities=event["server"].server_capabilities,
server=event["server"])