Changed (more) to show the number of remaining messages.

This commit is contained in:
Jeremy Fincher 2003-09-07 05:13:58 +00:00
parent 0c3cb0522b
commit 5db67b0b2c
2 changed files with 7 additions and 4 deletions

View File

@ -217,9 +217,11 @@ class MiscCommands(callbacks.Privmsg):
"""
userHostmask = msg.prefix.split('!', 1)[1]
try:
chunk = self._mores[userHostmask].pop()
if self._mores[userHostmask]:
chunk += ' \x02(more)\x0F'
L = self._mores[userHostmask]
chunk = L.pop()
if L:
chunk += ' \x02(%s)\x0F' % \
utils.nItems(len(L), 'message', 'more')
irc.reply(msg, chunk, True)
except KeyError:
irc.error(msg, 'You haven\'t asked me a command!')

View File

@ -362,7 +362,8 @@ class IrcObjectProxy:
msgs.reverse()
response = msgs.pop()
if msgs:
response += ' \x02(more)\x0F'
response += ' \x02(%s)\x0F' % \
utils.nItems(len(msgs), 'message', 'more')
mask = msg.prefix.split('!', 1)[1]
Privmsg._mores[mask] = msgs
self.irc.queueMsg(reply(msg, response))