Fixed bug in more stuff.

This commit is contained in:
Jeremy Fincher 2003-09-07 04:56:26 +00:00
parent 3873b351f4
commit 723ff123e1
2 changed files with 8 additions and 4 deletions

View File

@ -218,7 +218,9 @@ class MiscCommands(callbacks.Privmsg):
userHostmask = msg.prefix.split('!', 1)[1]
try:
chunk = self._mores[userHostmask].pop()
irc.reply(msg, chunk)
if self._mores[userHostmask]:
chunk += ' (more)'
irc.reply(msg, chunk, True)
except KeyError:
irc.error(msg, 'You haven\'t asked me a command!')
except IndexError:

View File

@ -333,10 +333,12 @@ class IrcObjectProxy:
debug.recoverableException()
self.error(self.msg, debug.exnToString(e))
def reply(self, msg, s):
def reply(self, msg, s, noLengthCheck=False):
if self.finalEvaled:
if isinstance(self.irc, self.__class__):
self.irc.reply(msg, s)
self.irc.reply(msg, s, noLengthCheck)
elif noLengthCheck:
self.irc.queueMsg(reply(msg, s))
else:
# The size of a PRIVMSG is:
# 1 for the colon
@ -356,7 +358,7 @@ class IrcObjectProxy:
# 512 - 51 == 461.
s = ircutils.safeArgument(s)
allowedLength = 461 - len(self.irc.prefix)
msgs = textwrap.wrap(s, allowedLength)
msgs = textwrap.wrap(s, allowedLength-30) # -30 is for "nick:"
msgs.reverse()
response = msgs.pop()
if msgs: