Removing the "see foo" referencing code as it is error-prone (it's really tough

to accurately track self-referencing leading to recursion and circular
references leading to infinite looping) and I don't think it's all that useful.
Fixing it would make the already-contorted code of this plugin even worse!
This commit is contained in:
Daniel DiPaolo 2004-03-11 04:50:09 +00:00
parent a79bc26201
commit 4e7d862373
2 changed files with 0 additions and 15 deletions

View File

@ -173,11 +173,6 @@ class MoobotFactoids(callbacks.PrivmsgCommandAndRegexp):
elif newfact.startswith("<action>"):
newfact = newfact[8:]
type = "action"
elif newfact.startswith("see "):
newfact = newfact[4:]
type = "refer"
# shortcut the substitutions here
return (type, newfact)
newfact = newfact.strip()
newfact = plugins.standardSubstitute(irc, msg, newfact)
return (type, newfact)
@ -234,11 +229,6 @@ class MoobotFactoids(callbacks.PrivmsgCommandAndRegexp):
irc.reply(text, prefixName=False)
elif type == "define":
irc.reply("%s is %s" % (key, text), prefixName=False)
elif type == "refer":
# text here is the new key to refer to
msg.args = [s.replace(key, text) for s in msg.args]
newtokens = [s.replace(key, text) for s in tokens]
self.invalidCommand(irc, msg, newtokens)
else:
irc.error("Spurious type from _parseFactoid.")
return True

View File

@ -115,11 +115,6 @@ if sqlite is not None:
self.assertResponse('moo', 'foo')
self.assertNotError('foo is bar _is_ baz')
self.assertResponse('foo is bar', 'foo is bar is baz')
# Check the "see ..." referencing
self.assertNotError('bar is see moo')
self.assertResponse('bar', 'foo')
self.assertNotError('bar2 _is_ see foo is bar')
self.assertResponse('bar2', 'foo is bar is baz')
def testFactinfo(self):
self.assertNotError('moo is <reply>foo')