From e70b7dd01f82cd70faeec56895e029cf27dbad41 Mon Sep 17 00:00:00 2001 From: Alex Wright Date: Sun, 3 Feb 2013 08:16:32 +0000 Subject: Moving luser output to it's own method. --- miniircd | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/miniircd b/miniircd index 5aaa629..9857216 100755 --- a/miniircd +++ b/miniircd @@ -212,8 +212,7 @@ class Client(object): % self.nickname) self.reply("004 %s :%s miniircd-%s o o" % (self.nickname, server.name, VERSION)) - self.reply("251 %s :There are %d users and 0 services on 1 server" - % (self.nickname, len(server.clients))) + self.send_lusers() self.send_motd() self.__handle_command = self.__command_handler @@ -230,8 +229,7 @@ class Client(object): self.reply("303 %s :%s" % (self.nickname, " ".join(online))) def lusers_handler(): - self.reply("251 %s :There are %d users and 0 services on 1 server" - % (self.nickname, len(server.clients))) + self.send_lusers() def join_handler(): if len(arguments) < 1: @@ -615,6 +613,10 @@ class Client(object): for client in clients: client.message(msg) + def send_lusers(self): + self.reply("251 %s :There are %d users and 0 services on 1 server" + % (self.nickname, len(self.server.clients))) + def send_motd(self): server = self.server motdlines = server.get_motd_lines() -- cgit v1.2.3