From 5db67b0b2ca772cea9592da3a1774be23361ea25 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Sun, 7 Sep 2003 05:13:58 +0000 Subject: [PATCH] Changed (more) to show the number of remaining messages. --- src/MiscCommands.py | 8 +++++--- src/callbacks.py | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/MiscCommands.py b/src/MiscCommands.py index 4b3cb50e2..9fbcaa32a 100755 --- a/src/MiscCommands.py +++ b/src/MiscCommands.py @@ -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!') diff --git a/src/callbacks.py b/src/callbacks.py index 9723a50e6..5c88c530c 100644 --- a/src/callbacks.py +++ b/src/callbacks.py @@ -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))