Commit cca2d09c authored by Romain Bignon's avatar Romain Bignon

display other users in + channels

parent 1ad64ce5
......@@ -53,6 +53,24 @@ class Channel(object):
def add_member(self, client):
self.members.add(client)
client.message(":%s JOIN %s" % (client.prefix, self.name))
if self.topic:
client.reply("332 %s %s :%s"
% (client.nickname, self.name, self.topic))
else:
client.reply("331 %s %s :No topic is set"
% (client.nickname, self.name))
members = [client.nickname]
if self.name.startswith('+'):
members += self.NICKNAMES
client.reply("353 %s = %s :%s"
% (client.nickname,
self.name,
' '.join(members)))
client.reply("366 %s %s :End of NAMES list"
% (client.nickname, self.name))
def remove_client(self, client):
self.members.discard(client)
......@@ -185,22 +203,8 @@ class Client(object):
client.message(line)
def join_channel(self, channel):
channelname = channel.name
channel.add_member(self)
self.channels[irc_lower(channelname)] = channel
self.message(":%s JOIN %s" % (self.prefix, channelname))
if channel.topic:
self.reply("332 %s %s :%s"
% (self.nickname, channel.name, channel.topic))
else:
self.reply("331 %s %s :No topic is set"
% (self.nickname, channel.name))
self.reply("353 %s = %s :%s"
% (self.nickname,
channelname,
self.nickname))
self.reply("366 %s %s :End of NAMES list"
% (self.nickname, channelname))
self.channels[irc_lower(channel.name)] = channel
def write_queue_size(self):
return len(self.writebuffer)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment