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] userHostmask = msg.prefix.split('!', 1)[1]
try: try:
chunk = self._mores[userHostmask].pop() chunk = self._mores[userHostmask].pop()
irc.reply(msg, chunk) if self._mores[userHostmask]:
chunk += ' (more)'
irc.reply(msg, chunk, True)
except KeyError: except KeyError:
irc.error(msg, 'You haven\'t asked me a command!') irc.error(msg, 'You haven\'t asked me a command!')
except IndexError: except IndexError:

View File

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