Skip to content

Commit

Permalink
fixed problem where initializing settings for the IrcBot are not read…
Browse files Browse the repository at this point in the history
… from database. Also fixed another case of the unicode problem.
  • Loading branch information
fdChasm committed May 29, 2010
1 parent e4e7adb commit 7887e26
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pyscripts/plugins/ircbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def connectionMade(self):
self.joined_channels = []
def signedOn(self):
for channel in self.factory.channels:
self.join(channel)
self.join(channel.encode('iso-8859-5'))
self.factory.signedOn(self)
def connectionLost(self, reason):
self.factory.signedOut(self)
Expand All @@ -134,7 +134,7 @@ def privmsg(self, user, channel, msg):
class IrcBotFactory(protocol.ClientFactory):
protocol = IrcBot
def __init__(self, nickname, channels):
self.nickname = nickname
self.nickname = nickname.encode('iso-8859-5')
self.channels = channels
self.bots = []
self.reconnect_count = 0
Expand Down Expand Up @@ -184,6 +184,8 @@ def dotemplate(ability, **args):

def init():
loadPluginConfig(config, 'IrcBot')
global factory
factory = IrcBotFactory(config['Connection']['nickname'], [config['Connection']['channel']])
config['Templates']['irc_message'] = string.Template(config['Templates']['irc_message'])
if config['Main']['enable'] == 'yes':
factory.doConnect()
Expand Down

0 comments on commit 7887e26

Please sign in to comment.