mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-05 18:49:23 +01:00
Remove the '(XX more messages)' when the next message is sent immediately after
It's pointless and looks stupid. It will look even more stupid when we enable multiline, because the suffixes will be in the middle of the concatenated message.
This commit is contained in:
parent
f98542e884
commit
11e79e44c5
@ -999,10 +999,17 @@ class NestedCommandsIrcProxy(ReplyIrcProxy):
|
||||
# (which is used like a stack)
|
||||
chunks.reverse()
|
||||
|
||||
instant = conf.get(conf.supybot.reply.mores.instant,
|
||||
channel=target, network=self.irc.network)
|
||||
|
||||
msgs = []
|
||||
for (i, chunk) in enumerate(chunks):
|
||||
if i == 0:
|
||||
pass # last message, no suffix to add
|
||||
elif len(chunks) - i < instant:
|
||||
# one of the first messages, and the next one will
|
||||
# also be sent immediately, so no suffix
|
||||
pass
|
||||
else:
|
||||
if i == 1:
|
||||
more = _('more message')
|
||||
@ -1012,8 +1019,6 @@ class NestedCommandsIrcProxy(ReplyIrcProxy):
|
||||
chunk = '%s %s' % (chunk, n)
|
||||
msgs.append(_makeReply(self, msg, chunk, **replyArgs))
|
||||
|
||||
instant = conf.get(conf.supybot.reply.mores.instant,
|
||||
channel=target, network=self.irc.network)
|
||||
while instant > 1 and msgs:
|
||||
instant -= 1
|
||||
response = msgs.pop()
|
||||
|
@ -540,28 +540,28 @@ class PrivmsgTestCase(ChannelPluginTestCase):
|
||||
self.assertResponse(
|
||||
"eval 'foo '*300",
|
||||
"'" + "foo " * 110 + " \x02(2 more messages)\x02")
|
||||
self.assertNoResponse(' ')
|
||||
self.assertNoResponse(" ", timeout=0.1)
|
||||
|
||||
with conf.supybot.reply.mores.instant.context(2):
|
||||
self.assertResponse(
|
||||
"eval 'foo '*300",
|
||||
"'" + "foo " * 110 + " \x02(2 more messages)\x02")
|
||||
"'" + "foo " * 110)
|
||||
self.assertResponse(
|
||||
" ",
|
||||
"foo " * 111 + "\x02(1 more message)\x02")
|
||||
self.assertNoResponse(" ")
|
||||
self.assertNoResponse(" ", timeout=0.1)
|
||||
|
||||
with conf.supybot.reply.mores.instant.context(3):
|
||||
self.assertResponse(
|
||||
"eval 'foo '*300",
|
||||
"'" + "foo " * 110 + " \x02(2 more messages)\x02")
|
||||
"'" + "foo " * 110)
|
||||
self.assertResponse(
|
||||
" ",
|
||||
"foo " * 111 + "\x02(1 more message)\x02")
|
||||
"foo " * 110 + "foo")
|
||||
self.assertResponse(
|
||||
" ",
|
||||
" " + "foo " * 79 + "'")
|
||||
self.assertNoResponse(" ")
|
||||
self.assertNoResponse(" ", timeout=0.1)
|
||||
|
||||
def testClientTagReply(self):
|
||||
self.irc.addCallback(self.First(self.irc))
|
||||
|
Loading…
Reference in New Issue
Block a user