mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-24 11:04:05 +01:00
Deduplicate list of arguments of _makeReply.
This commit is contained in:
parent
5e91a68ab0
commit
61b47bb65b
@ -910,26 +910,27 @@ class NestedCommandsIrcProxy(ReplyIrcProxy):
|
|||||||
self.noLengthCheck=noLengthCheck or self.noLengthCheck or self.action
|
self.noLengthCheck=noLengthCheck or self.noLengthCheck or self.action
|
||||||
if not isinstance(s, minisix.string_types): # avoid trying to str() unicode
|
if not isinstance(s, minisix.string_types): # avoid trying to str() unicode
|
||||||
s = str(s) # Allow non-string esses.
|
s = str(s) # Allow non-string esses.
|
||||||
|
|
||||||
|
replyArgs = dict(
|
||||||
|
to=self.to,
|
||||||
|
notice=self.notice,
|
||||||
|
action=self.action,
|
||||||
|
private=self.private,
|
||||||
|
prefixNick=self.prefixNick,
|
||||||
|
stripCtcp=stripCtcp
|
||||||
|
)
|
||||||
|
|
||||||
if self.finalEvaled:
|
if self.finalEvaled:
|
||||||
try:
|
try:
|
||||||
if isinstance(self.irc, self.__class__):
|
if isinstance(self.irc, self.__class__):
|
||||||
s = s[:conf.supybot.reply.maximumLength()]
|
s = s[:conf.supybot.reply.maximumLength()]
|
||||||
return self.irc.reply(s, to=self.to,
|
return self.irc.reply(s,
|
||||||
notice=self.notice,
|
|
||||||
action=self.action,
|
|
||||||
private=self.private,
|
|
||||||
prefixNick=self.prefixNick,
|
|
||||||
noLengthCheck=self.noLengthCheck,
|
noLengthCheck=self.noLengthCheck,
|
||||||
stripCtcp=stripCtcp)
|
**replyArgs)
|
||||||
elif self.noLengthCheck:
|
elif self.noLengthCheck:
|
||||||
# noLengthCheck only matters to NestedCommandsIrcProxy, so
|
# noLengthCheck only matters to NestedCommandsIrcProxy, so
|
||||||
# it's not used here. Just in case you were wondering.
|
# it's not used here. Just in case you were wondering.
|
||||||
m = _makeReply(self, msg, s, to=self.to,
|
m = _makeReply(self, msg, s, **replyArgs)
|
||||||
notice=self.notice,
|
|
||||||
action=self.action,
|
|
||||||
private=self.private,
|
|
||||||
prefixNick=self.prefixNick,
|
|
||||||
stripCtcp=stripCtcp)
|
|
||||||
sendMsg(m)
|
sendMsg(m)
|
||||||
return m
|
return m
|
||||||
else:
|
else:
|
||||||
@ -961,11 +962,7 @@ class NestedCommandsIrcProxy(ReplyIrcProxy):
|
|||||||
# action implies noLengthCheck, which has already been
|
# action implies noLengthCheck, which has already been
|
||||||
# handled. Let's stick an assert in here just in case.
|
# handled. Let's stick an assert in here just in case.
|
||||||
assert not self.action
|
assert not self.action
|
||||||
m = _makeReply(self, msg, s, to=self.to,
|
m = _makeReply(self, msg, s, **replyArgs)
|
||||||
notice=self.notice,
|
|
||||||
private=self.private,
|
|
||||||
prefixNick=self.prefixNick,
|
|
||||||
stripCtcp=stripCtcp)
|
|
||||||
sendMsg(m)
|
sendMsg(m)
|
||||||
return m
|
return m
|
||||||
# The '(XX more messages)' may have not the same
|
# The '(XX more messages)' may have not the same
|
||||||
@ -978,11 +975,7 @@ class NestedCommandsIrcProxy(ReplyIrcProxy):
|
|||||||
while instant > 1 and msgs:
|
while instant > 1 and msgs:
|
||||||
instant -= 1
|
instant -= 1
|
||||||
response = msgs.pop()
|
response = msgs.pop()
|
||||||
m = _makeReply(self, msg, response, to=self.to,
|
m = _makeReply(self, msg, response, **replyArgs)
|
||||||
notice=self.notice,
|
|
||||||
private=self.private,
|
|
||||||
prefixNick=self.prefixNick,
|
|
||||||
stripCtcp=stripCtcp)
|
|
||||||
sendMsg(m)
|
sendMsg(m)
|
||||||
# XXX We should somehow allow these to be returned, but
|
# XXX We should somehow allow these to be returned, but
|
||||||
# until someone complains, we'll be fine :) We
|
# until someone complains, we'll be fine :) We
|
||||||
@ -1011,12 +1004,7 @@ class NestedCommandsIrcProxy(ReplyIrcProxy):
|
|||||||
public = bool(self.msg.channel)
|
public = bool(self.msg.channel)
|
||||||
private = self.private or not public
|
private = self.private or not public
|
||||||
self._mores[msg.nick] = (private, msgs)
|
self._mores[msg.nick] = (private, msgs)
|
||||||
m = _makeReply(self, msg, response, to=self.to,
|
m = _makeReply(self, msg, response, **replyArgs)
|
||||||
action=self.action,
|
|
||||||
notice=self.notice,
|
|
||||||
private=self.private,
|
|
||||||
prefixNick=self.prefixNick,
|
|
||||||
stripCtcp=stripCtcp)
|
|
||||||
sendMsg(m)
|
sendMsg(m)
|
||||||
return m
|
return m
|
||||||
finally:
|
finally:
|
||||||
|
Loading…
Reference in New Issue
Block a user