summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xminiircd9
1 files changed, 6 insertions, 3 deletions
diff --git a/miniircd b/miniircd
index 74f1fc6..f0d5a01 100755
--- a/miniircd
+++ b/miniircd
@@ -205,7 +205,6 @@ class Client(object):
continue
server.add_member_to_channel(self, channelname)
channel = server.get_channel(channelname)
- self.channels[irc_lower(channelname)] = channel
self.message_channel(channel, "JOIN", channelname, True)
self.channel_log(channel, "joined", meta=True)
if channel.topic:
@@ -640,8 +639,7 @@ class Server(object):
if irc_lower(channelname) in self.channels:
channel = self.channels[irc_lower(channelname)]
else:
- channel = Channel(self, channelname)
- self.channels[irc_lower(channelname)] = channel
+ channel = self.add_channel(channelname)
channel.add_member(client)
def remove_member_from_channel(self, client, channelname):
@@ -659,6 +657,11 @@ class Server(object):
del self.nicknames[irc_lower(client.nickname)]
del self.clients[client.socket]
+ def add_channel(self, name):
+ channel = Channel(self, channelname)
+ self.channels[irc_lower(channelname)] = channel
+ return channel
+
def remove_channel(self, channel):
del self.channels[irc_lower(channel.name)]