Actually commit the right commit this time
This commit is contained in:
@ -443,6 +443,12 @@ class Encyclopedia(callbacks.Plugin):
|
|||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
queue_msg = True # Queue message or send directly
|
||||||
|
def noqueue(irc, to, msg):
|
||||||
|
irc.queueMsg(ircmsgs.privmsg(to, msg))
|
||||||
|
def myqueue(irc, to, msg):
|
||||||
|
(queue if queue_msg else noqueue)(irc, to, msg)
|
||||||
|
|
||||||
# Filter CTCP
|
# Filter CTCP
|
||||||
if chr(1) in msg.args[1]:
|
if chr(1) in msg.args[1]:
|
||||||
return
|
return
|
||||||
@ -457,7 +463,6 @@ class Encyclopedia(callbacks.Plugin):
|
|||||||
doChanMsg = True # Send message to channel
|
doChanMsg = True # Send message to channel
|
||||||
display_info = False # Switch to info display
|
display_info = False # Switch to info display
|
||||||
display_raw = False # Switch to raw display
|
display_raw = False # Switch to raw display
|
||||||
queue_msg = True # Queue message or send directly
|
|
||||||
target = msg.args[0]
|
target = msg.args[0]
|
||||||
if target[0] != '#':
|
if target[0] != '#':
|
||||||
target = msg.nick
|
target = msg.nick
|
||||||
@ -544,12 +549,10 @@ class Encyclopedia(callbacks.Plugin):
|
|||||||
ret = self.registryValue('notfoundmsg')
|
ret = self.registryValue('notfoundmsg')
|
||||||
if ret.count('%') == ret.count('%s') == 1:
|
if ret.count('%') == ret.count('%s') == 1:
|
||||||
ret = ret % repr(text)
|
ret = ret % repr(text)
|
||||||
if channel.lower() == irc.nick.lower():
|
if channel.lower() == irc.nick.lower() or self.registryValue('privateNotFound', channel):
|
||||||
queue(irc, msg.nick, ret)
|
myqueue(irc, msg.nick, ret)
|
||||||
elif self.registryValue('privateNotFound', channel):
|
|
||||||
queue(irc, msg.nick, ret)
|
|
||||||
else:
|
else:
|
||||||
queue(irc, channel, ret)
|
myqueue(irc, channel, ret)
|
||||||
return
|
return
|
||||||
# check if retmsg has urls (possible spam)
|
# check if retmsg has urls (possible spam)
|
||||||
if checkUrl(retmsg):
|
if checkUrl(retmsg):
|
||||||
@ -562,17 +565,17 @@ class Encyclopedia(callbacks.Plugin):
|
|||||||
return
|
return
|
||||||
if doChanMsg and channel.lower() != irc.nick.lower() and target[0] != '#': # not /msg
|
if doChanMsg and channel.lower() != irc.nick.lower() and target[0] != '#': # not /msg
|
||||||
if target in irc.state.channels[channel].users:
|
if target in irc.state.channels[channel].users:
|
||||||
queue(irc, channel, "%s, please see my private message" % target)
|
myqueue(irc, channel, "%s, please see my private message" % target)
|
||||||
if type(ret) != list:
|
if type(ret) != list:
|
||||||
queue(irc, target, retmsg + ret)
|
myqueue(irc, target, retmsg + ret)
|
||||||
else:
|
else:
|
||||||
queue(irc, target, retmsg + ret[0])
|
myqueue(irc, target, retmsg + ret[0])
|
||||||
if self.alert:
|
if self.alert:
|
||||||
if target.startswith('#') and not target.endswith('bots'):
|
if target.startswith('#') and not target.endswith('bots'):
|
||||||
irc.queueMsg(ircmsgs.privmsg(self.registryValue('relayChannel', channel), '%s called the ops in %s (%s)' % (msg.nick, msg.args[0], retmsg[:-2])))
|
irc.queueMsg(ircmsgs.privmsg(self.registryValue('relayChannel', channel), '%s called the ops in %s (%s)' % (msg.nick, msg.args[0], retmsg[:-2])))
|
||||||
self.alert = False
|
self.alert = False
|
||||||
for r in ret[1:]:
|
for r in ret[1:]:
|
||||||
queue(irc, target, r)
|
myqueue(irc, target, r)
|
||||||
|
|
||||||
def doPart(self, irc, msg):
|
def doPart(self, irc, msg):
|
||||||
if len(msg.args) < 2 or not msg.args[1].startswith('requested by'):
|
if len(msg.args) < 2 or not msg.args[1].startswith('requested by'):
|
||||||
|
Reference in New Issue
Block a user