Keep a list of CAP capabilities in IRCServer

This commit is contained in:
jesopo 2018-09-03 22:17:01 +01:00
parent 94945da9be
commit 759cd64f33
2 changed files with 6 additions and 1 deletions

View file

@ -283,9 +283,12 @@ class LineHandler(object):
event["server"].send_capability_queue() event["server"].send_capability_queue()
else: else:
event["server"].send_capability_end() event["server"].send_capability_end()
elif subcommand == "ack" or subcommand == "nack": elif subcommand == "ack":
if not event["server"].waiting_for_capabilities(): if not event["server"].waiting_for_capabilities():
event["server"].send_capability_end() event["server"].send_capability_end()
event["server"].capabilities = set(capabilities)
elif subcommand == "ack" or subcommand == "nack":
event["server"].send_capability_end()
# the server is asking for authentication # the server is asking for authentication
def authenticate(self, event): def authenticate(self, event):

View file

@ -26,8 +26,10 @@ class Server(object):
self.original_username = username or nickname self.original_username = username or nickname
self.original_realname = realname or nickname self.original_realname = realname or nickname
self.name = None self.name = None
self._capability_queue = set([]) self._capability_queue = set([])
self._capabilities_waiting = set([]) self._capabilities_waiting = set([])
self.capabilities = set([])
self.write_buffer = b"" self.write_buffer = b""
self.buffered_lines = [] self.buffered_lines = []