mirror of
https://github.com/jlu5/PyLink.git
synced 2025-02-02 15:44:06 +01:00
clientbot: block PRIVMSG/NOTICE from being routed the wrong way (#405)
This commit is contained in:
parent
f1fddefeac
commit
75158c47e2
@ -889,6 +889,10 @@ class ClientbotWrapperProtocol(Protocol):
|
|||||||
# <- :sender NOTICE somenick :afasfsa
|
# <- :sender NOTICE somenick :afasfsa
|
||||||
target = args[0]
|
target = args[0]
|
||||||
|
|
||||||
|
if self.irc.isInternalClient(source) or self.irc.isInternalServer(source):
|
||||||
|
log.warning('(%s) Received %s to %s being routed the wrong way!', self.irc.name, command, target)
|
||||||
|
return
|
||||||
|
|
||||||
# We use lowercase channels internally.
|
# We use lowercase channels internally.
|
||||||
if utils.isChannel(target):
|
if utils.isChannel(target):
|
||||||
target = self.irc.toLower(target)
|
target = self.irc.toLower(target)
|
||||||
@ -896,12 +900,12 @@ class ClientbotWrapperProtocol(Protocol):
|
|||||||
target = self.irc.nickToUid(target)
|
target = self.irc.nickToUid(target)
|
||||||
if target:
|
if target:
|
||||||
return {'target': target, 'text': args[1]}
|
return {'target': target, 'text': args[1]}
|
||||||
|
handle_notice = handle_privmsg
|
||||||
|
|
||||||
def handle_quit(self, source, command, args):
|
def handle_quit(self, source, command, args):
|
||||||
"""Handles incoming QUITs."""
|
"""Handles incoming QUITs."""
|
||||||
self.quit(source, args[0])
|
self.quit(source, args[0])
|
||||||
return {'text': args[0]}
|
return {'text': args[0]}
|
||||||
|
|
||||||
handle_notice = handle_privmsg
|
|
||||||
|
|
||||||
Class = ClientbotWrapperProtocol
|
Class = ClientbotWrapperProtocol
|
||||||
|
Loading…
Reference in New Issue
Block a user