$nick apparently was ubottu-specific, now it's in bzr
Also added $who which will be replaced with the callers nick
This commit is contained in:
parent
4eeb6ddc7f
commit
120035a5c1
|
@ -170,6 +170,7 @@ class Encyclopedia(callbacks.Plugin):
|
||||||
self.times = {}
|
self.times = {}
|
||||||
self.edits = {}
|
self.edits = {}
|
||||||
self.alert = False
|
self.alert = False
|
||||||
|
self.defaultIrc = irc
|
||||||
|
|
||||||
def addeditor(self, irc, msg, args, name):
|
def addeditor(self, irc, msg, args, name):
|
||||||
"""<name>
|
"""<name>
|
||||||
|
@ -526,7 +527,7 @@ class Encyclopedia(callbacks.Plugin):
|
||||||
text, target, retmsg = self.get_target(msg.nick, orig_text, target)
|
text, target, retmsg = self.get_target(msg.nick, orig_text, target)
|
||||||
if text.startswith('bug ') and text != ('bug 1'):
|
if text.startswith('bug ') and text != ('bug 1'):
|
||||||
return
|
return
|
||||||
ret = self.factoid_lookup(text, channel, display_info, display_raw)
|
ret = self.factoid_lookup(text, channel, display_info, display_raw, msg.nick)
|
||||||
|
|
||||||
if not ret:
|
if not ret:
|
||||||
if len(text) > 15:
|
if len(text) > 15:
|
||||||
|
@ -594,7 +595,7 @@ class Encyclopedia(callbacks.Plugin):
|
||||||
|
|
||||||
L = []
|
L = []
|
||||||
for factoid in factoids:
|
for factoid in factoids:
|
||||||
result = self.factoid_lookup(factoid.strip(prefix), channel, False)
|
result = self.factoid_lookup(factoid.strip(prefix), channel, False, False, nick)
|
||||||
L.extend(result)
|
L.extend(result)
|
||||||
|
|
||||||
if not L:
|
if not L:
|
||||||
|
@ -716,7 +717,7 @@ class Encyclopedia(callbacks.Plugin):
|
||||||
db.commit()
|
db.commit()
|
||||||
return "I'll remember that, %s" % editor[:editor.find('!')]
|
return "I'll remember that, %s" % editor[:editor.find('!')]
|
||||||
|
|
||||||
def factoid_lookup(self, text, channel, display_info, display_raw=False):
|
def factoid_lookup(self, text, channel, display_info, display_raw, msgNick):
|
||||||
def subvars(val):
|
def subvars(val):
|
||||||
curStable = self.registryValue('curStable')
|
curStable = self.registryValue('curStable')
|
||||||
curStableLong = self.registryValue('curStableLong')
|
curStableLong = self.registryValue('curStableLong')
|
||||||
|
@ -727,6 +728,8 @@ class Encyclopedia(callbacks.Plugin):
|
||||||
curDevel = self.registryValue('curDevel')
|
curDevel = self.registryValue('curDevel')
|
||||||
curDevelLong = self.registryValue('curDevelLong')
|
curDevelLong = self.registryValue('curDevelLong')
|
||||||
curDevelNum = self.registryValue('curDevelNum')
|
curDevelNum = self.registryValue('curDevelNum')
|
||||||
|
val = val.replace('$who',msgNick)
|
||||||
|
val = val.reaplce('$nick',self.defaultIrc.nick)
|
||||||
val = val.replace('$chan',channel)
|
val = val.replace('$chan',channel)
|
||||||
val = val.replace('$curStableLong',curStableLong)
|
val = val.replace('$curStableLong',curStableLong)
|
||||||
val = val.replace('$curStableNum',curStableNum)
|
val = val.replace('$curStableNum',curStableNum)
|
||||||
|
|
Loading…
Reference in New Issue