mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-06 17:44:09 +01:00
Moved _mores to IrcObjectProxy, where it more rightfully belongs.
This commit is contained in:
parent
808db8153b
commit
70d1b1d5d0
@ -283,9 +283,9 @@ class Misc(callbacks.Privmsg):
|
|||||||
userHostmask = msg.prefix.split('!', 1)[1]
|
userHostmask = msg.prefix.split('!', 1)[1]
|
||||||
if nick:
|
if nick:
|
||||||
try:
|
try:
|
||||||
(private, L) = self._mores[nick]
|
(private, L) = irc._mores[nick]
|
||||||
if not private:
|
if not private:
|
||||||
self._mores[userHostmask] = L[:]
|
irc._mores[userHostmask] = L[:]
|
||||||
else:
|
else:
|
||||||
irc.error('%s has no public mores.' % nick)
|
irc.error('%s has no public mores.' % nick)
|
||||||
return
|
return
|
||||||
@ -293,7 +293,7 @@ class Misc(callbacks.Privmsg):
|
|||||||
irc.error('Sorry, I can\'t find any mores for %s' % nick)
|
irc.error('Sorry, I can\'t find any mores for %s' % nick)
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
L = self._mores[userHostmask]
|
L = irc._mores[userHostmask]
|
||||||
chunk = L.pop()
|
chunk = L.pop()
|
||||||
if L:
|
if L:
|
||||||
chunk += format(' \x02(%n)\x0F', (len(L), 'message', 'more'))
|
chunk += format(' \x02(%n)\x0F', (len(L), 'message', 'more'))
|
||||||
|
@ -178,7 +178,7 @@ class Owner(callbacks.Privmsg):
|
|||||||
|
|
||||||
def reset(self):
|
def reset(self):
|
||||||
# This has to be done somewhere, I figure here is as good place as any.
|
# This has to be done somewhere, I figure here is as good place as any.
|
||||||
callbacks.Privmsg._mores.clear()
|
callbacks.IrcObjectProxy._mores.clear()
|
||||||
self.__parent.reset()
|
self.__parent.reset()
|
||||||
|
|
||||||
def _connect(self, network, serverPort=None, password=''):
|
def _connect(self, network, serverPort=None, password=''):
|
||||||
|
@ -539,6 +539,7 @@ _repr = repr
|
|||||||
|
|
||||||
class IrcObjectProxy(RichReplyMethods):
|
class IrcObjectProxy(RichReplyMethods):
|
||||||
"A proxy object to allow proper nested of commands (even threaded ones)."
|
"A proxy object to allow proper nested of commands (even threaded ones)."
|
||||||
|
_mores = ircutils.IrcDict()
|
||||||
def __init__(self, irc, msg, args, nested=0):
|
def __init__(self, irc, msg, args, nested=0):
|
||||||
assert isinstance(args, list), 'Args should be a list, not a string.'
|
assert isinstance(args, list), 'Args should be a list, not a string.'
|
||||||
self.irc = irc
|
self.irc = irc
|
||||||
@ -858,10 +859,10 @@ class IrcObjectProxy(RichReplyMethods):
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
pass # We'll leave it as it is.
|
pass # We'll leave it as it is.
|
||||||
mask = prefix.split('!', 1)[1]
|
mask = prefix.split('!', 1)[1]
|
||||||
Privmsg._mores[mask] = msgs
|
self._mores[mask] = msgs
|
||||||
public = ircutils.isChannel(msg.args[0])
|
public = ircutils.isChannel(msg.args[0])
|
||||||
private = self.private or not public
|
private = self.private or not public
|
||||||
Privmsg._mores[msg.nick] = (private, msgs)
|
self._mores[msg.nick] = (private, msgs)
|
||||||
m = reply(msg, response, to=self.to,
|
m = reply(msg, response, to=self.to,
|
||||||
action=self.action,
|
action=self.action,
|
||||||
notice=self.notice,
|
notice=self.notice,
|
||||||
@ -1007,7 +1008,6 @@ class Privmsg(irclib.IrcCallback):
|
|||||||
Proxy = IrcObjectProxy
|
Proxy = IrcObjectProxy
|
||||||
commandArgs = ['self', 'irc', 'msg', 'args']
|
commandArgs = ['self', 'irc', 'msg', 'args']
|
||||||
# These must be class-scope, so all plugins use the same one.
|
# These must be class-scope, so all plugins use the same one.
|
||||||
_mores = ircutils.IrcDict()
|
|
||||||
_disabled = DisabledCommands()
|
_disabled = DisabledCommands()
|
||||||
def isDisabled(self, command):
|
def isDisabled(self, command):
|
||||||
return self._disabled.disabled(command, self.name())
|
return self._disabled.disabled(command, self.name())
|
||||||
|
Loading…
Reference in New Issue
Block a user