Encyclopedia: Fix addressing on replies.
This commit is contained in:
@ -24,7 +24,7 @@ import supybot
|
||||
import supybot.world as world
|
||||
from imp import reload
|
||||
|
||||
__version__ = "2.7"
|
||||
__version__ = "2.8"
|
||||
__author__ = supybot.Author("Krytarik Raido", "krytarik", "krytarik@tuxgarage.com")
|
||||
__contributors__ = {
|
||||
supybot.Author("Dennis Kaarsemaker", "Seveas", "dennis@kaarsemaker.net"): ['Original Author'],
|
||||
|
@ -475,7 +475,7 @@ class Encyclopedia(callbacks.Plugin):
|
||||
retmsg = "%s: " % msg.nick if term[2] else '' # Redirect back at the caller, rather than the target
|
||||
elif re.match(r"^what'?s?\b", lower_term): # Try and catch people saying "ubottu: what is ...?"
|
||||
ret = "I am only a bot, please don't think I'm intelligent :)"
|
||||
retmsg = "%s: " % msg.nick if term[2] or channel else '' # Redirect back at the caller, rather than the target
|
||||
retmsg = "%s: " % msg.nick if channel else ''
|
||||
|
||||
# Lookup, search or edit?
|
||||
elif lower_term.startswith('search '):
|
||||
@ -529,15 +529,11 @@ class Encyclopedia(callbacks.Plugin):
|
||||
ret = ret % repr(text).lstrip('u')
|
||||
else:
|
||||
ret = ret % repr(text)
|
||||
if not channel or self.registryValue('privateNotFound', channel):
|
||||
myqueue(irc, msg.nick, ret)
|
||||
else:
|
||||
myqueue(irc, channel, ret)
|
||||
return
|
||||
|
||||
if doChanMsg and channel and not ircutils.isChannel(target) \
|
||||
and target in irc.state.channels[channel].users:
|
||||
myqueue(irc, channel, "%s: Please see my private message" % target)
|
||||
if not channel or self.registryValue('privateNotFound', channel):
|
||||
myqueue(irc, msg.nick, ret)
|
||||
else:
|
||||
myqueue(irc, channel, ret)
|
||||
return
|
||||
|
||||
if not isinstance(ret, list):
|
||||
myqueue(irc, target, retmsg + ret)
|
||||
@ -550,6 +546,9 @@ class Encyclopedia(callbacks.Plugin):
|
||||
if retmsg and checkUrl(retmsg):
|
||||
# !ops factoid called with a URL, most likely spam
|
||||
return
|
||||
if doChanMsg and channel and not ircutils.isChannel(target) \
|
||||
and target in irc.state.channels[channel].users:
|
||||
myqueue(irc, channel, "%s: Please see my private message" % target)
|
||||
myqueue(irc, target, retmsg + ret[0])
|
||||
for r in ret[1:]:
|
||||
myqueue(irc, target, r)
|
||||
|
Reference in New Issue
Block a user