We have to unAction or we get ugly replies

This commit is contained in:
James Vega 2004-08-25 19:35:03 +00:00
parent ba7b018078
commit 85355f5da7
1 changed files with 6 additions and 4 deletions

View File

@ -199,14 +199,16 @@ class Markov(callbacks.Privmsg):
def die(self):
self.q.die()
def tokenize(self, s):
# XXX: Should this be smarter?
return s.split()
def tokenize(self, m):
if ircmsgs.isAction(m):
return ircmsgs.unAction(m).split()
else:
return m.args[1].split()
def doPrivmsg(self, irc, msg):
channel = msg.args[0]
if ircutils.isChannel(channel):
words = self.tokenize(msg.args[1])
words = self.tokenize(msg)
words.insert(0, '\n')
words.insert(0, '\n')
words.append('\n')