From 7a3db82300c126ef3004899b98abd742b268a417 Mon Sep 17 00:00:00 2001 From: jesopo Date: Sun, 3 Mar 2019 22:38:34 +0000 Subject: Add IRCServer.has_capability and use it throughout line_handler --- modules/line_handler/channel.py | 2 +- modules/line_handler/core.py | 4 ++-- modules/line_handler/message.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'modules/line_handler') diff --git a/modules/line_handler/channel.py b/modules/line_handler/channel.py index a05cc2ff..487dcbd1 100644 --- a/modules/line_handler/channel.py +++ b/modules/line_handler/channel.py @@ -38,7 +38,7 @@ def handle_353(event): modes.add(event["server"].prefix_symbols[nickname[0]]) nickname = nickname[1:] - if "userhost-in-names" in event["server"].agreed_capabilities: + if event["server"].has_capability("userhost-in-names"): hostmask = utils.irc.seperate_hostmask(nickname) nickname = hostmask.nickname user = event["server"].get_user(hostmask.nickname) diff --git a/modules/line_handler/core.py b/modules/line_handler/core.py index 78a0c479..6ffc447f 100644 --- a/modules/line_handler/core.py +++ b/modules/line_handler/core.py @@ -29,8 +29,8 @@ def handle_005(events, event): isupport[key] = None event["server"].isupport.update(isupport) - if "NAMESX" in isupport and not "multi-prefix" in event[ - "server"].agreed_capabilities: + if "NAMESX" in isupport and not event["server"].has_capability( + "multi-prefix"): event["server"].send("PROTOCTL NAMESX") if "PREFIX" in isupport: diff --git a/modules/line_handler/message.py b/modules/line_handler/message.py index 9292aa17..aa0e9643 100644 --- a/modules/line_handler/message.py +++ b/modules/line_handler/message.py @@ -2,7 +2,7 @@ from src import utils def _from_self(server, direction, prefix): if direction == utils.Direction.SEND: - if "echo-message" in server.agreed_capabilities: + if server.has_capability("echo-message"): return None else: return True -- cgit v1.3.1-10-gc9f91