Encyclopedia: Fix addressing on replies.
This commit is contained in:
parent
18b4fe831a
commit
fdbaa3fc36
|
@ -24,7 +24,7 @@ import supybot
|
||||||
import supybot.world as world
|
import supybot.world as world
|
||||||
from imp import reload
|
from imp import reload
|
||||||
|
|
||||||
__version__ = "2.7"
|
__version__ = "2.8"
|
||||||
__author__ = supybot.Author("Krytarik Raido", "krytarik", "krytarik@tuxgarage.com")
|
__author__ = supybot.Author("Krytarik Raido", "krytarik", "krytarik@tuxgarage.com")
|
||||||
__contributors__ = {
|
__contributors__ = {
|
||||||
supybot.Author("Dennis Kaarsemaker", "Seveas", "dennis@kaarsemaker.net"): ['Original Author'],
|
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
|
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 ...?"
|
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 :)"
|
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?
|
# Lookup, search or edit?
|
||||||
elif lower_term.startswith('search '):
|
elif lower_term.startswith('search '):
|
||||||
|
@ -529,15 +529,11 @@ class Encyclopedia(callbacks.Plugin):
|
||||||
ret = ret % repr(text).lstrip('u')
|
ret = ret % repr(text).lstrip('u')
|
||||||
else:
|
else:
|
||||||
ret = ret % repr(text)
|
ret = ret % repr(text)
|
||||||
if not channel or self.registryValue('privateNotFound', channel):
|
if not channel or self.registryValue('privateNotFound', channel):
|
||||||
myqueue(irc, msg.nick, ret)
|
myqueue(irc, msg.nick, ret)
|
||||||
else:
|
else:
|
||||||
myqueue(irc, channel, ret)
|
myqueue(irc, channel, ret)
|
||||||
return
|
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 isinstance(ret, list):
|
if not isinstance(ret, list):
|
||||||
myqueue(irc, target, retmsg + ret)
|
myqueue(irc, target, retmsg + ret)
|
||||||
|
@ -550,6 +546,9 @@ class Encyclopedia(callbacks.Plugin):
|
||||||
if retmsg and checkUrl(retmsg):
|
if retmsg and checkUrl(retmsg):
|
||||||
# !ops factoid called with a URL, most likely spam
|
# !ops factoid called with a URL, most likely spam
|
||||||
return
|
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])
|
myqueue(irc, target, retmsg + ret[0])
|
||||||
for r in ret[1:]:
|
for r in ret[1:]:
|
||||||
myqueue(irc, target, r)
|
myqueue(irc, target, r)
|
||||||
|
|
Loading…
Reference in New Issue