Skip to content

Commit

Permalink
Merge pull request #133 from edman80/master
Browse files Browse the repository at this point in the history
Implemented ISON in accordance to the RFC.
  • Loading branch information
jaraco committed Dec 17, 2017
2 parents 40e19be + 40b5d99 commit 8bf0c80
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
16.2
====

* #133: In ``irc.server``, add support for ISON.

16.1
====

Expand Down
12 changes: 12 additions & 0 deletions irc/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,18 @@ def handle_dump(self, params):
for client in channel.clients:
print(" ", client.nick, client)

def handle_ison(self, params):
response = ':%s 303 %s :' % (self.server.servername, self.client_ident().nick)
if len(params) == 0 or params.isspace():
response = ':%s 461 %s ISON :Not enough parameters' % (self.server.servername, self.client_ident().nick)
return response
nickOnline = []
for nick in params.split(" "):
if nick in self.server.clients:
nickOnline.append(nick)
response += ' '.join(nickOnline)
return response

def client_ident(self):
"""
Return the client identifier as included in many command replies.
Expand Down

0 comments on commit 8bf0c80

Please sign in to comment.