Skip to content

Commit

Permalink
Replace refs to config[servername] fixes #38
Browse files Browse the repository at this point in the history
  • Loading branch information
strictlymike committed Aug 5, 2017
1 parent 11b598c commit 2066ecd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions fakenet/listeners/IRCListener.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def irc_USER(self, cmd, params):
self.request.sendall('')

def irc_PING(self, cmd, params):
self.request.sendall(":%s PONG :%s" % (self.server.config['servername'], self.server.config['servername']))
self.request.sendall(":%s PONG :%s" % (self.server.servername, self.server.servername))


def irc_JOIN(self, cmd, params):
Expand Down Expand Up @@ -138,7 +138,7 @@ def irc_JOIN(self, cmd, params):
self.irc_send_server("366", "%s %s :End of /NAMES list" % (self.nick, channel_name))

# Send a welcome message
self.irc_send_client_custom('botmaster', 'botmaster', self.server.config['servername'], "PRIVMSG %s %s" % (channel_name, "Welcome to the channel! %s" % self.nick))
self.irc_send_client_custom('botmaster', 'botmaster', self.server.servername, "PRIVMSG %s %s" % (channel_name, "Welcome to the channel! %s" % self.nick))


def irc_PRIVMSG(self, cmd, params):
Expand All @@ -150,11 +150,11 @@ def irc_PRIVMSG(self, cmd, params):

# Echo the message in the channel back to the user
if target[0] in ['#', '$']:
self.irc_send_client_custom('botmaster', 'botmaster', self.server.config['servername'], "PRIVMSG %s %s" % (target, message))
self.irc_send_client_custom('botmaster', 'botmaster', self.server.servername, "PRIVMSG %s %s" % (target, message))

# Echo the private message back to the user
else:
self.irc_send_client_custom(target, target, self.server.config['servername'], "PRIVMSG %s %s" % (self.nick, message))
self.irc_send_client_custom(target, target, self.server.servername, "PRIVMSG %s %s" % (self.nick, message))


def irc_NOTICE(self, cmd, params):
Expand All @@ -164,10 +164,10 @@ def irc_PART(self, cmd, params):
pass

def irc_send_server(self, code, message):
self.request.sendall(":%s %s %s\r\n" % (self.server.config['servername'], code, message))
self.request.sendall(":%s %s %s\r\n" % (self.server.servername, code, message))

def irc_send_client(self, message):
self.irc_send_client_custom(self.nick, self.user, self.server.config['servername'], message)
self.irc_send_client_custom(self.nick, self.user, self.server.servername, message)

def irc_send_client_custom(self, nick, user, servername, message):
self.request.sendall(":%s!%s@%s %s\r\n" % (nick, user, servername, message))
Expand Down

0 comments on commit 2066ecd

Please sign in to comment.